14

Click here to load reader

The Logic of Calculation

Embed Size (px)

Citation preview

Page 1: The Logic of Calculation

Zcilschr. 1. math. h g i k und U r u n d h e n d . Math. Bd. 23, S. 4 5 - 5 8 (1977)

THE LOGIC OF CALCULATION

by JOHN T. KEARNS in Buffalo, New York (U.S.A.)

Q 1. Introduction

In this paper, I will give a precise characterization of (ordinary) combinatory logic in order to cont,rast it with the theory of combinatory logic with discriminators that was introduced in [6] and further developed in [7]. It will be shown that the primary difference between these two theories consists in the “Literal” way that combinatory logic with discriminators encodes functions and characterizes properties. This makes it possible to develop a logical system for combinatory: logic with discriminators in which syntactical properties can be expressed st,raightforwardly, avoiding the detour of G6del numbering.

Q 2. Constructed domains

The elements of constructed domains, also called algorithmic domains, are normally expressions; but I will use CURRY’S more abstract term ‘ob’ to designate them.

A constructed domain contains a finite number of basic obs. It may also contain complex obs formed from a finite number of occurrences of previously constructed obs (possibly including a null ob), organized by a composition structure. A given com- position structure is n-adic, uniting occurrences of n obs in a single ob. I n a complex ob there may be punctuating devices which are not counted as obs.

An effectively determined ,subset of a constructed domain is a constructed domain.

If 9 is a constructed domain, an n-adic function p is a transformation on 9 if q is effective, total, and takes n-tuples of obs in 9 to single obs in Q. An effective, total function from finite sequences of obs in 9 to single obs in 9 is also a transformation on 9. If the number of arguments of a transformation pl is not specified, it will be understood that q is binary. If pl is a binary transformation, then prl+l(X1, . . ., X,,,) is defined to be rp(q“(X, , . . ., &), X n + J . If d is a set of individuals and 9 is a con- structed domain, then a binary relation R is a correspondence from € to 9 iff R is a one-one relation from 8 to a subset of 9.

Q 3. Construction processes

The elements of formal languages and proofs in formal systems are produced by construction processes. A construction process has a finite number of initial obs from some constructed domain, and is a procedure for producing a sequence of obs from that domain, where each element in the sequence is either an initial ob or is obtained by a specified transformation from earlier obs in the sequence. (Construction processes are related to what HERMES calls rule systems in [5]. However, HERMES uses terminol- ogy appropriate to inference for all rule systems, which is misleading.)

Page 2: The Logic of Calculation

46 JOHN T. KEARNS

Construction processes are typically “optional” in the sense that any number of different output sequences can be produced by a given process. And a sequence pro- duced to a certain point can be continued in a variety of ways. It is possible for a construction process to yield an infinite output sequence, but these sequences have little interest. If A is the last member of an output sequence for construction pro- cess r, then A is a result of T.

Some construction processes have different stages that are partially ordered so that the results of earlier stages constitute initial elements for later stages. In such a case, a later stage might have an infinite number of initial elements. If a construction process has stages, the portion of the process obtained by omitting some initial stages is an abbreviated construction process.

Let 9 be a constructed domain. Let T be a construction process for which the ele- ments are obs in 9, Let R be an n-adic relation on 9 and let p be an n-adic trans- formation. Then r characterizes R directly with respect to p iff p ( X , , . . ., X, ) is a result of I’ just in case R ( X , , . . ., X,,). If y and y are both n-adic transformations, I’ corn- pletely Characterizes R directly with respect to p and y iff (1) p(X,, . . . , X,) is a result of r just in case R ( X , , . . ., X, ) , and ( 2 ) y(X,, . . ., X,) is a result of r just in case - R ( X , , . . ., X , ) . If r characterizes R directly with respect to y , and the obs X, , . . ., X,, have occurrences in the ob p ( X , , . . ., X,), then this is a literal charac- terization of R. (And similarly for complete characterizations.)

Indirect characterization seems more linguistic than direct characterization. Let 8 be a set of individuals, 9 be a constructed domain, and S be a correspondence from d to 9. Let R be an n-adic relation on & and let p be an n-adic transformation on 9. Then construction process r characterizes R indirectly with respect to S and iff R(x , , . . . , x,)) just in case there are XI, . . ., X,, in 9 such that S(x,, XI), . . ., AS@,, X, ) and p(X,, . . ., X,) is a result of I’. ‘Complete indirect characterization’ is defined as one would expect.

If a single construction process characterizes different relations, then the following definitions are useful. Let 9 be a constructed domain. Let r be a construction process and R an n-adic relation on 9. Let p be a transformation and A be an ob in 9. Then I‘ characterizes R directly with respect to p and A iff R(X,, . . ., X,) just in case g?n+l(A, X , , . . ., X , ) is a result of r. The ob A expresses R directly with respect to r and p in this case.

5 4. Algorithms Algorithms are as fundamental as construction processes for logic and mathematics.

