Partial combinatory algebra

From testwiki
Revision as of 13:14, 2 March 2025 by imported>Citation bot (Added website. | Use this bot. Report bugs. | Suggested by Abductive | Category:Articles with empty sections from February 2025 | #UCB_Category 110/255)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

In theoretical computer science and mathematical logic, specifically in realizability, a partial combinatory algebra (pca) is an algebraic structure which abstracts a model of computation. The definition of pcas uses an idea from combinatory logic. The realizability topos over a pca is a model of higher-order intuitionistic logic where informally every function is a program in the pca's model of computation.

Definition

A partial applicative structure is simply a set A equipped with a partial binary operation A×AA called application. In the context of realizability, this operation is usually denoted by simple juxtaposition, i.e., (a,b)ab. It is usually not associative; by convention, the notation abc associates to the left as (ab)c, matching the standard convention in λ-calculus.Template:R

The terms (or expressions) over a partial applicative structure A are defined inductively:Template:RTemplate:R

  • A constant aA is an expression,
  • A variable, from some fixed, countably infinite set of variables, is an expression,
  • If e1 and e2 are expressions, then e1e2 is an expression.

(In other words, they form the free magma over the disjoint union A+V where V is the set of variables.)

A term is closed when it contains no variables. A closed term may be evaluated in the natural way: a constant aA evaluates to itself, and if the terms e1 and e2 respectively evaluate to a1 and a2, then e1e2 evaluates to a1a2, if this is defined. Note that the evaluation is a partial operation, since not all applications are defined. We write t to simultaneously express that the term t evaluates to a defined value and denote this value (this matches standard notation for values of partial functions). We also write tu when both closed terms t and u either do not evaluate to a defined value, or evaluate to the same value.

A substitution operation is also defined in the natural way: if t is a term, x is a variable and u is another term, t[u/x] denotes the term t with all occurrences of x replaced by u.

The partial applicative structure A is said to be combinatory complete or functionally complete if, for every term t(x0,,xn) (that is, a term t whose variables are among x0,,xn), there exists an element aA such that:Template:RTemplate:R

  • aa0an1 for all a0,,an1A,
  • aa0ant[a0/x0,,an/xn] for all a0,,anA.

A partial combinatory algebra (pca) is a combinatory 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.

Characterization by combinators

In the same way as there is a translation from λ-terms to terms of the SKI combinator calculus by eliminating λ-abstractions using combinators, pcas can be characterized by the existence of elements which satisfy equations analogous to the S and K combinators. Note, however, that some care must be taken in the statement and proof since application is not always defined in a pca.

Theorem:Template:RTemplate:R A partial applicative structure A is combinatory complete if and only if there exist two elements k,sA such that:

  • Kxy=x for all x,yA,
  • Sxy for all x,yA,
  • Sxyz(xz)(yz) for all x,y,zA.

For the proof, in the forward direction, if A is combinatory complete, it suffices to apply the definition of combinatory completeness to the terms tK(x,y):=x and tS(x,y,z):=(xz)(yz) to obtain K and S with the required properties.

It is the converse that involves abstraction elimination. Assume we have K and S as stated. Given a variable x and a term t, we define a term xt whose variables are those of t minus x, which plays a role similar to λxt in λ-calculus. The definition is by induction on t as follows:Template:RTemplate:R

  • xa=Ka for a constant aA,
  • xx=I where I:=SKK,
  • xy=Ky if y is a variable different from x,
  • x(uv)=S(xu)(xv).

Beware that the analogy between xt and λxt is not perfect. For example, the terms (xt)t and t[t/x] are not generally equivalent in a reasonable sense, e.g., taking a variable y different from x and a,bA constants, we have (xy)(ab)=Ky(ab), which cannot be considered equivalent to y because the latter always evaluates to c if y is replaced by a constant cA, while the former may not as ab may be undefined.Template:R

However, if t is a constant a, then (xt)a is indeed equivalent to t[a/x] in the sense that substituting all variables for some constants in these two terms gives the same result (per ).Template:R

Moreover, substituting variables by constants in xt always evaluates to a defined result, even if this would not be the case by substituting variables in t. For example, if a,bA are two constants, the term x(ab) (abstracting a variable which does not appear) is equal to S(Ka)(Kb). By the assumptions on K and S, this is well-defined, even though ab may not be well-defined.Template:R

These remarks imply that for all term t(x0,,xn), the value a:=x0xnt is well-defined and satisfies the two requirements of combinatory completeness.Template:R

Examples

First Kleene algebra

The first Kleene algebra 𝒦1 consists of the set with application ab:=ϕa(b), where ϕa denotes the a-th partial recursive function in a standard Gödel numbering.Template:RTemplate:R

This pca can also be relativized to an oracle D: we define a pca 𝒦1D with carrier by setting ab:=ϕaD(b), where ϕaD is the a-th partial recursive function with oracle D.Template:RTemplate:R

Untyped λ-calculus

We can form a pca (in fact a tca) by quotienting the set of closed (untyped) λ-terms by β-equivalence and taking the application to be the one inherited from λ-calculus.Template:RTemplate:R

Reflexive domains

Template:Empty section

Second Kleene algebra

Template:Empty section

References

Cite error: <ref> tag with name "van-oosten" defined in <references> is not used in prior text.
Cite error: <ref> tag with name "bauer" defined in <references> is not used in prior text.