Programming with PCAs #
A (non-trivial) PCA is Turing-complete in the sense that it implements every partial computable function. We develop here basic programming constructs that witness this fact:
- the identity combinator
I - ordered pairs
pairwith projectionsfstandsnd - booleans
tru,faland the conditional statementite - fixed-point combinators
ZandY - Curry numerals
numeral nwith successorsucc, predecessorpredand primitive recursionprimrec
For each combinator C we prove a definedness lemma df_C characterizing
totality of expressions involving C. Characteristic equations for the
simpler combinators (I, K', pair, fst, snd, the booleans, X, W,
and the fixed-point combinators) are also proved here; equations for the
more complex Curry-numeral predecessor and primitive-recursion combinators
are omitted in this v4.30 port — they remain expressible in terms of the
combinators themselves.
The identity combinator
Equations
Instances For
The expression denoting the identity combinator
Equations
Instances For
Pairing #
The pairing combinator.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The first projection.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The first projection as a formal expression.
Equations
Instances For
The second projection.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The second projection as a formal expression.
Equations
Instances For
Conditional statements
Instances For
The boolean false
Instances For
The boolean true
Instances For
The fixed point combinator #
The call-by-name fixed-point combinator.
Equations
Instances For
The call-by-value fixed-point combinator.
Equations
Instances For
Curry numerals #
Curry numeral
Equations
- One or more equations did not get rendered due to their size.
- LeanPool.PartialCombinatoryAlgebras.PCA.numeral 0 = LeanPool.PartialCombinatoryAlgebras.PCA.I
Instances For
The successor of a Curry numeral
Equations
Instances For
Is a numeral equal to zero?
Equations
Instances For
Predecessor of a Curry numeral
Equations
- One or more equations did not get rendered due to their size.
Instances For
The predecessor combinator as a formal expression.
Equations
Instances For
Auxiliary combinator used in the definition of primitive recursion.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Primitive recursion
Equations
- One or more equations did not get rendered due to their size.