(The algorithms I will consider can be regarded as a special case of abbreviated con- struction processes. However, this does not appear t o shed light on these algorithms, so I will treat them as distinct from construction processes.) An algorithm is defined for the obs in some algorithmic domain. It is a procedure which produces output se- quences of obs in a step by step way. Each step of an algorithmic procedure must be effective so that an ob is added to the output sequence. No step can be such that it may or may not yield an ob.

I will consider only those algorithms that I call simple algorithms. A simple algorithm takes single obs as inputs, and produces an output sequence whose first element ia the input. (An algorithm which takes n-tuples of obs or finite sequences of obs as inputs

Page 3: The Logic of Calculation

THE LOGIC OF CALCUUTION 47

can be recast as a simple algorithm by using a transformation from the inputs of the original algorithm to the inputs of the corresponding simple algorithm.) It is further characteristic of simple algorithms that each step of such an algorithm depends only on the last step of the output sequence so far produced. Given a simple algorithm r and an output sequence for r, any element of that output sequence is an input for which r yields the remainder of the output sequence.

If an algorithm generates an output sequence that terminates for a given input, the last element is the result that the algorithm yields for the input. The last element of a terminated output sequence must have a character that “calls for” termination. We can think of the statement of an algorithm as containing conditional sentences like this: If the last element produced has character 9, then extend the sequence with an ob obtained by procedure y. Then the output sequence terminates if no “operative” conditional sentences specify characters possessed by the last element, or if there is a conditional sentence requiring a halt in certain cases. Considerations from combinatory logic lead me to allow two sorts of simple algorithms for which termination is optional. If the algorithm provides for optionally repeating the last element in an output se- quence, or provides an optional transformation of the last element that would be inter- preted as a change of bound variables, then the algorithm can have an optional ter- mination-such termination is allowed only when no other extension of the output sequence is possible. Any ob which can be the last element of the output sequence for such an algorithm is a result for the given input.

Simple algorithms are divided into two classes. Strict algorithms are those for which each input has a unique output sequence. A nonstrict algorithm is one for which there are alternatives possible in constructing the output sequence for a given input. (A non- strict algorithm is not an algorithm in the sense of [5]. ) I will call the simple algorithms being considered relaxed algorithms. Strict algorithms are a subclass of relaxed algo- rithms, but the adjective ‘relaxed’ is used to emphasize the optional character of some algorithms.

In a given output sequence for a simple algorithm, the earlier obs reduce to the later ones. We can also say that the algorithm reduces one ob to another.

Relaxed algorithms have an obvious consistency requirement. For an input that yields terminated output sequences, the different sequences should terminate in the same result. For those with optional terminations the results must be the same up to a change of bound variables. Adapting this consistency requirement to algorithms that have (some) infinite output sequences leads to a requirement which becomes the Church-Rosser property of combinatory logic and the calculus of A-conversion. One way to state this is as follows. Given a simple algorithm r, the obs A and B are con- nected by riff one of: (1) A is the same ob as B; (2) r reduces A to B; (3) r reduces B to A ; (4) there is an ob C mch that P reduces A to C and also reduces B to C ; ( 5 ) there is an ob C such that r reduces C to A and also reduces C to B. Now r is consistent if any two obs connected by r are connected in virtue of clauses (1) - (4). An equivalent way to state the consistency requirement would define ‘connected by r’ using only clauses (1) - (4), and then require the relation being connected by r to be an equivalence relation. This consistency requirement is satisfied trivially by a strict algorithm. Another “ quasi”-consistency requirement for simple algorithms is that not every two obs be connected by a given algorithm. This imposes a requirement on all relaxed algorithms.

Page 4: The Logic of Calculation

48 JOHN T. REaRNS

