In theoretical computer science and mathematical logic, a partial combinatory algebra (pca) is an algebraic structure which can be viewed as an abstraction of a model of computation. The definition of pcas uses an idea from combinatory logic. Pcas are used to define realizability toposes.
Definition
A partial applicative structure[1]: 1 is simply a set equipped with a partial binary operation . In the context of realizability, this operation is usually denoted by simple juxtaposition, i.e., . It is usually not associative; by convention, the notation associates to the left as , matching the standard convention in lambda calculus.
The terms[1]: 2 (or expressions) over a partial applicative structure are defined inductively:
- A constant is an expression,
- A variable (from some fixed, countably infinite set of variables) is an expression,
- If and are expressions, then is an expression.
A term is closed if it contains no variables. A closed term may be evaluated in the natural way: a constant evaluates to itself, and if the terms and respectively evaluate to and , then evaluates to , if this is defined. Note that the evaluation is a partial operation, since not all applications are defined. A substitution operation is also defined in the natural way: if is a term, is a variable and is another term, denotes the term with all occurrences of replaced by . We write to simultaneously express that the term evaluates to a defined value and denote this value (this matches standard notation for values of partial functions). We also write when both closed terms either do not evaluate to a defined value, or evaluate to the same value.
The partial applicative structure A is said to be combinatorially complete[1]: 3 or functionally complete if, for every term (that is, a term whose free variables are among ), there exists an element such that:
- for all ,
- for all .
A partial combinatory algebra[1]: 3 (pca) is a combinatorially complete partial applicative structure. A total combinatory algebra (tca) is a pca whose application operation is total.
Informally, the combinatory completeness condition requires an analogue of the abstraction operation from lambda calculus to exist inside the pca.