A RESULT FOR COMBINATORS, BCK LOGICS AND BCK

A RESULT FOR COMBINATORS, BCK LOGICS A ND BCK
ALGEBRAS
M.W. BUNDER and R.K. MEYER
Introduction
A BCK logic is an implicational logic based on modus ponens and
the following axiom schemes:
Axiom B
Axiom C
Axiom K
s e/ D
l
)
(
W
D
DS1)D g e i
D
s i DOI D,91).
In this paper, as a corollary of a theorem on combinators, we prove
the following, perhaps surprising result:
Theorem 2 I f xl D,-2 and (
6 substitution
a
a r e
instance 9 /
,c/
t h De oA rl e m s
1
1lo
of f
.
=9
B In1other
C words
K substitution instances o f any pair o f theorems o f
dBCK
l
D
ologic
M gcan be
i used
c as minor and major premises in the rule modus
ponens.
ia
,
n
d
2c oef course does not hold in classical o r intuitionistic
io
t Theorem
nh
se
nimplicational(logics. Fo r example we cannot use instances o f the
tfollowing
t
6
,h as minor
e and major premises for modus ponens:
ho
r
e D,91
f
,91
e(i
D(o l 3 4 ) D . sal
r6
s
e2Combinators and Functional Characters
f,
B , C and K are named after the combinators B , C and
os The Axioms
u
rcK because
h they are directly related t o the "principal functional
etcharacters
h
o
f
aa
t
tt h e s
he
ec o m
ob i n
ra t o r
es .
m
o
f
B
C
34
M
.
W. B UN DER and R. K. MEYER
The combinators B , C and K are operators with the following basic
properties:
BXYZ -= X (Y Z)
CXYZ = X Z Y
KXY = X
41)
-(2)
(
Other BCK-combinators (
3
1 X and Y are BCK-combinators so is (XY).
If
)
) a rcombinator
Each
e
has associated classes called functional characters
g (fcs);
i v the
e nmost general of these is called the principal functional
character.
b
y
Functional
characters are built up from certain basic ones and the
:
rule:
If a and fi are fcs so is Fct13.
The term F has the following rule:
Rule F
F
a
r
i
X
, aY ( X Y )
aY can be interpreted as " Y has (or is an element of) fc or type a
Fafi
—is then interpreted as the fc• type (or class), of all functions from
a into
p.
.
The rule then says: I f X has fc Fa43 and Y has fc a then XY has fc f3.
The principal functional characters (pfcs) of B , C and K are given
by :
H F(Fctfl) (F(Fy a) (Fy0))B
F(Fa(Fpy )(F13(Fay ))C
Fa(F13a)K
Note that these are the most general possible under (I), (2), (3) and
Rule F. The one for K, together with Rule F, for example, gives:
aX, f3Y Ha(KXY)
(
I
SXYZ = XZ(YZ)
)
B and
S C can be defined in terms of K and S.
t
Standard
combinators can represent repetitions of terms, BCK-combinators do not.
i.e.,a No term, made up only of the variables X
I nX
one
combinator.
X
a
n
d
i, dX 2
b
o car a c k e t s ,
n
ci ur
i
c
h
rwsd h
a c
t
m
lo o e
a
s
t
r m
e b
t i
h n
a a
COMBINATORS, BCK LOGICS A ND BCK ALGEBRAS
3
5
which is what might be expected for arbitrary fcs a and p by (3).
The pfcs for B, C and K translate directly into Axioms B , C and K
for BCK logic if each Fal3 is replaced by a A l s o an application of
Rule F has the same effect on the fcs as an application o f modus
ponens has in BCK logic. (For details on fcs see [2].)
Thus f o r example t o f in d t h e p f c o f CK , w e ta ke t h e f c
F(Fa(F13a))(F[3(Faa)) of C which is the most general one that will f i
twith the pfc Fa(FPa) of K.
Thus by Rule F H F P ( F o t a ) ( C K ) .
This corresponds to the application of modus ponens to the major
premise
D
D • 2 1 )
D
(
r
i
an instance of Axiom C, and Axiom K as minor premise, resulting in
( 21 D • P l )
The correspondence between the pfcs o f combinators and the
theorems o f intuitionistic implicational logic was first noticed b y
Curry (see §9E o f [2].) Further work on this was done, amongst
others, by Howard [4].
The stratification theorem o f [2] gives sufficient conditions f o r
(standard) combinators t o have a functional character. There are
standard combinators that have no fc and there are others, including
some BCK combinators, that have a fc but that do not satisfy the
conditions of the theorem.
The Four Results I n this paper we show the following:
Theorem 1 A l l BCK-combinators have a pfc.
This, in view of the fact that the B,C and K combinators do not give
rise to duplications, is not all that surprising, but Theorem 2, the
corresponding result in BCK logic, that follows directly from it, is
more so.
A BCK algebra is one based on a set T and an operator *• The set T
has at least one element O. Axioms can be written as:
((b *c) * (a * c)) ( b * a) = 0
36
M
.
W. B UNDE R and R. K. MEYER
((c * a)* b) ( ( c b ) * a) = 0
(a * b )* a = 0
a *0 = a
Substitution of equality is allowed and a* b 0 is usually written as
a < b.
There is an equivalence between a BCK logic and a BCK algebra
(outlined in [11) which gives, by Theorem 2:
Theorem 3 I f in a BCK algebra a • b and c 0 are theorems, then
there is a substitution instance a
once
l o fc a ,
a
ic o r r e s p o n d i
o
fg fourth version o f this theorem involves the " Fo o l's Model" o f
n A
co
combinatory
logic
n
e of [5]. This can be described briefly as follows:
s1 Let
u S3be an arbitrary nonempty set and consider the algebra <S,->,
c1 >,h where V is the closure of S under the binary operation
V
to On g " now
f de
f
i
h
b
a0f1 = t C l ( J B ) ( JD) B el3 AD A C (1)( A D = (B -*C)1
a n e t hn e
d
combinators as elements of .9V.
o pcan
e then
r a "define"
t
t We
b i o Kn
i o =
B = A ) - ) ( C - - ) B ) A , B,C N/ 1
= b C y=
A
,
B
,
C
1
1
1
c :
W
l
=
etc.
(Note that these sets correspond to the axiom schemes and to the
.
fcs.)
T
h The operation 0 behaves like composition; for example
u
Co K = { 1 3
s
and
(
C
o
K
)
.o ( KA = { A - ) A 1 A E V } .
a
, A )
l The latter we -call
1 A in
, Ba E
V
= K however works
slightly
restricted sense.
}
O
K o a = {1 3 -÷A I A E a A B E M
.
(K0a)0P = f A I A A B cf31
so ( K o a ) 0 1 3 = a if 13 -4 .
COMBINATORS, BCK LOGICS A ND BCK ALGEBRAS
3
7
In the presence o f W an "empty combinator" can be defined by
WO/.
so
o
K) o (4
1 o I )
=
If however we consider the subalgebra o f the algebra < Y V , 0 >
0
based only on B, C and K, Theorem I gives us:
r a t h e r
t
h
a
Theorem 4 I n the algebra <I1C, B ,C1,o, L> where L is the closure
n
of 1K,B,C1 under o, Ø L .
K
In this algebra, as it contains no 0,K now has its expected property
(Ko a )0 0 = a.
The Proof of Theorem I
Before we prove Theorem 1 we need two lemmas and the definition
of a BCK-term.
B , C, K and the variables X
i X and Y are BCK terms so is (XY).
If
, Xfirst
The
2 ,lemma, is a BCK
X version of the Subject Reduction/Expansion
n Theorem of [21 (§9C2-4) and [3] (§ 14B). The proof of the lemma
for, BCK terms
isr similar
a
e to that of this theorem.
B C K Lemma
t e I rI f m
X ands Y are
. BCK terms and X = Y can be proved by (I),
(2) and (3) then X and Y have the same pfc.
Note that in obtaining the pfc of a term with variables the fcs for the
variables are chosen so as to make the fc o f the term as general as
possible.
Our second lemma requires the notion of the level of a term.
A term equal (by (I), (2) and (3)) to one containing no combinators
has level O.
If there is a natural number n such that
YX
[i
where Y is a term, X
X
ii
i2
, X
.
1 2
X
.
i n
X
a
r
e
i
v a r i a
n
b l e s
=
n
o
X
t
i
38
M
.
W. B UNDE R and R. K. MEYER
and Y
level
m, then Y has level m + I.
i
, For example, B , B X , , K X , and CX1 X2 are o f level I , B X ,B and
CBB
Y 2 are of level 2 and BX, (EBB) is of level 3.
,
Lemma
Y
2 I f Y is a term containing no variable more than once, there
k a natural number n such that fo r any 13, given an appropriate
is
a
assignment of fcs to the variables in Y X
ri i . not
bles
. X in Y), Y X
1
ien1 ( X
Proof
.it .i . X W e first prove the lemma for a term Y without combinators
(n
ie
, n. 0
. . hwill
, Xadosin this case). We prove this by induction on m the
number
in Y.
fri n c ofavariables
r
e
0
m = aI . Y r is a isingle
and so can be assigned the fc 0.
vm
a variable
sAssume the result for m <p.
om = p I n this case Y Y , Y2, where Y, and Y2 each contain fewer
f
variables than Y (no variable occurs twice). Thus Y, and Y2 can be
l
assigned arbitrary fcs, so we assign Y, Faf3 and Y2 a. Y then has fc p.
e Now we prove the lemma by induction on k the level of Y.
v
ek 0 B y Lemma I, Y has the same p fc as a term Z without
lcombinators, so by above this is B.
s Assume that result for k <
5
k = q N o w there is a natural number n such that
_
YX
m
1 1 Y, has level < q.
,where each
X
a
Thus for each Y, there is a natural number r such that Y, X
thas an .arbitrary fc pt•
si X
l If the=fcs of X
s ,
e s i XX
i
a Note
s
that as no variable appears twice in Y X
Ytwice in X
sappear
, 1 X
1
tY
i ,in
YXn e, e
io
s i ,d YeYnkd o, n e
w
i
l
l
n
s (t o k F
X
e
st 2o h 1F . e
,fo a cc =4. h
)
F
sfa i e t v
a
w
f e
o t
n
o
h
r t
d
t
h2•i
fti h
•
co s
e
•
h
rv a a an r
h
1b
i r a
X
+
2s
ila e e
f c
a
q
(
2
) •
=
F q
=
a t i
• • • a t
COMBINATORS, BCK LOGICS A ND BCK ALGEBRAS
3
9
Now i f Fk y1 y
Thus
k the
1 3pfc of Y X
il Now
i Xs a combinator Y is obviously a term of finite level (the level will
certainly
i nc h iobe sless than or equal to the number of Bs, Cs and Ks in the
combinator),
a e l n s o so b y L e mma 2, Y X , X
X
i1 a 3 s
1
,b Thus
a h ayY shas fc Fa
,p
n
1proved
3 Theorem I and hence Theorems 2, 3 and
L We
f f have
e c therefore
m
4.
.g
We
o
t
,
could
.
.
.
note
a
finally
that
the results o f this paper apply to all
i
v
e
n
mc a
weaker
.t n
sets
(
I
o
f
.
combinators,
weaker logics, weaker algebras and
h o a
t
f
weaker
models.
. r
, For
X example BC/-combinators have the combinator 1 with the
property,
Xi
„ ,
/X = X
a X
instead
of K. (I can be defined as CKK using BCK combinators.)
r i
logic
replaces Axiom K with
e BCI
Y
a
Axiom
i
1
D
S
d
.
s Y
and
s r BC1 algebra replaces the third axiom by:
i ,
a* a — 0
g h
n a
The
M . W . B UNDE R
e s University o f Wollongong
Department
of
Mathematics
d f
N.S.W.,
Australia
a c
p
Research
School o f Social Sciences
R. K . ME Y E R
p
The
Australian
National
University
r
Department
of Philosophy
o
Canberra
ACT,
Australia
p
r
i
REFERENCES
a
t Bunder " B C K and related algebras and their corresponding logics". Journal
[II
of Nonclassical Logic, to appear.
e
[2]
f Curry H.B. and Feys R., Combinatory Logic Vol I Ams terdam, North Holland,
1968.
c
s
a
l
,
.
.
.
,
40
M
.
W. B UNDER and R. K. MEYER
[3] Curry H.B., Hindley J.R. and Se!din J.P., Combinatory Logic Vol 2. Amsterdam,
North Holland, 1972.
[4] Howard W.A., 66The formulae-as-types notion of construction" in to H.B. Curry :
Essays on Combinatory Logic, Lambda Calculus and Formalism, J.P. Seldin
and J.R. Hindley eds. Academic Press London, 1980.
[5] Mey er R.K., The
f o o l ' s
m o d e l
f
o
r
c o m b
i n a t o
r y
l
o
g
i
c
"
,
T
y
p
e
s
c
r
i
p
t
T
o
r
o
n
t
o
,
1
9
7
4
.