Given an algorithmic domain, there is some interest in determining what is a maximal . class of algorithms for the domain. It is most natural to approach this problem with respect either to results for given inputs or output sequences for given inputs. Let 9 be an algorithmic domain. Let f be an n-adic function (partial or total) on 93. Let r be a consistent algorithm for obs in 9. Let p, be a binary transformation and let y be a monadic one-one transformation into 9. An let A be an ob in 9. Then the ob A func- tionally encodes /directly with respect t o r , p,, and y iff rreduces plnfl(A, y(Bl), . . ., y(B,)) to result y(C) just in case f ( B l , . . ., B,J = C . The ob A literally (functionally) encodes f i f y is the identity transformation. An algorithm A with some terminating output sequences is associated with a monadic function on 9, so the above definition also explains what it is for A to functionally encode algorithm A with respect to I‘, q~, and y . Indirect functional encoding involves another parameter. For there are two domains d and 9, and an effective correspondence S from 6 to 9. Obs in 9 can encode func- tions on & indirectly with respect to algorithms, transformations, and S.

Let x be a set of functions on 93. Let R be a correspondence from x to 9. Let r, p,, and y be as above. If A functionally encodes f directly with respect to r, p,, y for every f E x and A E 9 such that f R A , then r is a direct functional master algorithm with respect to x, R, 9, and y .

Church’s Thesis maintains that computable functions in some informal sense coincide with recursive functions as precisely defined. Although recursive functions take numbers as arguments and yield numbers as values, these functions are specified in terms of operations with numerals. If we consider the functions from numerals to numerals to be recursive functions, a natural generalization would construe recursive functions as functions of arbitrary obs in an algorithmic domain. In this more general context, we could adapt the definition of recursive functions in [5] -which uses a set of equations together with substitution and replacement rules to define a recursive function. Every consistent algorithm which has (some) terminating output sequences will compute a recursive function in this generalized sense. The generalized Chusch’s Thesis maintains that the class of monadic recursive functions determines an upper limit for terminat- ing simple algorithms. And that the class of recursive functions is the largest class whose members can be functionally encoded \t<th respect to algorithms. The class of recursive functions is a measure of the strength of a set of algorithms and of a func- tional master algorithm.

Turing machines can be used instead of recursive functions to specify an upper limit of terminating algorithms. This gives the claim that the terminating algorithms for a domain 9 are those which can be given an indirect functional encoding by a Turing machine for some suitable parameters. And that the class of computable functions for a domain 9 consists of those functions that can be hnctionally encoded (indirectly) by a Turing machine. To fully capture the notion of a relaxed algorithm, the Turing machines should be nondeterministic (as explained in [S]).

The generalized Church’s Thesis only gives an upper limit for algorithms with results An analogue of Church’s Thesis is needed which is framed in terms of output sequences rather than results. To do this, it is necessary to define a more comprehensive concept of encoding. And this requires that we specify a sense in which one sequence is contained in another. There are any number of suitable inclusion concepts; the following choice is arbitrary. Let P l , P,, . . . and Ql, Q,, . . . be sequences of obs. Let p, be a monadic

Page 5: The Logic of Calculation

THE LOGIC O F CALCULATION 4 Y

transformation. Let 1, 0 be distinct obs, and let y be a monadic transformation with values in {1,0>. Then the sequence P,, P,, . . . is contained in Ql, Q,, . . . with respect to (p, y ) iff there is a subsequence Qi,, Qi2, . . . of Ql, Q2, . . . such that q(Qij) = Pi and y)(Qk) = 1 if Qk is a member of the subsequence, y(&) = 0 if Qk is not a member of t.he subsequence (the values that y yields for nonmembers of the sequence Q,, Q, , . . . are irrelevant). The pair (q, y ) is a relation of inclusion. The sequence l’,, P,, . . . is literally contained in Ql, Q,, . . . with respect to (q, y) if Pj actually occurs in Qij and for any Q:j obtained from Qij by replacing specified occurrences of Pj by an ob Y ,

A concept of encoding for output sequences is defined only for strict algorithms. Let $2 be an algorithmic domain. Let A , r be strict algorithms for 9. Let 8 be a trans- formation and let (q, y ) be a relation of inclusion. And let A be an ob. Then A algo- rithmically encodes A (directzy) with respect to I‘, 8, and (p, y ) iff the output sequence that A yields for each ob B is contained with respect to (p, y ) in the output sequence that r yields for 8(A, B) , and the output sequence that r yields for 8(A, B) terminates if the output sequence that A yields for B t,erminates. An algorithmic encoding is literal if the output sequences for d are literally contained in those for I‘. If x is a set of strict algorithms and R is a many-one relation from x to a subset of 9, then r is a (direct) master algorithm with respect to x, R, 8, and (q, y ) under the conditions one might expect. Indirect algorithmic encoding is analogous to indirect functional encoding.

An analogue to Church’s Thesis for output sequences can now be stated in terms of (deterministic) Turing machines : Given an algorithmic domain, every strict algorithm for that domain can be (indirectly) algorithmically encoded by a Turing machine.

If r is a master algorithm for some x, R, 8, ( y , y ) (all for some domain B), and x is the set of all strict algorit,hms for 9 that can be encoded by a Turing machine, then r is a strongest master algorit,hm.

T(Q:~) = Y .

8 5. Combinatory logic I think it is clear that combinatory logic is basically a theory of simple algorithms.

Combinatory logic studies the reduction relations of certain algorithms and properties that can be defined in terms of these relations. I n combinatory logic, attention is focussed on a restricted class of algorithmic domains. A combinatory domain is an algorithmic domain in which the single composition structure is binary application, and which there is no null element. If X , Y are obs, the ob ( X Y ) is formed by apply- ing 9 to Y . Application is not associative, so parentheses are required to distinguish ( ( X Y ) 2) from ( X ( Y Z ) ) ; but the parentheses are not obs or occurrences of them. The obs in a combinatory domain are combinations. In writing complex combinations, parentheses which associate to the left will frequently be omitted-i.e., ‘ X I X , X , . . . X,,’ is an abbreviation for ‘ (. . .( (X,X,) X,) . . . XJ.’

A reduction system of combinatory logic is a pair which consists of a combinatory domain and an algorithm for that domain.

Cmnbinators are those combinations that have special importance for the algorithm of a reduction system. The basic combinators are those in terms of which the algorithm is specified -there are no nontrivial reductions unless these combinators are present. Nonbasic combinators contain occurrences of basic combinators and have charac- teristic reductions. Combinators are frequently regarded as functions in an intuitive

4 Zeitschr. f. math. Log*

Page 6: The Logic of Calculation

50 JOHN T. KEARNS

rather than a set-theoretic sense-as the kind of functions that take arguments and yield values. But this is a mistake. Combinators don’t do anything. And with respect to an algorithm, no obs have significance. I will say that combinators serve as cues for the algorithm of a reduction system.

The algorithms for the familiar reduction systems of combinatory logic are nonstrict. In many of these systems, all recursive functions of natural numbers can be indirectly functionally encoded (a proof is found in [3]). It follows (if we accept Church’s Thesis) that all terminating algorithms for their combinatory domains can be directly func- tionally encoded in these same reduction systems. However, these encodings cannot be literal, for two reasons. The first is trivial: there are algorit’hms with finite outputs which yield results that would be further reduced by the reduction algorithm. So no combinator can literally (functionally) encode such an algorithm. The second reason why not all algorithms can be literally and functionally encoded in the familiar reduc- tion systems is that it is not possible to literally encode algorithms which discriminate between arbitrary combinations. Nor is it possible to modify the reduction algorithm by simply introducing discriminating combinators with suitable reduction rules- doing this makes the algorithm inconsistent (this is shown in [6]).1)

The theory of combinatory logic with discriminators introduced in [6] has combinators which discriminate between obs in the domain. This requires a different reduction rela- tion than those of customary reduction systems of combinatory logic. The reduction algorithm of a system of combinatory logic with discriminators is a strict algorithm; the only reductions allowed are the “head reductions ’’ of customary systems.

I n a system of combinatory logic with discriminators not all effective functions can be literally functionally encoded. Some values of functions would be further reduced by the reduction algorithm of combinatory logic with discriminators. However, in [6] it is shown that any Turing machine can be (algorithmically) indirectly encoded in a system of combinatory logic with discriminators.2) It is not difficult to adapt t,he construction in [6] t o establish the following result (which presupposes Church’s Thesis).

6.1. Let pn be an effective function on the domain 9 of a system of combinatory logic with discriminators. Then there is an ob A which encodes pn in such a way that for any ob M , the ob A M X , . . . X, (this ob is formed by application as explained above) reduces to M Y iff pn(X,, . . ., X,) = Y .

If an M is chosen so that N Y does not reduce, this gives almost literal functional encodings of all effective functions (and so of all terminating algorithms).

Apart from the fact that systems of combinatory logic with discriminators have strict algorithms and ordinary systems have nonstrict algorithms, the major difference between the two kinds of systems is that combinatory logic with discriminators makes possible literal encoding and characterization where ordinary combinatory logic does

I) In 143 CURRY has shown that a reduction system of weak reduction can be enlarged by adding a finite set of basic obs which is regarded as an auxiliaryalphabet and also adding a combinator which encodes an algorithm discriminating between characters in the auxiliary alphabet. (The discriminator does not form a redex for reduction unless it has the right kind of arguments.) In such a system terminating algorithms for obs constructed from the auxiliary alphabet can be given a literal, functional encoding.

*) In [6], the model of a Turing machine is not provided with an instruction for halting. The combination ( # # # ) makes a suitable halt instruction.

Page 7: The Logic of Calculation

THE LOGIC OF CALCULATION 51

not. The demonstration in [6] is easily modified to show that the algorithm of a reduc- tion system of combinatory logic with discriminators is a strongest master algorithm. (The construction in [6] needs to be modified because the combinatory domain was required to contain one simple ob that is not available to the Turing machine.) But t.hen it, is clear that the following is true.

5.2. Let 9 be the domain of a system of combinatory logic with discriminators. Let T be a strict algorithm on 9. Then T can be literally algorithmically encoded by an ob A with respect to the reduction algorithm, application, and a relation of inclusion.

Q 6. Characterization by algorithms If T is a (consistent) simple algorithm for which there are distinct obs (Y and #? which

terminate output sequences of I’ and which are such that neither can be (optionally) reduced to the other by I‘, then r is a decision algorithm with respect to a, #?.

Let 9 be an algorithmic domain. Let R be an n-adic relation on 9, Let r be a de- cision algorithm for obs in 9 with respect to a, b. And let p be an n-adic transforma- tion. Then T characterizes R directly with respect to q~ iff r reduces p(X,, . . . , X,,) to a just in case R ( X , , . . ., X,,), and Treduces p(X,, . . . , X,,) to ,!I only if -R(X, , . . . , X,). In this case, (Y is the positive ob and #? is the negative ob for r‘s characterization of R with respect to y . In what follows, I will use ‘ 1 ’ and ‘0’ to designate the positive and negative obs (resp.) for an algorithm’s characterization of a relation.

r completely characterizes R directly with respect to p iff T characterizes R directly with respect to p, and T reduces y(X,, . . ., X r l ) to 0 just in case -R(X,, . . ., X,J. If I‘ characterizes R directly with respect to p and the obs X , , . . ., X , have occur- rences in the ob y(X,, . . ., X,,) , then this is a literal characterization of R . Indirect characterization of a relation R on a set d requires an effective correspondence S from € to the domain of T.

Still another sense of ‘characterized’ is important. Let 9 be an algorithmic domain. Let R be an n-adic relation on 9. Let r be a decision algorithm for obs in 9. Let q be a transformation on 9, and let A be an ob in 9. Then T characterizes R directly with respect to y and A iff I’reduces pn+l(A, X , , . . . , X,) to 1 just in case R(X,, , . ., X J , and I’ reduces prl+l(A, X , , . . . , X,) to 0 only if -R(X,, . . . , X,) . The ob A expresses R directly with respect to T and p in this case.,) Complete direct characterization, literal characterization, and indirect characterization by I’ with respect to rp and A (and possibly S ) are defined in the obvious ways. And so are the analogous concepts of expression.

A relation R on a set d is decidable iff R is completely characterized (directly or indirectly) by an algorithm T with respect to suitable parameters.

Let T be a decision algorithm for an algorithmic domain 9, with respect to 1 and 0 as positive and negative obs. For every decision algorithm A on 9 which characterizes a relation R with respect to a transformation p, and for which a, #? are the positive and negative obs, let there be a transformation y such that T reduces y(X,, . . ., X,,) to 1 iff A reduces p(X,, . . ., X,) to a, and if A reduces y ( X , , . . ., X,) to B, then reduces y(X,, . . ., X,) to 0. Then T is a strongest decision algorithm.

1) In [6], this concept is called representation rather than expression. 4*

Page 8: The Logic of Calculation

52 JOHN T. KEARNS

The reduction algorithm of a system of combinatory logic with discriminators can be shown to be a strongest decision algorithm. This algorithm provides literal charac- terizations of every relation on its domain that is characterized by an algorithm. To prove this result, it is sufficient to establish the following.

6.1. Let 9 be the combinatory domain described in [6] , with the exception that R is a primitive combinator. Let A be a strict algorithm on 9. Then reduction by A can be literally characterized by the reduction algorithm of combinatory logic with dis- criminators. Any distinct nonreducing obs can serve as positive and negative obs for these characterizations.

Proof . By 5.2 there is an ob A, a transformation 8, and a relation of inclusion (9, y) such that A algorithmically encodes A with respect to the reduction algorithm, 8, and (9, y). And this encoding is literal.

By 5.1, there is no loss of generality in assuming 8 to be application. So for every ob M in 9, the reduction sequence P , , P,, . . . that A produces for M is contained with respect to (v, y ) in the reduction sequence Ql, Q,, . . . for A M .

By 5.1 there are combinators Fm, F, such that

FpXQ, > XPj iff v(Q,) = P, (The symbol ‘>’ indicates reduction.) F,XQ,, > X k iff y(Q,) = k .

Then the combinator 2 whose construction is described below is such that Z M N > 1 iff A reduces M to N , and Z M N > 0 iff A reduces M to result L distinct from N . (In describing the construction, ‘g’ is the sign of literal, or syntactic, identity. The combinators used are explained in [6] and [7] . )

Z G,H,1 # A GI 5 WI(v”Z~~G2G3)

G2 C;zI[B”R(WI)] 1

G,

Gs E Z21{Z31[Z41(B2K{B”K[B”(BX) G,]}) [K”(K40)]] [K”(K30)]} [K”(KpO)]

G, E WI[Z31{B3K[B”K( W I ) ] } ( P O ) ]

G5 : WI(Z31{B3K[B”B( W I ) ] } {K[BSW(B3F,G,)]}) G, 2 Z31[K(BK)] [B3K(WI)]

B7yj‘B5A,*Z~SCKZRGsGcGKGzGRG4 (The combinators pi’, A j used in G, and H , are those constructed in 3 7 B of [6] . )

Gc, G K , G z , C R are constructed analogously to G s .

H i E WI(v”Z, ,H, l i3) H , C[B”R(WI)] 1

II, E B7~j‘B5A6*Z50XCKZRHSH~H~HzH,H4 H , E Wl[Z21{B2K[B“K( W I ) ] } (K50)l H s g Z11{Z”[Z31(BK{B‘rK[B’‘(BS) H5]}) [K”(K%)]] [Kr‘(K30)]} [Kr’(K20)]

H5

H c , H K , H Z , H , are constructed analogously to H s . WI(Zal{ BW[B”B( W l ) ] } { KIB1 W ( BaF,Ha)]})

H , Z~l(B’K[BsW(BaF,{C~~,”[K’’(K~l) l ( W 4 } ) ] } [BaK( W I ) ] .

Page 9: The Logic of Calculation

THE LOGIC OF CALCULATION 53

§ 7. The logic of calculation

It is possible to construct a language L for making statements about a system of combinatory logic with discriminators in such a way that expressions of L are elements of the combinatory domain of the system. Then a formal system 3 can be developed for L which literally characterizes reduction and other properties (and relations) of combinations in 9.

The combinatory domain 9 contains the following basic obs:

Markers: 0, 1, # Variable component : x Combinators: S, C, K , 2, R (Binary) Predicates: >, Connectives: N , T> Quantifier component : V.

The predicate ‘ is used for one-step reduction. The predicate ‘E’ is the sign of

In the combinations of 9 there are a single kind of parentheses: (, ). These will

The expressions of the language L are those obs which satisfy the following defini-

Every ob is an individual constant, or a term. There are no other terms of L. The individuul variables of L are SO, .rl, ~ ( l l ) , ~ ( l l l ) , . . . These are abbreviated

A quantifier is a term (Vx,) where x, is an individual variable.

A quantifier is a string of quantifiers. If 2 is a string of quantifiers and (Vx,) is a

Well-formed formulas. (1) If X , Y are terms, then [ X Y ]

(2) If P is a wff, then [-PI is a wff. (3) If P, Q are wffs, then [P 3 &] is a wff. (4) If P is a wff which does not have the form [&TI where Q is a (non-null) string

(5) All wffs are obtained by (1)-(4).

Although every ob is an individual constant of L, many obs are other things as well. This leads to the distinction between operational and nonoperational occurrences of expressions :

(1) If M is a binary predicate and X , Y are terms, t,hen the occurrence of M to which the first occurrence of X in [ X M Y ] is applied is an operational ocourrence of M in [XHY] .

(2) The first occurrence of ‘ - ’ in a wff [-PI is an operational Occurrence of ‘ - ’

literal, or syntactic, identity.

sometimes be written as brackets or braces.

tions.

S o , 5 1 > 5 2 ’ . . ’

quantifier, then ~ ( V S , ) is a string of quantifiers.

are (atomic) well-formed formulas. Y ] , [ X > Y ] , and [ X

of quantifiers, and Z is a string of quantifiers, then [ZP] is a wff.

in [-PI.

Page 10: The Logic of Calculation

54 JOEN T. AEARNS

(3) If P, Q are wffs, then the occurrence of ‘3’ to which the first occurrence of P

(4) If Z is a string of quantifiers, then an occurrence of (Vx,) in the first occurrence

(5 ) The occurrence of a wff P is an operational occurrence of P in P. (6) The occusrence of a wff P is an operational occurrence of P in [-PI. (7) The first occurrence of a wff P is an operational occurrence of P in a w f f [P 3 Q ] .

(8) The occurrence of a wff Q to which [P 2 1 is applied is an operational occurrence

(9) If Z is a string of quantifiers, tthen the occurrence of a wff P is an operativnul

(10) An operational occurrence of V in an operational occurrence of a wff X in a

The occurrence of ‘ > ’ is operational in

is applied is an operational occurrence of ‘3’ in [ P 3 Q].

of Z in a wff [ZP] is an operational occurrence of (“xi) in [ZP].

of Q in a wff [P 3 Q].

occurrence of P in a wff [ZP].

wff Y is an operational occurrence of V in Y .

(1) IS > s. The second occurrence of ‘ > ’ in

(2) [ I8 > 81 > [s > s] is operational, but the first and third occurrences of ‘ > ’ are not operational occur- rences in (2).

There are no free variables in formulas of L. A variable not bound by a quantifier is a constant denoting itself. Instead of speaking of bound and free (occurrences of) variables, I will speak of bound and unquantified variables. The following

(3) Ix , > xo

(4) ( V X , ) .Ix, > X, is a (true) sentence and not an open formula; but (3) is an instance of the following:

(Besides abbreviating parentheses associated to the left, I will employ the abbrevia- tions explained in [l]). And in (5) the initial quantifier binds the occurrences of ‘xo’ in the remaining quantifiers :

(5) (Vx,) .I(VX,) > (VxJ. If P is a wff which contains no operational occurrences of quantifiers, then any

occurrence of an individual variable (x in P is an unquantified occurrence of a in P. Any unquantified occurrence of individual variable (x in a wff P is also an unquantified occurrence of 01 in wffs [-PI, [P 13 Q ] , [Q 2 PI. If P is a wff which does not have the form [ Q T ] where Q is a non-null string of quantifiers, a is an individual variable which has unquantified occurrences in P, and Z is a string of quantifiers which does not contain (Va), the the unquantifiec? occurrences of (x in P are also unquantified occurrences in [ZP].

If P is a wff which contains unquantified occurrences of individual variable 01, P does not have the form [ Q T ] where Q is a non-null string of quantifiers, and Z is a string of quantifiers containing (Vcy), then the unquantified occurrences of cy in P are bound

Page 11: The Logic of Calculation

THE LOGIC OB CUCULATION 55

occurrences of 01 in [ZP]. These occurrences are bound by (the occurrence of) the string Z; alternatively we will say they are bound by the rightmost occurrence of (Vol) in Z. A bound occurrence of an individual variable oc in an operational occurrence of a wff X in a wff Y is a bound occurrence of 01 in Y .

To develop a formal system for L, it is necessary to avoid the rule Universal Gener-

If P, Q, T are wffs, the following are logical axioms of 3. alization, which is not sound. The logical axioms of 8 are below.

AS1. AS2. AS3.

P I . Q D P P x [ Q I T] 3 . p ~ Q 3 . p ~ T

-P 3 [-&I 3 . Q 3 P. In what follows, the indicated strings of quantifiers may be null. The notation

S;P) is from [l]; it denotes the result of replacing all unquantified occurrences (if any) of OL in P by occurrences of /?.

is a term distinct from each y i (1 5 i 5 n) and is such that no unquantified occurrence of cc in [(Vyl). . . (VyJ PI is within the scope of an operational occurrence of (VP) in [(Vyl) . . . (VyJ PI, then the following is a logical axiom of 3.

If [ (Va) (VyJ . . . (Vyn) PI is a wff (n >= 0 ) and

AS4. (Va) (Vy1) . . * (vyn) P 2 S;(Vyl) . . . WyrJ PI *

If P is a logical axiom of 8 which does not have the form [QT] where Q is a non- null string of quantifiers, and Z is a string of quantifiers, then the following is a logical axiom of 5. AS5. [=I.

If Z is a string of quantifiers and P is a wff which does not have the form [&TI where Q is a non-null string of quantifiers, then the initial occurrence of Z is the string of quantifiers of the wff [L'P].

The rules of inference of 5 are the following.

/? From P, [ P 2 Q ] , we can infer Q. y. Let 2 be a string of quantifiers and let Z' be the string of quantifiers of a wff

Z'Q. Let ~ ( V L X ) (VFl) . . . (VP,,) [ P 2 (Z'Q)] be a wff in which P contains no unquantified occurrences of a. Then from Z(Va) (VPJ . . . (V&) [P 3 (Z 'Q)] we can infer W A ) . . . VPJ rp = (Z(\JOc) &)I.

z. Let L' be a string of quantifiers, let Zl be the string of quantifiers of the wff ZIP and let Z2 be the string of the wff Z2Q. Let Z(Vm) (VPl) . . . (VPJ [ZIP 3 (Z2Q)] be a wff in which neither Z1P nor Z2Q contains unquantified occurrences of 01 or else both contain unquantified occurrences of a. Then from Z(Va) (VPl) . . . (VPJ [ZIP (Z2Q)] we can infer Z(VPl) . . . (VPJ [Zl(Va) P 2 (Z2(Va) & ) I .

6. Let Z(V&) (Vyl) . . , (Vyr,) be the string of quantifiers of a wff Z(Va) (Vyl) . . . (Vyn) Q which occurs operationally in a wff P. Let a be distinct from y L (1 i 5 n). Let /? be an individual variable which has no unquantified occurrence in Q and is such that no unquantified occurrence of a in Q is within the scope of an operational occurrence of a quantifier (VP) in Q. Then from P we can infer the formula which results by replac- ing an operational occurrence of ,Z(Va) (Vy1) . . . (Vy,J C! by Z(VP) (tryl) . . . (VyJ S;Q].

Page 12: The Logic of Calculation

56 JOHN T. KEARNS

The combinatory axioms of 8 are below. In writing these axioms, 'Simple(p)' is an abbreviation for ' [p g 11 v . . . v [p g V]' where 0, 1, . . . , V are the atomic terms of L in alphabetic order (this is the order in which they were originally listed). The connectives 'v,' '&,' 'E,' and the existential quantifier are defined in the cus- tomary ways.

01 v

Axioms for >,. (8)

( C )

( K )

( 2 2 )

(Rl ) (Vx,) (VZ2) . R Z O ( X l d >, (XOXlX2)

(R,) (Vx,) (VX,) .Simple(x,) 3 . Rx,zl > (X,X~)

(v) (Unique)

( Z l ) (VX,) .X, z 5,

( _ a )

(-3) (VX,) (VX,) (Vn,) .Xo g x1 3. XI X2 3. 5, XZ

( -4)

( - 5 )

(-8)

( %fmple)

(E,,, L12)

( > 1 )

( > 2 )

(d

(VX,) (VZJ (VZ,) . S ~ , X , ~ , > 1 (Xozz(X1X2))

(Vzo) ( V X J (VZ,) .CX,X,X, > 1 (ZOX2%)

(Vzo) WXI) .Kx,x, > 1 XO

(VXO) (VX, ) (VX,) (VX,) ."X0 E x3] 3 . Zzor,x,x3 >, (x2x3)

(Zl) ( v z O ) (vX1) (vz2) ( V x 3 ) .xO z3 Z l . zXOXlz$3 > 1 (%lx3)

(VX,) (VX,) (VX,) .xo > 1 X1 3 . 5 0 5 2 > 1 ( w 2 )

(VX,) (Vz,) (Vz,) .x, > , z1 3 . zo > , x2 3 . x1 2 xz. Axioms for z.

(Vx,) ( V X , ) .X, z 2, 3 . 21 E z,

(V.0) (VX,) (VX,) ( V X 3 ) .[xo z zz] & [X, E X 3 ] z .x,z1 E (XpZ3)

(VX,) (VX, ) (VX,) .xo E X1 3. 5, > 1 5, 3 . XI > 1 5 2

(VZ,) (VX,) (VZ,) .xo E X, 3. 5 2 > 1 XO 3. X, > 1 2 1

(vz,) (VZ,) (vz,) .Simple(z,) = { - [xo E (33x2)I> .

-

For every two atomic terms o,, 0, in alphabetic order, the following is an axiom.

Axioms for >. [a, z 021 .

(VX,) (VX, ) .xo >, x1 3 . x, > 21

(VX,) ( V X , ) .XO > x1 = [ ( 3 X , ) *Xo > 1 x2l ( V X ~ ) ( V X ~ ) (VZ,) .zO > 21 3 . 21 > 2, 3 . 5 0 > ~2

Induction axioms.

Let i, j, k be 2 0, and let i =+ j + k + i. Let F(xi), F(x,), F(xk) be wffs containing unquantified occurrences of the displayed variables. Let F(xj), F(xk) be obtained from F(xi ) by replacing the unquantified occurrences of xi by xj , xk (resp.), and conversely. Then the following are axioms.

(Ind,) (VZ~) [Simple(zi) 3 F(x~)] 3. (VX,) (v%) [F(%j) 3 . F ( X k ) 3 F(XjXk)] 3 [(Vzi)F(xi)l (Ind,) ( V X ~ ) . (33) [xi >1 xj c% F(~j)l

3. (vx~) ( v x ~ ) [xi > X , & F(x,) 3. X, > 1 xk 3 F(xk) ] 3- ( ' J X j ) [Xi > 3 F(~j)l.

Page 13: The Logic of Calculation

THE LOQIC O F CALCULATION 57

If (vpB1) . . . (V&) is the quantifier string of an induction axiom (VPJ . . . (Vp,l) P, and 2 is a string of quantifiers, then the following is an induction axiom.

The intended interpretation of L (in the domain $3) is obvious. The formal system 8 characterizes > 1 and >, and completely characterizes (with respect to the obvious transformations). In fact, ‘ > 1’, ‘ > ’, and ‘g’ express the corresponding relations. Both characterization and expression is literal.’)

is not completely characterized by 8, this relation is decidable. If additional axioms were added, we could obtain a system 3+ which com- pletely characterizes However, the relation > is undecidable, so no (finitary) extension of 5 will make it possible to completely characterize this relation.

Since the reduction algorithm is a strongest decision algorithm which characterizes the properties of obs in its domain literally (by 6.1), tjhis algorithm characterizes the syntactic features of L and 8 in a literal fashion. But 5 literally characterizes reduc- tion by this algorithm. So in contrast to the customary procedure of using Godel numbers (which can give a direct characterization of syntactic features but not a literal one), 8 provides a literal characterization of these features. However, this does not make the definitions of combinators expressing syntactical features any simpler than the definitions of corresponding recursive functions for the Godel numbering approach. (With 5 the syntactic characterization is conceptually simpler because it is literal, but the mechanics are no simpler.)

Although the relation

Q 8. Conclusion This paper has provided characterizations of ordinary combinatory logic and of

combinatory logic with discriminators which capture the important differences between them. Both kinds of systems can encode functions and algorithms, and both can be used to characterize various properties and relations. But combinatory logic with discriminators makes it possible to do this literally when this isn’t possible with or- dinary combinatory logic. The significance of the difference between what can be accomplished with the two kinds of systems may be primarily aesthetic. But a system of combinatory logic with discriminators is more “self-contained” than an ordinary system, for a system of combinatory logic with discriminators can encode algorithms and functions and characterize properties without employing auxiliary functions or algorithms to transform arbitrary obs into obs that can be handled by the reduction algorithm.

References [I] CHURCH, ALONZO, Introduction to Mathematical Logic I. Princeton University Press, Princeton

[2] CURRY, HASICELL B., and ROBERT FEYS, Combinatory Logic I. North-Holland Publ. Co., Amster-

[3] CURRY, HASHELL B., HINDLEY, ROQER J., and JONATHAN P. SELDIN, Combinatory Logic 11.

1956.

dam 1958.

North-Holland Publ Co , Amsterdam 1972.

1) Although it may seem that in L and 8 there is confusion between use and mention, this is incorrect. An expression may be used operationally on one occasion as a quantifier or a sentence, and used on another occasion as a name of itself - an occurrence of the ob is used to name the ob. But there is no confusion.

Page 14: The Logic of Calculation

58 JOHN T. I E A R N S

[4] CURRY, HASKELL B., Representation of Markov Algorithms by Combinators. The Logical

[5] HERMES, HANS, Enumerability, Decidability, Computability. Springer Verlag New York Inc.,

[6] KEARNS, JOHN T., Combinatory Logic with Discriminators. J. Symb. Log. 34 (1969), 561 -575. [7] KEARNS, JOHN T., The Completeness of Combinatory Logic with Discriminators. Notre Dame J.

[S] MANNA, ZOHAR, Mathematical Theory of Computation. McGraw-Hill Book Comp., New York

Enterprise, Yale University Press, h’ew Haven 1975.

New York 1969.

Formal Log. 14 (1973), 323-330.

1974.

(Eingegangen am 6. August 1975)