on some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and...

218
ON SOME APPLICATIONS OF COMBINATORY LOGIC AND LAMBDA-CONVERSION IN STUDIES OF RECURSION AND OF THE SEMANTICS OF PROGRAMMING LANGUAGES Robert Mullis B.S., Santa Clara University, 1972 A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE in the Department of Mathematics @ ROBERTMULLIS1976 SIMON FRASER UNIVERSITY July 1976 All rights reserved. This thesis may not be reproduced in whole or in part, by photocopy or other means, without permission of the author.

Upload: others

Post on 01-Jun-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

ON SOME APPLICATIONS OF

COMBINATORY LOGIC AND LAMBDA-CONVERSION

IN STUDIES OF RECURSION AND

OF THE SEMANTICS OF PROGRAMMING LANGUAGES

Robert Mullis

B.S., Santa Clara University, 1972

A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF

THE REQUIREMENTS FOR THE DEGREE OF

MASTER OF SCIENCE

in the Department

of

Mathematics

@ ROBERTMULLIS1976

SIMON FRASER UNIVERSITY

July 1976

All rights reserved. This thesis may not be reproduced in whole or in part, by photocopy or other means, without permission of the author.

Page 2: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

APPROVAL

Name : Robert Mullis

Degree: Master o f Sc ience

T i t l e o f T h e s i s : On Some Appl icat ions o f Combinatory Logic and lambda-

Conversion i n S t u d i e s o f Recursion and o f the

Semantics o f Programing Languages

Examining Committee:

Chairman : C . A .C . Graham

-- - R . Harrop

Senior Supervisor

-- - --- - S . Thomason

- --

D . Eaves

R . Russe l l External Examiner

Date Approved: J u l y 8 , 1976 -

(ii) -

Page 3: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

PARTIAL COPYRT CHT LICENSE

I hereby g r a n t t o Simon F r a e e r U n i v e r s i t y t h e r t g h t t o lend

my t h e s i s o r d i s s e r t a t t o n ( t h e t i t l e of which i s shown below) t o u r e r r

of t h e Simon F r a s e r l l n i v e r s i t y L i b r a r y , and t o make p a r t l a 1 or s i n g l e

c o p i e s o n l y f o r . s u c h u s e r s o r i n r e s p o n s e t o a r e q u e s t from t h e l i b r a r y

of any o t h e r u n i v e r s i t y , o r o t h e r e d u c a t i o n a l i n s t i t u t i o n , on i t s 'own

b e h a l f o r f o r one of i t s u s e r s . I f u r t h e r a g r e e t h a t permtusion f o r

m u l t i p l e copying o f t h i s t h e s i s f o r s c h o l a r l y purposes may be g r a n t e d

by me or t h e Dean o f Graduate S t u d i e s . It is unders tood t h a t copy ing

or p u b l i c a t i o n of t h i s t h e s i s f o r f i n a n c i a l g a i n s h a l l n o t be a l lowed

w i t h o u t my writ t e n pe rmiss ion .

T i t l e of T h e s i s / ~ i s s e r t a t i o n :

On some a p p l i c a t i o n s o f comb- lo&

and lambda-conversion i n s t u d i e s o f r e c u r s w n

and o f t h e s e m a n t i c s of p r o g r a m i n n l anguages .

Author :

( s i g n a t u r e )

Rober t M u l l i s

(name )

8 J u l v 1976

Page 4: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

ABSTRACT

Motivation for the research in this thesis came largely from

vaguely documented claims in mathematical and computing literature that

A-conversion and combinatory logic had applications in computing theory,

in particular, in the construction and analysis of programming languages.

A general study of the literature showed that many influential

people involved in computing employed these and related systems in their

work on programming languages and formal languages in general. It was

not, however, evident how deep or relevant these uses were.

The thesis examines, reconciles, and integrates the two dif-

fering approaches, arising from the mathematical and computing science

sides, to recursion and semantics as they relate to formal language

theory. In particular, it investigates the use of combinatory logic,

A-conversion, and similar systems in these fields with the particular

goal of revealing where these applications are of a fundamental nature

and where they are purely superficial.

Among the principal contributors to the field whose works have

had a considerable impact on the thesis are, from the mathematical side:

Curry, Kleene, Church, Scott, Gilmore, ~shm, deBakker, Park, and Rosen,

and from the computing side: Scott, Landin, McCarthy, Gilmore, Wegner,

Strachey, Floyd, and Manna.

The following list of topics and keywords from mathematics and/

or computing give some indication of the general area involved in the

thesis: recursion, fixed point theory, call-by-name, call-by-value,

interpretations, formal systems, semiotics, semantics, syntactics,

(iii)

Page 5: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

grammatics, language specification, formalization, Church-Rosser

property, standardization, deterministic and nondeterministic evalu-

a tions . The thesis opens with two chapters in which the mathematical

concepts to be used are introduced. The next two chapters contain

the main developments of the study. They include in particular an

extensive analysis of the relation between the so-called semantic and

algorithmic approaches to recursive definitions with an emphasis on

various deterministic and nondeterministic evaluation techniques which

have sometimes been associated with these definitions and an applica-

tion of the mathematical theory of semiotics to related concepts in

computing. There is a concluding chapter which contains an application

illustrating many of the earlier results. In addition to the formal

bibliography there is an annotated bibliography which indicates the

relative positions of the references in the context of the thesis as

well as in the more general contexts of mathematics and computing

science.

Page 6: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

for

Babe t t e

Page 7: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

ACKNOWLEDGMENTS

I would like to thank Dr . R. Harrop f o r h i s supervision and

continuous encouragement throughout t h e course of my graduate work.

I would a l s o l i k e t o thank the Mathematics Department of Simon

Fraser Universi ty, Simon Fraser Universi ty and the National Research

Council (Operating Grant, D r . Ronald Harrop A3024) f o r t h e i r f i n a n c i a l

support , and f i n a l l y , Dolly Rosen f o r performing the somewhat formid-

a b l e t a s k of typing the t h e s i s .

Page 8: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

TABLE OF CONTENTS

PAGE

........................................................ Title Page i

.......................................................... Approval ii

Abstract ...................................................... iii Dedication ........................................................ v

................................................... Acknowledgments vi

Table of Contents ................................................. vii ...................................................... INTRODUCTION 1

CHAPTER 1 PRELIMINARIES .......................................... 4

A . Language ................................................. 5 B . Inductive Classes and Constructions ...................... 7 C . Formal Systems ........................................... 10

1 . Morphology and Theory ................................ 10 .................... 2 . Interpretations and Acceptability 14

..................................... 3 . Semiotic Systems 16 D . Formalization ........................................ 17

................................................ E . Epitheory 20

CHAPTER 2 THE SYSTEMS OF COMBINATORY LOGIC .................................... AND OF A.CONVERSION 21

A . The Calculus of A-Conversion ............................. 21 ....................................... 1 . The Calculuses 22 ....................................... 2 . Extensionality 27 ........................................ B . Combinatory Logic 29

1 . The System Hg ....................................... 30 2 . The Bracket Abstract ................................. 33 3 . Extensionality ..................................... 37

C . Properties of the Systems ................................ 47 ....................................... D . church's I-systems 52

CHAPTER 3 RECURSIVE DEFINITIONS. LEAST FIXED POINTS. AND THE CHURCH-ROSSER PROPERTY ......................... 55

A . Functions and Functionals ................................ 55 1 . The Undefined Element and Extensions ................. 56 2 . Monotonicity of Functions ............................ 58 3 . Monotonicity and Continuity of Functionals ........... 62 .............................. 4 . The Fixed Point Theorem 65

(vii)

Page 9: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

PAGE

B . Recursive Definitions ..................................... 65 ............................... . 1 Definitional Extensions 66 . ..... . a The Classical Approach of Kleene. curry etc 66 b . Call-by-Name. Call-by-Value. and the .............................. Conditional Function 71 c . Two Approaches: DeBakker and Manna ............... 75 d . Definitional Reductions to Ultimate Definientia ... 77

2 . Evaluation Procedures: The Algorithmic Approach to Recursive Definitions .............................. 79 ................................ . a Substitution Rules 84 b . McCarthy's Label Operator ......................... 93 ..................... . c Landin's Fixed Point Operator 98

3 . Recursively Defined Functions as ..................... Least Fixed Points of Functionah 103 ... . a Least Fixed Points and the Semantic Explanation 104

b . The Strength of the Algorithmic Approach .......... 109 c . Manna. deBakker. and Kleene's First

Recursion Theorem ................................. 114 d . Examples .......................................... 116

4 . Some Techniques for Proving ............................. Properties about Programs 120 .......................... . a Approximation Inductions 121 ............................ . b Fixed Point Inductions 123 ......... . C Relational Systems and the Church-Rosser Property 125 1 . The Church-Rosser Property and

Evaluation Procedures ................................. 125 ................ . 2 Testing for the Church-Rosser Property 128

............ CHAPTER 4 SYNTAX. SEMANTICS. AND PROGRAMMING LANGUAGES 137

......................................... . A Computing Science 137 .............................. . B The Structure of Expressions 140 1 . Syntaxes and Grammars ................................. 140 .......................... . 2 Structure and Representation 143 ................................. . 3 Grammatical Structure 145 ....................................... . 4 Analytic syntax 153 ............................... . C The Meanings of Expressions 154 .................................... . 1 Sernantical Systems 155 ....................................... 2 . Interpretations 157 3 . Semantical Levels. Intended Meaning. and

................................... Levels of Semantics 158 ............................ . 4 Acceptability of semantics 166

............... CHAPTER 5 ILLUSTRATION: TOWARDS A FORMAL SEMANTICS 171

A . The Language L and the Semantics Ss ...................... 173 .......................................... . B The Semantics S2 177

.......................................... C . The Semantics S3 185

........................................... . D Extensions of L 189

(viii)

Page 10: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

PAGE

CONCLUSION ........................................................ 194 ANNOTATED BIBLIOGRAPHY .......................................... 195 BIBLIOGRAPHY ...................................................... 200

Page 11: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Int roduc t ion

The original motivation for this thesis came from references,

in both mathematical and computing science literature, to a connection

between combinatory logic and the A-calculuses on the one hand and

topics in computing science on the other. For the most part they were

of a very general nature and were often insubstantially documented.

In the case of the more explicit references, the connection cited was

often of a rather superficial nature.

Preliminary investigations showed that there were in fact a

number of ways in which various notions of combinatory logic and the

A-calculus were used in the work being done in the field of programming

language definition and specification. These uses appeared to range

from simply providing abbreviations for operators to more substantial

applications of the systems of combinatory logic and A-conversion in

the formalization of various computing notions which had until that

point remained informal. Chapter 5 grew out of these investigations.

Unfortunately, in most of the literature the actual relevance

of the association was not clear. The question was further clouded

by rather vague distinctions often being made between syntax and

semantics. This led to a treatment of those notions from a semiotical

point of view, which makes up most of chapter 4.

One application that seemed to be important was the study of

recursive (or self-referential) definitions. The principal evidence

that this application was more than superficial was the common occur-

rence of references to various properties usually associated with the

Page 12: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

systems, most importantly, the Church-Rosser property and the stand-

ardization property, which had not been present in other applications.

This led to an investigation of the notion of a recursive definition

and, since on the computing side the main use of these systems in this

respect was in the evaluation of functions defined recursively, evalu-

ation techniques for such functions. These considerations, along with

others concerning the Church-Rosser property and various proof techni-

ques associated with these definitions, make up chapter 3.

Chapter 1 provides the mathematical terminology used through-

out the thesis. It seemed natural to follow Curry since his work on

combinatory logic and A-conversion is authoritative.

Chapter 2 is an introduction to combinatory logic and the

A-calculases that goes somewhat beyond the type of material covered

in an introduction usually found in computing literature. It is

intended to be self-contained and to provide a person unfamiliar with

the topic a good working knowledge of its basics as well as a flavor

of the deeper results.

For the most part the notation of a mathematical nature is

standard; all nonstandard uses are explicitly indicated. Citations to

papers and books are made by theauthor's name and a two or three letter

abbreviation of the title in square brackets. (See the bibliography).

Two exceptions to the rule are Combinatory Lopic vol. I by Curry and

Feys, which is cited by 'Curry [CLglI' and Combinatory Logic vol. I1

by Curry, Hindley and Seldin, which is cited by 'Curry [CLg]II1 .

Page 13: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

The t h e s i s is d iv ided i n t o chap te r s , s e c t i o n s , subsec t ions ,

and a r t i c l e s . References t o s e c t i o n s of a chap te r made from wi th in

t h a t chapter omit t h e chapter number. A s i m i l a r r u l e ho lds f o r sub-

s e c t i o n s and a r t i c l e s , so t h e a r t i c l e 3B2a is r e f e r r e d t o by SB2a

wi th in every p a r t of chapter 3 except s e c t i o n B; by S2a i n every p a r t

of s e c t i o n B except subsec t ion 82, and by •˜a w i t h i n subsec t ion B2.

Page 14: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Chapter 1 P r e l i m i n a r i e s

I n t h i s chap te r much of t h e terminology of a mathematical o r

l o g i c a l n a t u r e used i n t h i s t h e s i s i s in t roduced . Where p o s s i b l e i t

is s t anda rd , bu t t h e r e are many s u b j e c t s d e a l t w i th f o r which no

s tandard seems a s y e t t o e x i s t . S ince t h e t h e s i s u n i t e s , i n t o a

s i n g l e p r e s e n t a t i o n , many t o p i c s drawn from a r e a s s t u d i e d by people of

widely d i f f e r i n g backgrounds, an e f f o r t ha s been made i n c a s e s where

no s t anda rd e x i s t s n o t on ly t o choose s u i t a b l e terminology but a l s o t o

r e l a t e t h a t chosen t o , a t l e a s t , t h e te rminologies used by t h e more

i n f l u e n t i a l r e sea rche r s .

To a l a r g e e x t e n t t h e terminology of Curry has been adopted

f o r considerat ionsconcerning mathematical l o g i c . For matters concern-

i ng computing, which a r i s e i n c h a p t e r s 3 - 5, no such s i n g l e source

has been chosen, a l though much is a t t r i b u t a b l e t o one o r more of t h e

fol lowing: Landin [MEE],[CBA] p a r t s I and 11, McCarthy [TMS],[BMT],

[RFS], S c o t t [OMT],[LFD], Sco t t and Strachey [TMS], Strachey [TFS],

and Wegner [PLI]. The terminology f o r t o p i c s which f a l l between l o g i c

and computing, f o r example r e c u r s i v e d e f i n i t i o n s , is taken l a r g e l y

from Curry [CLglI, [FML], Kleene [IMM], S c o t t [LTD], [LFD], deBakker

[RP],[LFP], Manna [MTC], Manna and McCarthy [PPP], and McCarthy [RFs].

The t h e s i s does no t presuppose knowledge of t h e above papers and books.

The p re sen t c h a p t e r , being concerned only w i th t h e mathemati-

c a l s i d e of t h e terminology, i s b a s i c a l l y a survey of t h e v a r i o u s p a r t s

of Curry [CLglI, [CLglII , [FMLI, [PLF], [LMF] and [CFS] t h a t i n t roduce

and d i s c u s s n o t i o n s which a r e u s e f u l i n t h i s t h e s i s . It is intended

t o be se l f -conta ined and no knowledge of Curry ' s work i s presumed. I n

some c a s e s m a t e r i a l is presen ted i n s l i g h t l y more d e t a i l t han is

Page 15: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

5. a b s o l u t e l y necessary f o r t h e purposes of t h e t h e s i s , s o t h a t t hose

p rev ious ly un fami l i a r wi th t h e t o p i c s w i l l be a b l e t o understand them

more e a s i l y . Anyone f a m i l i a r w i th t h e c i t e d works of Curry could

omit a l l but Sec t ions C and D of t h i s chap te r . Those s e c t i o n s d e a l

wi th n o t i o n s of p a r t i c u l a r importance t o t h e t h e s i s .

Occas iona l ly d e f i n i t i o n s and n o t i o n s taken from Curry have

been modif ied o r gene ra l i zed , but t h i s is done on ly where t h e change

does n o t a f f e c t t h e e s s e n t i a l f l a v o r of t h e no t ion . Where a major

d e v i a t i o n from t h e o r i g i n a l concepts would be necessary an a l t o g e t h e r

new no t ion is introduced and no at tempt is made t o modify e x i s t i n g

ones. I n both c a s e s c a r e i s taken t o ensure t h a t confusion is no t

pos s ib l e .

A. Language

A s i n most l o g i c a l concerns, t h e concept of language p l a y s

an important p a r t i n t h i s t h e s i s . Not on ly a r e s e v e r a l languages

e x p l i c i t l y in t roduced , but t h e i r d i s cus s ion r e q u i r e s y e t another ,

namely t h e one i n which t h e t h e s i s is w r i t t e n . It is o f t e n u s e f u l t o

I have a name f o r i t . Following Curry [LMF] , t h e language being used

is c a l l e d t h e U language. Here it is b a s i c a l l y Engl ish wi th a d d i t i o n a l

symbols, terms, c o n s t r u c t s , d e f i n i t i o n s , e t c . , u s u a l l y of a t e c h n i c a l

n a t u r e , ad jo ined and d e l e t e d a s needed. While i t is a s p e c i f i c language

a t any p o i n t , i t i s c o n s t a n t l y being a l t e r e d t o s u i t t h e purposes of

t h e moment.

I n t h e s tudy of a p a r t i c u l a r language i t is sometimes u s e f u l

o r necessary t o r e f e r t o an express ion of t h e language a s an

I A more d e t a i l e d d i s cus s ion appears i n [FML].

Page 16: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

6 . express ion , t h a t is a s an o b j e c t i n i t s e l f , w i th no cons ide ra t ion of

t h e e n t i t y t h a t i t denotes . In such c a s e s t h e express ion is r e f e r r e d

t o by enc los ing i t i n s i n g l e quo ta t ion marks. So, an express ion which

c o n s i s t s of another express ion enclosed by s i n g l e quotes is taken t o

be t h e name ( i n t h e U language) of t h e enclosed express ion . For

example, Vancouver i s a c i t y , while ' ~ a n c o u v e r ' is an express ion of

n i n e l e t t e r s . These quo ta t ion marks a r e omit ted where context a l lows.

Often t h e word 'metalanguage ' is used i n t h e sense t h a t

U language is used here . The preference of U language over meta-

language i s motivated by s i t u a t i o n s such a s t h e fol lowing. Suppose a

language L1 is being d iscussed i n a language L2. In t h i s case L1

is c a l l e d t h e o b j e c t language and L2 t h e metalanguage. In terms of

t h e U language, i t i s o f t e n t h e c a s e t h a t L1 is p a r t of t h e o r i g i n a l

U language, i n t h a t it could be used; however, i n t h e cu r r en t d i s -

cuss ion it i s being t a lked about , no t t a lked i n , so i t is i n t h a t

sense removed (perhaps only temporar i ly) from t h e o r i g i n a l U language

t o o b t a i n t h e ( c u r r e n t ) U language which i s e x a c t l y t h e metalanguage

2 ( i . e . , t h a t p a r t of t h e o r i g i n a l U language t h a t remains ).

Sometimes, however, i t may be i n t e r e s t i n g o r necessary t o

d i s c u s s two languages L1 and L2 which a r e r e l a t e d as o b j e c t

language and metalanguage. Now n e i t h e r L1 nor L2 i s being used t o

c a r r y on t h e d i scuss ion , r a t h e r they a r e both be ing ta lked about. The

language being used i s gene ra l ly c a l l e d t h e metametalanguage and i t

is t h a t p o r t i o n of t h e o r i g i n a l U language t h a t remains a f t e r both

L1 and L2 a r e removed. This metametalanguage is t h e ( cu r r en t )

20f course i t is p o s s i b l e t h a t o t h e r a d d i t i o n s and d e l e t i o n s have been made f o r t h e purposes of t h e d i scuss ion .

Page 17: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

U language. So i n any such h i e ra rchy , t h e U language is t h e h ighes t

l e v e l and thus should not be confused wi th t h e metalanguage.

The s tudy of symbolism is c a l l e d semio t i c s and has a s a

b a s i c concept t h a t of a language. In a very gene ra l sense , a pa r t i cu -

l a r language is given i n two p a r t s . The f i r s t is c a l l e d an a lphabe t ,

taken t o be a c o l l e c t i o n of d i s t i n g u i s h a b l e symbols each of which can

be produced i n unl imi ted q u a n t i t i e s . The second is a set of r u l e s

which s p e c i f y how c e r t a i n symbols of t h e a lphabet a r e combined t o form

express ions .

Semiot ics is d iv ided i n t o t h r e e gene ra l s e c t i o n s : s y n t a c t i c s ,

semantics , and pragmatics. Syn tac t i c s is t h e s tudy of t h e express ions

of a language a s s t r i n g s of symbols; semantics is t h e s tudy of t h e

meanings of t h e express ions ; and pragmatics is t h e s tudy of t h e r e l a t i o n

between t h e language and i ts use r s . Pragmatics might involve considera-

t i o n s of phys io log ica l , psychologica l , and o t h e r na tu re s . Apart from

t h i s mention of pragmatics , t h e t h e s i s w i l l be concerned only wi th

s y n t a c t i c s and semantics . Fur ther subd iv i s ions of semantics a r e o f t e n

of i n t e r e s t and a few w i l l be d iscussed i n $ 1 ~ 3 and • ˜ ~ B , c when t h e t o p i c

of s emio t i c s i s re turned t o fo l lowing t h e i n t r o d u c t i o n of some addi t ion-

a l concepts .

B. Induct ive Classes and Cons t ruc t ions

It is o f t e n necessary t o cons ider c o l l e c t i o n s of e n t i t i e s

3 t h a t a r e formed by i n t u i t i v e o r contens ive means i n t h e U language.

3 The word ' contens ive ' was coined by Curry, i n [APM], a s a t r ans - l a t i o n f o r t he German ' i n h a l t l i c h ' - an a d j e c t i v e app l i ed t o something which i s known o r understood p r i o r t o , o r e x t r i n s i c a l l y o f , t h e a c t i v i t y c u r r e n t l y t ak ing p lace . It s t ands i n c o n t r a s t t o ' i n t u i t i v e ' i n s o f a r t h a t i t does not suggest t h a t t h e knowledge was obta ined by i n t u i t i o n .

Page 18: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

In o rde r t o d i s t i n g u i s h t h i s type of c o l l e c t i o n from t h e more formal

n o t i o n s of 'set ' and ' c l a s s ' of set theory , such c o l l e c t i o n s are c a l l e d

conceptua l c l a s s e s .

A ques t ion is s a i d t o be d e f i n i t e i f i t can be answered yes

o r no and t h e r e i s an e f f e c t i v e process4 f o r o b t a i n i n g t h e answer.

A ques t ion i s s e m i d e f i n i t e i f t h e r e is an e f f e c t i v e p roces s f o r ob ta in-

i n g t h e answer ' ye s ' whenever t h e answer is yes .

A conceptua l c l a s s is s a i d t o be d e f i n i t e i f t h e ques t i on of

membership i n t h e c l a s s i s d e f i n i t e .

An i nduc t ive c l a s s i s a conceptua l c l a s s formed from t h e

elements of a d e f i n i t e conceptua l c l a s s c a l l e d t h e b a s i s by means of

a f i n i t e number of a p p l i c a t i o n s of e lements of ano the r d e f i n i t e con-

c e p t u a l c l a s s , t h e l a t t e r e lements being c a l l e d modes of combination.

Each mode of combination, M y is a s s o c i a t e d w i t h a n a t u r a l number, n ,

c a l l e d i t s degree , such t h a t , g iven any sequence of l e n g t h n of

e lements6 of t h e i nduc t ive c l a s s , t h e a p p l i c a t i o n of M t o t h e

sequence produces an element of t h e i n d u c t i v e c l a s s . It is understood

t h a t t h e elements of t h e i nduc t ive c l a s s a r e e x a c t l y t h e elements s o

formed. Fu r the r i t is r equ i r ed t h a t t h e ques t i on of whether an element

is produced by t h e a p p l i c a t i o n of a p a r t i c u l a r mode of combination, M ,

t o a given sequence of e lements is d e f i n i t e .

4 This i s an i n t u i t i v e no t ion which can be s p e c i f i e d t o a g r e a t degree of p r e c i s i o n , i f one a c c e p t s Church's t h e s i s .

Sometimes t h e b a s i s is taken t o c o n s i s t of a c o l l e c t i o n of d e f i n i t e conceptua l c l a s s e s each of which c o n s t i t u t e s a type.

perhaps r equ i r ed t o be of c e r t a i n t ypes , see above foo tnote .

Page 19: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

9. The process of forming an element, X, of an induc t ive c l a s s ,

I , which s t a r t s wi th c e r t a i n i n i t i a l e lements and a t each l a t e r s t e p

a p p l i e s a mode of combination t o elements a l r e a d y formed is c a l l e d a

cons t ruc t ion of X. A cons t ruc t ion can be o b j e c t i f i e d by a s s o c i a t i n g

a t r e e diagram wi th i t . A t r e e diagram c o n s i s t s of a c o l l e c t i o n of

nodes joined toge the r i n such a way t h a t t h e r e is a unique t o p node,

every o t h e r node has a unique node joined above i t , and t h e r e a r e no

o t h e r j unc t ions . Each node has a unique n a t u r a l number a s s o c i a t e d

wi th it c a l l e d i t s degree; t h i s is t h e number of nodes connected

( d i r e c t l y ) t o i t from below. A node t h a t has degree zero is c a l l e d

a bottom node. Given a cons t ruc t ion , C , of X , t h e t r e e diagram

a s s o c i a t e d wi th C is t h a t t r e e diagram f o r which t h e r e is a one-to-

one correspondence between i ts nodes and t h e occurrences of t h e compo-

nen t s of X such t h a t X corresponds t o t h e top node, and i f Y , i n

t h e cons t ruc t ion , i s t h e r e s u l t of apply ing t h e mode of combination

M , of o rde r n, t o t h e sequence Y1, Y 2 , ..., Y (of I ) , then t h e node n

corresponding t o Y has order n and t h e nodes below i t from l e f t

t o r i g h t correspond t o Y1,Y2, ..., Y i n t h a t order . A l abe l ed n 7

t r e e diagram, r e l a t i v e t o a cons t ruc t ion , i s one whose nodes a r e

l abe l ed wi th t h e names of t h e elements of t h e cons t ruc t ion t o which

they correspond.

General ly an element of an induc t ive c l a s s may we l l have

more than one cons t ruc t ion . I f t h e cons t ruc t ion of every element i n

t h e c l a s s is unique, t h e c l a s s is s a i d t o be monotectonic, o therwise

it is p o l y t e c t o n i c .

Page 20: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

C . Formal Systems

1. Morphology and Theory

The d i s c u s s i o n s of c h a p t e r s 2 - 5 a r e g e n e r a l l y concerned

wi th d i s c i p l i n e s i n which one makes s t a t emen t s about a c l a s s of o b j e c t s

of one s o r t o r ano the r . Many t i m e s i t is d e s i r a b l e t o formula te t h i s

type of d i s c i p l i n e i n such a manner t h a t i t s t r u e s t a t emen t s can be

der ived a s a r e s u l t of c o n s i d e r a t i o n s which a r e independent of any

p a r t i c u l a r contens ive understanding of t h e o b j e c t s . The r e s u l t of such

a formula t ion can g e n e r a l l y be considered t o be what is c a l l e d he re a

formal system. Bas i ca l l y a formal system is a set of theorems, which

a r e genera ted by p r e c i s e r u l e s from e x p l i c i t assumptions and which

concern a c e r t a i n c l a s s of unspec i f i ed o b j e c t s .

A formal system i s given i n t h r e e main s t a g e s which taken

c o l l e c t i v e l y a r e c a l l e d i ts p r i m i t i v e frame. The f i r s t s p e c i f i e s a

conceptua l c l a s s of o b j e c t s , c a l l e d t h e formal o b j e c t s , w i th which

t h e system w i l l be concerned; t h e second s p e c i f i e s a conceptua l c l a s s

of s t a t emen t s concerning t h e formal o b j e c t s c a l l e d t h e elementary

s t a t emen t s ; t h e t h i r d s p e c i f i e s a conceptua l c l a s s of e lementary

s t a t emen t s which a r e t r u e , c a l l e d t h e elementary theorems.

It i s necessary t o be more s p e c i f i c concerning t h e s e t h r e e

c l a s s e s . The formal o b j e c t s of a system a r e considered t o a r i s e i n

one of two main ways. I f t h e formal o b j e c t s form a monotectonic

i nduc t ive c l a s s , they a r e c a l l e d - obs. The elements of t h e b a s i s a r e

c a l l e d t h e atoms and t h e modes of combination a r e c a l l e d t h e

ope ra t i ons of t h e system. S ince t h e c l a s s is monotectonic, obs

cons t ruc ted by d i f f e r e n t p rocesses a r e n e c e s s a r i l y d i s t i n c t a s obs,

Page 21: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

11. f u r t h e r each ob can be o b j e c t i f i e d by a t r e e d iagram. A sys tem w i t h

t h i s t y p e o f fo rmal o b j e c t s i s c a l l e d a n ob sys tem. -

The second way i n which fo rmal o b j e c t s a r e sometimes i n t r o -

duced is a s t h e e x p r e s s i o n s of some language under c o n s i d e r a t i o n ,

c a l l e d t h e o b j e c t language o r 0 language. The a l p h a b e t of t h e 0

l anguage is made up o f 0 l e t t e r s and t h e f o r m a l o b j e c t s o f t h e

sys tem a r e c a l l e d 0 e x p r e s s i o n s . The fo rmal o b j e c t s can be v i s u a l i z e d

a s forming a n i n d u c t i v e c l a s s i n a number of ways, t h e two most common

a r i s i n g by c o n s i d e r i n g t h e s i n g l e mode o f combina t ion t o be a f f i x a t i o n

( y i e l d i n g a monotec ton ic c l a s s ) o r c o n c a t e n a t i o n ( y i e l d i n g a poly-

t e c t o n i c c l a s s ) . A sys tem i n which t h e fo rmal o b j e c t s a r e i n t r o d u c e d

i n t h i s manner i s c a l l e d a s y n t a c t i c a l sys tem. Sometimes a s y n t a c t i c

sys tem is fo rmula ted w i t h s p e c i f i c a t i o n s t h a t g i v e a c e r t a i n s u b c l a s s

of t h e 0 e x p r e s s i o n s which a r e c a l l e d t h e well-formed e x p r e s s i o n s .

The well-formed e x p r e s s i o n s a r e g e n e r a l l y t h o s e e x p r e s s i o n s t h a t

a c t u a l l y p l a y a r o l e i n t h e sys tem. A s y n t a c t i c sys tem i n which t h e

o n l y e x p r e s s i o n s of r e a l i n t e r e s t a r e t h e well-formed e x p r e s s i o n s is

s a i d t o be e u t a c t i c .

The d i s t i n c t i o n between t h e s e two t y p e s of sys tems i s n o t

a b s o l u t e l y c l e a r c u t . C e r t a i n l y any s y n t a c t i c a l sys tem becomes a n

ob sys tem when t h e fo rmal o b j e c t s a r e c o n s i d e r e d t o be a n i n d u c t i v e

c l a s s w i t h t h e s i n g l e o p e r a t i o n of a f f i x a t i o n . F u r t h e r , a n ob sys tem

can b e conceived a s a s y n t a c t i c a l sys tem by v i s u a l i z i n g t h e obs as t h e

well-formed e x p r e s s i o n s of a s u i t a b l e e u t a c t i c sys tem. For most of

t h e p u r p o s e s of t h i s t h e s i s , t h e sys tems c o n s i d e r e d a r e fo rmula ted

a s ob sys tems s i n c e even when t h e fo rmal o b j e c t s a r e c o n s i d e r e d t o be

Page 22: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

12. e x p r e s s i o n s of a n o b j e c t language, t h e fo rmal o b j e c t s of i n t e r e s t form

a monotec ton ic c l a s s . F u r t h e r t h e word 'ob ' w i l l be used i n t e r c h a n g e -

a b l y w i t h ' fo rmal o b j e c t ' where t h e r e is no need t o be p r e c i s e .

The c l a s s of e lementa ry s t a t e m e n t s i s i n t r o d u c e d by s p e c i -

f y i n g a d e f i n i t e c l a s s of p r e d i c a t e s , c a l l e d b a s i c p r e d i c a t e s , e a c h

of which h a s a n a t u r a l number a s s o c i a t e d w i t h i t c a l l e d i ts degree .

The e lementa ry s t a t e m e n t s of a system a r e j u s t t h o s e s t a t e m e n t s t h a t

a s s e r t t h a t a b a s i c p r e d i c a t e h o l d s f o r a n o r d e r e d sequence of fo rmal

o b j e c t s of l e n g t h e q u a l t o t h e d e g r e e of t h e p r e d i c a t e .

Any c o n s i d e r a t i o n s of t h e fo rmal o b j e c t s o r t h e e lementa ry

s t a t e m e n t s of a system a r e s a i d t o concern t h e morphology of t h e system.

The e lementa ry theorems form a n i n d u c t i v e c l a s s of e lementa ry

s t a t e m e n t s and a r e s a i d t o be t r u e f o r t h e sys tem. I t i s unders tood

t h a t t h e t r u t h o r f a l s i t y of an e lementa ry s t a t e m e n t is n o t known with-

o u t r e f e r e n c e t o t h i s p a r t of t h e sys tem. A sys tem i s c o n s i s t e n t i f

t h e r e a r e e lementa ry s t a t e m e n t s t h a t a r e n o t e lementa ry theorems and

i t is d e c i d a b l e i f t h e e lementa ry theorems form a d e f i n i t e c l a s s . The

e lements of t h e b a s i s a r e c a l l e d axioms and t h e modes of combinat ion

a r e c a l l e d r u l e s of i n f e r e n c e , each of which p roduces , when g iven a

s u i t a b l e number of s u i t a b l e e lementa ry theorems, c a l l e d p remises , an

e lementa ry theorem. A proof of a n e lementa ry theorem i s s imply t h e

e x h i b i t i o n of a c o n s t r u c t i o n of t h e theorem. S i n c e t h e e lementa ry

theorems form an i n d u c t i v e c l a s s , t h e concept of proof i s d e f i n i t e ,

t h a t is, t h e q u e s t i o n of whether something is a proof is d e f i n i t e .

Page 23: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

1 . Considerat i ons involv ing t h e elementary theorems, a s opposes

t o t h e morphology of t h e system, a r e s a i d t o concern t h e theory proper

of t h e system.

When a system is being given, t h e U nouns, U ve rbs , and

U sen tences denot ing t h e formal o b j e c t s , t h e b a s i c p r e d i c a t e s , and t h e

elementary s t a t emen t s , r e s p e c t i v e l y , a r e c a l l e d A nouns, A ve rbs , and

A sen tences . Taken c o l l e c t i v e l y t h e s e form t h e A language, which i s

a p a r t of t h e U language, i n t h a t i t is being used t o t a l k about t h e

system r a t h e r than i t s e l f being t a l k e d about .

Any p a r t i c u l a r assignment of A nouns t o formal o b j e c t s and

A v e r b s t o b a s i c p r e d i c a t e s , such t h a t each formal o b j e c t has ass igned

t o i t a unique A noun, and each b a s i c p r e d i c a t e has ass igned t o i t a

unique A verb i s c a l l e d a p r e s e n t a t i o n of t h e system. A r ep re sen t a -

t i o n of a system i s an assignment of a unique con tens ive o b j e c t t o

each formal ob j ec t such t h a t each contens ive o b j e c t r e t a i n s t h e

s t r u c t u r e of t h e formal ob j ec t t h a t i t i s ass igned t o . Concerning a

r e p r e s e n t a t i o n , t h e only i n t e r e s t i n t h e contens ive o b j e c t s l i es i n

t h e i r s t r u c t u r e and not i n any o t h e r knowledge about t h e s e o b j e c t s .

The A nouns of a p r e s e n t a t i o n themselves c o n s t i t u t e a r e p r e s e n t a t i o n

c a l l e d t h e autonymous r e p r e s e n t a t i o n . Other examples of represen ta -

t i o n s a r e t h e Eukasiewicz r e p r e s e n t a t i o n of a system which i s based

upon t h e Aukasiewicz pa ren thes i s - f r ee n o t a t i o n and t h e Gadel repre-

s e n t a t i o n of a system i n which d i s t i n c t n a t u r a l numbers a r e a s soc i a t ed

wi th t h e atoms and c e r t a i n numerical f u n c t i o n s a r e a s s o c i a t e d wi th t h e

opera t i ons .

Page 24: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

2. Interpretations and Acceptability

An interpretation of a system is a many-one correspondence

between certain elementary statements of the system and certain

contensive7 statements related to some subject matter. A contensive

statement which corresponds to an elementary statement is called the

8 interpretant of the elementary statement. An interpretation is -- full

if every elementary statement has an interpretant, otherwise it is

partial. ~n interpretation is valid if all the interpretants of

elementary theorems are true, and relatively complete if every

elementary statement whose interpretant is true is an elementary

theorem. 9

Note that it is not excluded that one formal system can have

an interpretat ion in another formal system, in fact for most purposes

of the thesis this is the case. When this is the case the statements

of the latter system are considered to be contensive with respect to

the original system. An interpretation then is simply a correspondence

between the statements of two disciplines, each of which has its own

criterion of truth.

Usually the interpretations of formal systems are of a

stronger form than above. There is a mapping from formal

objects to a class of contensive objects called a valuation. The

contensive object (if any) associated with a formal object is called

I Statements which are significant without reference to the system under consideration.

8 When there is no need to be precise, it is sometimes called the interpretat ion.

In these cases the system is also said to be valid or relatively complete for the interpretation.

Page 25: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

15. t he va lue of t h e formal o b j e c t . A d i r e c t i n t e r p r e t a t i o n is then

def ined by a s s o c i a t i n g wi th each of t h e b a s i c p r e d i c a t e s a contens ive

p r e d i c a t e over t h e va lues and f i n a l l y a s s o c i a t i n g wi th t h e elementary

s t a t emen t s , a s t h e i r i n t e r p r e t a n t s , c l o s u r e s of t h e contens ive pred i -

c a t e s . For example; Let M be a basic p r e d i c a t e of o rde r n and

- a s s o c i a t e w i t h M t h e contens ive p r e d i c a t e M , a l s o of o rde r n .

- - Let t h e formal o b j e c t s a l , ... ,a have t h e va lues a l ~ . - . Y a n Y i f

n

they e x i s t . Then i(<,. . . ,e ) ( i f i t e x i s t s ) is t h e i n t e r p r e t a n t n

of M(al, ..., a ). n

A formal system i s u s u a l l y s t u d i e d because i t i s u s e f u l i n

making p r e d i c t i o n s concerning some contens ive d i s c i p l i n e . The u t i l i t y

of a formal system i n t h i s r e s p e c t is c a l l e d i t s a c c e p t a b i l i t y

( r e l a t i v e t o t h e contens ive d i s c i p l i n e ) . The ques t i on of accept-

a b i l i t y g e n e r a l l y involves much of t h e a v a i l a b l e information concerning

both t h e formal system and t h e r e l a t i o n between t h e formal system and

t h e contens ive d i s c i p l i n e i n which i t has an i n t e r p r e t a t i o n . Of course

t h e v a l i d i t y of t h e i n t e r p r e t a t i o n is of s p e c i a l importance, y e t t h e

f a c t t h a t t h i s v a l i d i t y has no t been demonstrated (or perhaps could

not be demonstrated) does no t n e c e s s a r i l y make t h e system unacceptable

f o r a p a r t i c u l a r use. Other cons ide ra t i ons may involve t h e s i m p l i c i t y ,

n a t u r a l n e s s , a e s t h e t i c s , e t c . of t h e system; one of two systems wi th

equa l ly v a l i d and r e l a t i v e l y complete i n t e r p r e t a t i o n s might be chosen

over t h e o t h e r f o r reasons of t h i s na tu re . A c c e p t a b i l i t y i s thus

r e l a t i v e t o t h e knowledge a v a i l a b l e a t a given time; what i s accep tab l e

a t one t ime may not be accep tab l e l a t e r ; what is accep tab l e t o one

person may not be accep tab l e t o another .

Page 26: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

3. Semiotic Systems

Following S ~ A , a semiotic system is taken to be a system whose

subject matter is the expressions of some language. In this type of

system understandable statements concerning a particular language are

made, so such a system is necessarily interpreted. This discussion is

concerned with two branches of semiotics, namely, syntactics, the study

of the expressions of a language considered simply as strings of

symbols, and semantics, the study of the expressions from the viewpoint

of meaning.

A semiotic system, whose elementary statements can be con-

sidered to refer only to the structure of the expressions of a language

L as symbol strings, is said to be syntactical with respect to L.

When the elementary statements refer to the meanings or designata of

the L expressions, the system is said to be semantical with respect

to L. A semiotic system can be both syntactical and semantical; this

is the case whenever the statements of the system, while referring to

the structure of the expressions of some language, also give inforrna-

tion concerning the meanings of the expressions of some, not necessarily

the same, language. A system must be semantical with respect to a given

language if it is going to be useful in studying that language. One

attempts to make a system syntacticallo in order that the concept of

proof be definite, so it is not really necessary that the language with

respect to which it is syntactical is the language that is being studied,

although this is often the case.

lo One might alternately attempt to formulate the system as an ob system.

Page 27: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

1 7 . Semantics is itself sometimes broken down into three sections

11 called grammatics, aletheutics, and onomatics . A grammatical state-

ment is a statement that a certain expression of the language being

considered is a phrase12. An aletheuthical statement is a statement

that a certain sentence of the language is true (as formulated in the

language being studied). An onomatical statement is one that is con-

cerned with the designata of the expressions of the language. Systems

of these three types are formed in the obvious way. Most of the

systems that arise in chapters 4 and 5, dealing with the specification

of the syntax and semantics of languages are grammatical or onomatical.

A syntactical semiotic system is a syntactical system in the

sense of $1~1. Further a syntactical system is syntactical in the

sense of this section if in the case that the 0 language is not

specified, one could be provided.

D. Formalization

The preceding discussions of formal systems tend to suggest

that systems come first and interpretations are provided later or at

least that in the study of informal discipline one arrives at, in a

single step, a fully developed formal system. Actually formal systems

usually grow out of the study of a discipline in a more gradual way,

sometimes involving a number of fundamental steps. The process is

called formalization.

'l~hese correspond to Carnap's rules of formation, rules of truth, and rules of designation, respectively.

12~hat is, a basic unit of one sort or another with regard to the rules for forming the sentences of a language.

Page 28: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

18. Formal iza t ion is an a c t i v i t y i n which one s t r i v e s t o r e p l a c e

t h e i n t u i t i v e deduct ions made i:, an i n f ~ r m a l d i s c i p l i n e by t h e objec-

t i v e d e r i v a t i o n of s t a t emen t s i n a formal system. A t t h e l e a s t , t h e

f o r m a l i z a t i o n of a d i s c i p l i n e s e r v e s t o c o n s o l i d a t e t h e r e s u l t s a l r e a d y

made i n t h e s tudy of t h e d i s c i p l i n e i n a way t h a t avo ids i n t u i t i v e

reasoning . Thus t h e end r e s u l t of fo rma l i za t i on might show c e r t a i n

r e l a t i o n s h i p s more c l e a r l y and t h e i r r e l e v a n c e of c e r t a i n cons idera-

t i o n s among o t h e r t h ings . Consol ida t ion i s o f t e n , however, no t t h e

s o l e purpose of fo rma l i za t i on , which is i n many ways s i m i l a r t o t h e

process of theory formation f o r t h e n a t u r a l s c i ences . A formal

system o f t e n sugges t s ways i n which t h e in formal d i s c i p l i n e might be

developed and i n t h i s sense is c r e a t i v e .

For example i n t h e s tudy of t h e p roces s of s u b s t i t u t i o n i n

P r i n c i p i a Mathematica from t h e viewpoint of combinatory l o g i c , t h e

use of t h e contens ive e q u i v a l e n t s of t h e combinators (which d id

not appear on t h e s u r f a c e i n P r i n c i p i a Mathematica) helped i n t h e

understanding of s u b s t i t u t i o n , which is then seen a s a more complex

n o t i o n than i t o r i g i n a l l y had been thought t o be.

A s mentioned, fo rma l i za t i on g e n e r a l l y proceeds i n a number

of s t e p s . One f i r s t fo rmula tes t h e informal d i s c i p l i n e a s a deduc-

t i v e t heo ry i n such a way t h a t an examination of t h e language i n

which t h e theory is expressed i s s u f f i c i e n t t o determine t h e c o r r e c t -

ne s s of t h e i n f e r e n c e s made t h e r e . Suppose t h e language i n which t h e

theory is expressed i s L.

Page 29: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

19. The formation of a formal system can then proceed i n e i t h e r

of two main d i r e c t i o n s . One is t o form a new theory , c a l l e d t h e

metatheory, whose sub jec t mat te r i s t h e language of ( t h e deduct ive

theory formulated from) t h e contens ive d i s c i p l i n e . I n t h i s way t h e

exp re s s ions of L, now c a l l e d o b j e c t exp re s s ions o r 0 expres s ions ,

become o b j e c t s about which s t a t emen t s a r e made i n t h e metatheory. The

metatheory i t s e l f i s expressed i n t h e U language, which is now

b a s i c a l l y t h e language t h a t r e s u l t s by t h e removal of L from, and

t h e ad junc t ion of c e r t a i n t e c h n i c a l terminology f o r r e f e r r i n g t o L

t o , t h e o r i g i n a l U language. That p a r t of t h e U language used t o make

s t a t emen t s about L i s c a l l e d t h e metalanguage.

A metatheory is a formal system when i t i s formulated i n such

a way t h a t t h e exp re s s ions of t h e o b j e c t language a r e t r e a t e d s t r i c t l y

a s symbol s t r i n g s without regard t o any meaning o r i g i n a l l y a s s o c i a t e d

wi th them. Fu r the r i t is r equ i r ed t h a t t h e t rea tment of t h e o b j e c t

language i s independent of t h e p a r t i c u l a r shapes chosen f o r t h e l e t t e r s

of t h e a lphabe t of t h e o b j e c t language. Such a metatheory is a

s y n t a c t i c a l system i n t h e sense of $1~1.

Thus i n t h i s p rocess L is removed from t h e U language, an

A language, c a l l e d t h e metalanguage, is formed f o r r e f e r r i n g t o expres-

s i o n s of L, and t r u t h , a s understood i n L, is reformulated i n t h i s

metalanguage. This process of fo rma l i za t i on i s c a l l e d metasemiosis.

In t h e second d i r e c t i o n , r a t h e r than i s o l a t i n g L, one formu-

l a t e s L and a b s t r a c t s from i t s meaning i n such a way t h a t i t becomes t h e

A language of a Formal stern'^ So i n t h i s approach one cont inues t o

1 3 S p e c i f i c a l l y , an a b s t r a c t formal system i n t h a t no commitment t o a p a r t i c u l a r r e p r e s e n t a t i o n of t h e formal o b j e c t s i s made.

Page 30: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

20. use L at least in ways analogous to its original use. However since

its meaning has been abstracted from, one must remember that certain

associations may no longer hold in L as an A language. This

process of formalization is called abstraction.

The system that results from abstraction may be either an

ob system or a syntactical system, though ob systems usually result

when the process follows naturally along the grammatical lines of L.

When a syntactical system results, the process of formalization by

abstraction is essentially the same as by metasemiosis.

E. Epitheory

The term 'epitheory' will be used to denote considerations

made in the U language about a systern,that go beyond the elementary

stage (that is, beyond particular applications of the deductive rules

of the system). The term was introduced by Curry to replace the

term 'metatheory' the use of which, due to the technical applications

discussed in the previous section, had been criticized for suggesting

a commitment to formalization by metasemiosis, while the term

'epitheory' is noncommittal on that point.

Examples of considerations made in this thesis which come

under the heading of 'epitheory' include the introduction of various

types of extensions (e.g. atomic, axiomatic, etc.) of systems and

generalizations with respect to various parts of systems, discussions

concerning the properties of systems as a whole (such as consistency,

definiteness, etc.), as well as, relationships between systems (such

as validity, acceptability, etc.).

Page 31: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

21. Chapter 2 The Systems of Combinatory Logic and of A-Conversion

I n t h i s chapter two s o r t s of ob systems, which a r e c e n t r a l

t o t h e s u b j e c t of t h e t h e s i s , a r e i n t roduced , namely, t hose of combi-

na to ry l o g i c and those of A-conversion. The p r i m i t i v e frames of t h e s e

systems a r e d i scussed i n t h e f i r s t two s e c t i o n s a long wi th ques t i ons

of terminology and no ta t i on . The t h i r d s e c t i o n d e a l s mainly wi th

v a r i o u s e p i t h e o r e t i c r e s u l t s f o r t h e s e systems. A s w i l l be seen , due

t o t h e i r s i m i l a r i t i e s , many of t h e s e r e s u l t s hold f o r both types of

systems.

A. The Calcu lus of A-Conversion

The o r i g i n a l mot iva t ion t h a t l e d t o t h e development of t h e

c a l c u l u s of A-conversion was t h e d e s i r e t o form a system i n which

( i ) t h e s u b s t i t u t i o n r u l e , a s s o c i a t e d wi th t h e formal v a r i a b l e s , could

be formulated i n a way not s i g n i f i c a n t l y d i f f e r e n t , i n concept o r

complexi ty , from t h e o t h e r r u l e s of t h e system, and ( i i ) t h e apparen t

dependence of c e r t a i n s t a t emen t s upon p a r t i c u l a r v a r i a b l e s could be

shown t o be i l l u s o r y . Church achieved t h e s e ends by in t roduc ing an

ope ra t i on c a l l e d f u n c t i o n a l a b s t r a c t i o n and forming a system ( a c t u a l l y

a number of systems) around t h i s ope ra t i on which could be shown t o

s a t i s f y t h e above cond i t i ons . The o r i g i n a l systems formed by Church

a r e s y n t a c t i c a l systems i n t h e sense of chap te r 1, and Church [CLC] i s

t h e a u t h o r i t a t i v e t r e a t i s e on t h e s e systems. The c a l c u l u s e s a r e i n t r o -

duced i n t h i s chap te r a s ob systems r a t h e r than s y n t a c t i c a l systems

fol lowing Curry [CLglI. There i s no e s s e n t i a l d i f f e r e n c e between t h e

two approaches s i n c e t h e on ly obs of Church's systems which e n t e r i n t o

t h e theory a r e t h e well-formed obs , which a r e e x a c t l y t h e obs of Curry ' s

systems.

Page 32: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

1. The Calculuses

A calculus of A-conversion14 is given here as an ob system.

There is an infinite sequence of variables, el,e2, ..., which are the atoms of the system. There are two binary operations: application,

denoted by juxtaposition and parentheses; and functional abstraction

(or simply abstraction), which applied to a variable x and an ob M

is denoted by (XX.M). The obs of the system are given by the inductive

definition:

(a) Every atom is an ob.

(b) If M and N are obs, then (MN) is an ob.

(c) If x is a variable and M is an ob, then

(Xx.M) is an ob.

Parentheses may be omitted by the convention of association to the left;

so ( ((AB)C) (DE)) could be written ABC(DE) without confusion. For

abstraction, the parentheses may only be removed when an ob formed by

abstraction is not part of an application; so (Ax.M) standing alone

can be written Xx.M , but (Xx.M)N will not be denoted by Xx.MN.

A number of auxiliary definitions that are used in the

remainder of this section are now given. In all of these definitions

X , Y , M , and N are obs while x,y, and z are variables. The state-

ment 'X is a component of Y' is understood to be true just when one

of the following clauses is true:

14 This is sometimes referred to as a A-calculus.

Page 33: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

(i) Y E X 15

(ii) Y : MN, and X is a component of M or X

is a component of N.

(iii) Y Z Xy.M and X is a component of M.

The statement 'x occurs free in Y' (or simply 'x is free in Y I),

where x is a component of Y, is understood to be true just when one

of the following clauses is true:

(i) Y 3 x

(ii) Y 5 MN, and x occurs free in M or x occurs

free in N.

(iii) Y Z Xy.M, and x $ y and x occurs free in M.

The statement 'x occurs bound in Y' (or simply 'x is bound in Y'),

where x is a component of Y, is understood to be true just when

one of the following clauses is true:

(i) Y f MN , and x occurs bound in M or x

occurs bound in N.

(ii) Y f hy.M , and x E y or x occurs bound in M.

(Note that no variable occurs bound in any atom.)

A variable can occur both bound and free in an ob, as is

shown by the example (x(Ax.x)). The first occurrence of x is free,

while the third is bound. Note also that the second occurrence of x

is neither free nor bound since it is not a component of the ob.

l5 The symbol ' 3 ' denotes identity between obs.

Page 34: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

The express ion '[N/x]Mt is understood t o s t and f o r t h e

ob M' t h a t r e s u l t s from r e p l a c i n g every f r e e occur rence of x i n

M by N. The ob M' is induc t ive ly de f ined a s fol lows:

( i ) I f M E x , then M ' 5 N

( i i ) I f M E y and x $ y , then M ' E y

( i i i ) I f M E XY , then M ' E ( [N/x]x) ([N/x]Y )

( i v ) I f M 5 Xx.X , then M' 5 M

(v) I f M E Xy.X and x $ y , then M' Z Xz. [N/x] [z/y]X

where z is def ined a s fol lows:

( i ) I f x does no t occur f r e e i n X o r i f y does no t

occur f r e e i n N , then z 5 y.

( i i ) I f x occurs f r e e i n X and y occu r s f r e e i n N ,

then z i s t h e f i r s t v a r i a b l e i n t h e l i s t , e l , e2 , ..., which does no t occur f r e e i n e i t h e r X o r N.

Remark 1. I n t h e o r i g i n a l formula t ion of t h e c a l c u l u s e s , Church used

a v a r i a n t of t h e t h i r d c l a u s e i n t h e d e f i n i t i o n of t h e obs of t h e system,

which r equ i r ed x t o occur f r e e i n M. Th i s r e s t r i c t e d c l a u s e is:

( c ' ) I f x i s a v a r i a b l e and M is an ob i n which x

occu r s f r e e then (Xx.M) i s an ob.

The main e f f e c t of t h i s r e s t r i c t e d c l a u s e i s t o exclude obs which would

be i n t e r p r e t e d a s f u n c t i o n s of f i c t i t i o u s arguments ( t h a t is , func t ions

which a r e cons t an t f o r a l l v a l u e s ) . I t t u r n s o u t , a s shown i n

Church [CLC], t h a t i t i s p o s s i b l e t o d e f i n e obs which a r e i n t e r -

p re ted a s f u n c t i o n s cons t an t over c e r t a i n r e s t r i c t e d ranges , and

t h a t t h i s a b i l i t y i s s u f f i c i e n t f o r t h e normal purposes . A

Page 35: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

system i n which t h e obs a r e given by c l a u s e s ( a ) , ( b ) , and ( c ) i s c a l l e d

a K-system (o r a c a l c u l u s of XK-conversion) and one i n which ( c ) is

rep laced by ( c ' ) i s c a l l e d an I-system (o r a c a l c u l u s of XI-conversion).

Except f o r occas iona l mention, t h e systems cons idered i n t h e t h e s i s a r e

The systems have one b inary b a s i c p r e d i c a t e , R , which g ives

rise t o elementary s t a t emen t s of t h e form

X R Y

where X and Y a r e obs .

A l l of t h e systems considered he re have t h e fo l lowing axioms

and r u l e s i n common, where X , Y , and Z a r e a r b i t r a r y obs and x

and y a r e a r b i t r a r y v a r i a b l e s :

(1) X R X

(2) I f X R Y and Y R Z , then X R Z

(3) I f X R Y , then ZX R ZY

(4 ) I f X R Y , then XZ R Y Z

(5) I f X R Y , then Xx.X R Xx.Y

(6) I f y does no t occur f r e e i n X , then

Xy. [y/x]X R Xx.X

The axiom (1) and r u l e (2) make R a quasi-order ing. The

r u l e s (3) and (4) guarantee t h a t R i s monotone wi th r e spec t t o

a p p l i c a t i o n and (5) guaran tees t h a t it is monotone wi th r e s p e c t t o

a b s t r a c t i o n . The purpose of axiom (6) i s t o ensure t h a t t h e p a r t i c u l a r

v a r i a b l e s t h a t appear bound i n an ob have no s p e c i a l importance t h e r e i n ,

t h a t i s , i n a n a t u r a l 1 6 i n t e r p r e t a t i o n t h e i n t e r p r e t a n t of an ob

One i n which two obs , X and Y , r e l a t e d by X R Y , have t h e same i n t e r p r e t a n t .

Page 36: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

remains t h e same i f t h e bound v a r i a b l e s a r e s y s t e m a t i c a l l y changed i n

t h e ob.

Two o t h e r axioms and o n e o t h e r r u l e may b e l o n g i n v a r i o u s

combina t ions t o c e r t a i n of t h e sys tems . These a r e :

( 7 ) (Xx.X)Y R [Y/X]X

(8) I f x d o e s n o t o c c u r f r e e i n X , t h e n Ax. (Xx) R X

(9 ) I f X R Y , t h e n Y R X

When a sys tem c o n t a i n s e x a c t l y t h e axioms and r u l e s ( 1 ) - ( 6 ) ,

R i s c a l l e d a - r e d u c i b i l i t y ; i f ( 7 ) i s added, R i s c a l l e d

B - r e d u c i b i l i t y ; and i f (8 ) i s a l s o added, R i s c a l l e d B n - r e d u c i b i l i t y .

When (9) i s p r e s e n t , t h e s e become a-, B-, and B n - c o n v e r t i b i l i t y ,

r e s p e c t i v e l y . For a l l forms of r e d u c i b i l i t y R i s symbolized by 2

and f o r a l l forms of c o n v e r t i b i l i t y R i s symbol ized by = 17. Note

t h a t s i n c e b o t h (1 ) and (6 ) a r e symmetric a - c o n v e r t i b i l i t y is t h e same

a s a - r e d u c i b i l i t y .

The sys tems a r e named s i m i l a r l y , f o r example, when t h e r e l a -

t i o n p r e s e n t i s @ n - c o n v e r t i b i l i t y , t h e sys tem i s c a l l e d t h e c a l c u l u s o f

Bq-conversion ( o r s imply t h e ABn-calculus), and i f t h e r e l a t i o n i s 6-

r e d u c i b i l i t y , i t i s c a l l e d t h e c a l c u l u s of B-reduct ion ( o r t h e Xf5-

c a l c u l u s 1 8 ) . I f t h e morphology o f t h e o b s i s o f i n t e r e s t t h e l e t t e r

I o r K is added, s o t h e XB-calculus can e i t h e r b e t h e XBK-calculus

XBI-calculus ( s e e Remark 1 above) .

l7 I f t h e r e i s a need t o b e e x p l i c i t abou t which form i s b e i n g used , a p p r o p r i a t e s u b s c r i p t s w i l l be added.

l8 when t h e r e is no need t o d i s t i n g u i s h between r e d u c i b i l i t y and c o n v e r t i b i l i t y .

Page 37: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

An occurrence of the left side of (7) or (8) is called a

redex (respectively, a B-redex or an n-redex), while the right side is

called a contractum. The replacement of a redex by its respective

contractum is called a ((3- or q-) contraction. (More precisely a

contraction is a deduction of X R Y by (1) - ( 5 ) , and exactly one

application of either (7) or (8) as the case may be.) A series of

contractions is called a reduction and a series of contractions and

reverse contractions is called a conversion. An ob is said to be in

(B- or ( 3 ~ - ) normal form if it contains no occurrence of a ((3-, or

either (3- or n-) redex.

2. Extensionality

A form of the principle of extensionality, which is of

interest here, is expressed by the following rule:

(10) If x is not free in either X or Y , then

if Xx = Yx , then X = Y . This rule follows from (5) and (8) thus:

if Xx = Yx , then Xx.Xx = Ax.Yx by ( 5 ) ,

then X = Y by (8).

In the presence of (7), (10) can be shown to be equivalent to the con-

junction of (5) and (8). The rule (5) follows from (7) and (10) thus:

if X = Y , then (Xx.X)x = (Ax.Y)x by (71,

then Ax.X = Ax.Y

The rule (8) follows from (7) and (10) thus:

(Ax. (Xx))x = Xx

Ax. (Xx) = X

l9 If each contraction is a @contraction, it is a 0-reduction, and similarly for 0 .

Page 38: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Conversion f o r t h e Bq-calculus is then an e x t e n s i o n a l equiva-

l ence ( i n t h e sense of r u l e (10 ) ) . The @-ca lcu lus is on t h e o t h e r hand

too weak t o suppor t (10) i n i t s f u l l g e n e r a l i t y , i t is however s t r o n g

enough t o suppor t a r e s t r i c t e d form of (lO),which w i l l be introduced

a f t e r t h e fo l lowing d e f i n i t i o n .

The o rde r of an ob X is t h e l e a s t i n t e g e r m such t h a t

every 6-reduct ion of

xx1.. .x y m I"",

can be ob t a ined by a p p l i c a t i o n s of ( 4 ) t o a &reduc t ion of

xx1. . . xm . 2 0

If an ob X has a p o s i t i v e o rde r i t is s a i d t o be f u n c t i o n a l . The r e s t r i c t e d form of (10) is expressed as fo l lows:

(10 ' ) I f x is n o t f r e e i n X o r Y , and

X and Y a r e f u n c t i o n a l , then

i f Xx = Yx then X = Y . This r u l e can be e s t a b l i s h e d f o r t h e f3-calculus by in t roduc ing t h e

fol lowing r e s t r i c t e d form of ( 8 ) ,

( 8 ' ) I f x i s no t f r e e i n X and X i s func t iona1 , then

Xx.Xx = X ,

which can be shown t o hold i n t h e B-calculus by a sequence of theorems

on o r d e r ( s ee Curry [CLg j I S ~ F ) , and showing t h a t i n t h e presence of

(7 ) , ( 5 ) and (8 ' ) a r e equ iva l en t t o ( l o ' ) , a s above.

20 Note t h a t this i S a t e c h n i c a l t e r m and t h a t t h e u sua l i n t e r p r e t a - t i o n of t h e systems cons ide r s every o b , f u n c t i o n a l o r n o t , a func t ion .

Page 39: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

B. Combinatory Logic

The purpose of this section is to provide an introduction to

cornbinatory logic. The original intent in the creation of combinatory

logic, as with A-conversion, was the development of a formal system

which did not rely upon formal variables in the usual (at that time)

manner. The hope was that in this way two types of peculiarity

normally found in systems employing formal variables could be avoided.

These were the presence of a substitution rule associated with the

variables, complex in both concept and structure, and the existence of

certain instances of variables that had no contensive counterparts in

natural interpretations.

As for the second case, certain statements containing vari-

ables often turn out to be statements concerning functions. relations,

properties, or some other thing, which are in no fundamental way

dependent upon the variables they appear at first sight to be concerned

with. The standard example of this considers the commutative law of

addit ion:

a + b = b + a for all a,b . This law has really nothing to do with the particular variables a and

b but rather with addition. Suppose one uses a prefixed operator

notation so a + b is written +ab and further there is an operator,

C, with the following property

CXYZ = XZY . The commutative law of addition can then be expressed in the form

C+ = + there now being no reference to any variables. The same result in the

Page 40: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

A-calculus is expressed by t h e s ta tement

Xa. (Ab. a+b) = Aa. (Xb. b+a)

a long wi th cons ide ra t i ons involv ing t h e r u l e ( 6 ) .

Combinatory l o g i c , u s ing j u s t t h e concept of a p p l i c a t i o n

toge the r w i th a smal l number of o p e r a t o r s , such a s C above, produces

r e s u l t s similar t o t hose ob ta ined by means of f u n c t i o n a l a b s t r a c t i o n i n

t h e A-calculus, without depending upon formal v a r i a b l e s even t o t h e

e x t e n t t h a t they occur t h e r e . Va r i ab l e s a r e used i n t h e s tudy of t he

systems of combinatory l o g i c , however t h e i r use i s gene ra l l y a t an

e p i t h e o r e t i c l e v e l .

1. The System Ho

The b a s i c formal system of t h i s s e c t i o n i s c a l l e d t h e combi-

na to ry system Ho , o r simply . The atoms a r e t h e atomic combinators Ho S , K and I . Atomic ex t ens ions of Ho may be made by ad jo in ing

inde te rmina tes ; t h e ex tens ion so formed by adding xl, ..., x i s n

c a l l e d Ho(xl, ..., x ) . The only ope ra t i on is a p p l i c a t i o n denoted by n

j u x t a p o s i t i o n and paren theses . The obs of t h e system Ho o r any

system Ho(xl, ..., x ) a r e given by t h e i nduc t ive d e f i n i t i o n : n

(a ) Every atom is an ob.

(b) If X and Y a r e obs , then (XY) i s an ob.

An ob c o n s i s t i n g only of t h e atomic combinations S , K and I is c a l l e d

a combinator. Paren theses may be omi t ted by t h e convention of a s soc i a -

t i o n t o t h e l e f t .

Page 41: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

31.

The statement "X occurs in Y", for obs X,Y is understood

to be true just when one of the following clauses is true:

(i) Y E X

(ii) Y 5 W and X occurs in U or X occurs in V . There is one binary basic predicate, L , called weak

reduction, which gives rise to statements of the form

where X and Y are obs.

The axioms and rules of are the following, where X, Y and Z are arbitrary obs:

(1) X z X

(2) If X 2 Y and Y 2 Z , then X Z Z

(3) If X 2 Y , then ZX Z ZY

(4) If X 2 Y , then XZ 2 YZ

(I) IX 2 X

(K) KXY 2 X

( S ) SXYZ XZ(YZ)

With the axiom (1) and rule (2) 2 is a quasi-ordering. The rules (3)

and (4) guarantee that 2 is monotone with respect to application.

The axioms (I), (K), and ( S ) are called the reduction rules for the

atomic combinators. The left-himd side of a reduction rule (or an

2 2 occurrence in another ob of such an ob) is called a redex . The

2 1 or any system Ho (xl , . . . , x ) . n

2 2 When it is necessary to be precise, it is called an I-, K-, or S- redex.

Page 42: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

right-hand side is called a contractum. The replacement of a redex by

its corresponding contractum is called a contraction, a sequence of

contractions is called a reduction. An ob containing no occurrence

The symmetric closure of 2 , obtained by adjoining the

additional rule

(5) If X 2 Y , then Y 2 X,

is called weak equality and is symbolized by =O . When there is no

danger of confusion with other forms of equality introduced later, the

subscript will be omitted.

There are a number of combinators that are useful enough to

warrant special abbreviations. These combinators together with their

"reduction rules" are:

B z S(KS)K BXYZ 2 X(YZ)

C = S (BBS) (KK) CXYZ XZY

B'XYZ 2 Y(XZ)

I'XY 2 YX

W 5 SSK' WXY ' XYY

The infixed binary operator 'of is defined as follows

XoY Z BXY . Using this operator the result of n successive applications of X to Y,

X(X(... (XY)..*))

can be written $OX0 * * * O X J Y

V n

assuming association to the left. This is further abbreviated X"Y .

Page 43: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

2. The Bracket Abstract

The main use of formal variables that combinatory logic avoids

is in the definition of functions. The systems of combinatory logic are

such that any function that can be defined in an intuitive manner by

means of variables adjoined to the system can be formally represented

as an ob of the system without the adjoined variables. This property

is known as combinatory completeness.

Any ob Y of HO(xl, .... xn) intuitively defines a function

over the obs of Ho in terms of the variables xl....,x as the n

correspondence which associates with each n-tuple of obs of Ho the

value (that is the ob of H ) obtained by substituting those obs for 0

the variables X1 ' ..., x in Y. An ob X of Ho is saidto formally

n

define this function if the elementary statement

Xx ... x = Y 1 n

is true in Ho(xl, ..., x ). The notation n

[x,, ..., X 1.Y n

2 3 denotes such an X . In order that abstraction can be considered in

terms of one variable at a time this notation is considered to be an

abbreviation of

[X ,,...,x n-1 l.([xn1.Y) . The bracket abstract, [XI, corresponds to the functional

abstract, Ax, of the A-calculus in many ways, however, it should be

noted that while there Xx.Y was part of the formalism, here [x].Y

is merely an abbreviation for a particular ob.

--

2 3 If there is more than one such X , a particular one is chosen in some manner.

Page 44: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

There a r e s e v e r a l ways t o d e f i n e t h e b racke t a b s t r a c t t h a t

produce such an X , of which only a few of t h e more important a r e

considered here . Assume t h a t H;) is some atomic ex t ens ion (by

inde t e rmina t e s ) o f Ho which does n o t i n c l u d e t h e v a r i a b l e x , and

t h a t Y is an ob of H;l(x). To d e f i n e [x].Y , i t s u f f i c e s t o con-

s i d e r t h r e e ca se s : Y i s an ob U of Hb (and t h e r e f o r e does no t

c o n t a i n x ) , Y i s t h e v a r i a b l e x , o r Y is t h e combination (Y Y ). 1 2

Let U be an ob of H;I then f o r t h e s e c a s e s [x].Y is def ined a s

fo l lows :

( i ) [x].U E K U

( i i ) [XI .x Z I

( i i i ) [ x ] . (Y Y ) 5 S X X where 1 2 1 2

Xi 5 [x].Yi, i = 1 ,2 . The c l a u s e s ( i ) and ( i i i ) c o n f l i c t i n t h e ca se t h a t U i s a

combination, s o t o i n s u r e t h a t [x].Y is determined uniquely

some o r d e r must be s p e c i f i e d f o r t he se c l a u s e s a long wi th t h e r equ i r e -

ment t h a t t h e f i r s t a p p l i c a b l e c l a u s e be used. I f c l a u s e ( i i i )

precedes ( i ) t h e e f f e c t i s t h a t whenever Y i s an atom e i t h e r c l a u s e

( i ) o r ( i i ) is a p p l i e d , o therwise ( i i i ) is app l i ed . When ( i ) precedes

( i i i ) t h e obs ob ta ined a r e s impler bu t n o t n e c e s s a r i l y equa l i n t h e

weak sense t o t hose ob ta ined when ( i i i ) precedes ( i ) . For example,

l e t Y be UVx where U , V a r e atoms of Hb , then [x].Y is

S ( S (KU) (KV) ) I i f ( i i i ) precedes (i) and S (K(UV)) I i f ( i ) precedes

( i i i ) . Now t h e s e obs both t ake t h e same va lue f o r any argument thus :

Page 45: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

S (S (KU) (KV)) I x - S(KU) (KV)x(Ix) ' KUx (KVx) (Ix) - U (KVx) (Ix) UV(1x)

2 W x

and

S (K(UV) ) Ix K(UV)x(Ix) by (S)

-1 UV(Ix) by (K)

- uvx by (1)

but since both obs are in normal form (since U and V are in

normal form) and they are distinct, they are not equal in the weak

2 4 sense .

Neither of the above algorithms for defining the bracket

abstract is the most natural, in particular if Y is an ob Ux ,

where U is an ob of H; , it seems natural to define [x].Y 5 U.

This case is covered by the clause

(iv) [x].Ux 5 U . This clause also conflicts with (iii) and similarly the results given

by the different possible orders are not necessarily equal in the weak

sense.

The following table gives the above clauses, where U is an

ob of H; , X [x].Y and Xi E [x].Yi , i = 1,2:

24 This result requires the Church-Rosser Theorem of the next section.

Page 46: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

(The c l a u s e s a r e named ( a ) , ( b ) , ( c ) , and ( f ) t o be i n agreement w i t h

Curry [CLg].) Any p a r t i c u l a r a l g o r i t h m is deno ted by p l a c i n g t h e

d e s i r e d l e t t e r s i n t h e d e s i r e d o r d e r i n p a r e n t h e s e s , f o r example, t h e

a l g o r i t h m i n which ( i i i ) preceded (i) above is now c a l l e d ( f a b ) and

t h e one i n which ( i ) preceded ( i i i ) is c a l l e d ( a b f ) . The a l g o r i t h m

( a b c f ) g i v e s t h e s i m p l e s t r e s u l t s bu t f o r r e a s o n s which w i l l b e

s e e n , o t h e r a l g o r i t h m s o r r e s t r i c t e d forms of ( a b c f ) a r e sometimes

p r e f e r r e d . Any a l g o r i t h m which c o n t a i n s a t l e a s t t h e c l a u s e s ( a ) ,

( b ) , and ( f ) w i l l produce an X such t h a t

X X ~ Y .

From now on by ' a l g o r i t h m ' w i l l b e meant one t h a t does c o n t a i n a t

l e a s t ( a ) , (b) , and ( f ) i n some o r d e r .

Le t t h e s u b s t i t u t i o n p r e f i x [M/x]X be d e f i n e d a s f o r

t h e A-calculus , excep t t h a t t h e f o u r t h and f i f t h c l a u s e s a r e now

i r r e l e v a n t . The [x].Y produced by any a l g o r i t h m can be shown 25

t o be r e l a t e d t o t h e s u b s t i t u t i o n p r e f i x by

25 The proof f o l l o w s from Xx Z Y and p r o p e r t i e s o f t h e s u b s t i t u t i o n p r e f i x .

Page 47: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

3. Extensionality

This section is concerned with the question of extensionality

for the systems of combinatory logic. In $ 2 ~ 2 it was noted that

equality in the BQ-calculus was extensional (as formulated in rule (10))

and that in the AB-calculus was extensional in a restricted sense

(rule ( 1 0 ) Two similar cases will be considered here; the general

case will be called case 2 and the restricted case will be called

case 1. A class of obs, called - functional obs, are postulated for each

case. In case 1 the functional obs are all obs of the form

S , SU, SUV, K, KU, I , where U,V are arbitrary obs. In case 2 all

obs are functional. The property of extensionality is then formulated

(6) If U and V are functional obs and x occurs

in neither, then

if Ux = Vx , then U = V . The two forms of this rule are denoted by (6) and (6)2 . The equiva-

1

lences formed by adjoining either case of this rule to the axioms and

rules of Ho are denoted by = and = , and the resulting systems 1 2

2 6 by H1 and H2 .

As to the relationship between the rule of extensionality

and the bracket abstract, the results of the various algorithms for

a particular oh Y of H;(X) will be seen to be equal (in the sense

of = 1

or =2) if the clause (c) is restricted to the case that U

is a functional ob (note that this is no restriction in the case 2).

26 In Curry [CLg] the subscript 1 is replaced by B and the subscript 2 is replaced by q.

Page 48: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Thus if (c) is omitted entirely the remaining algorithms produce

equal (= or = ) results. So for the system 1 2 H1 the bracket

abstract will be defined by some algorithm without (c) or by an

algorithm containing the restricted clause (c). Any algorithm con-

taining the restricted clause (c) is denoted by the subscript 1.

Rule (6) is equivalent to the conjunction of the following

27. rules . (7) If U = V , then [x].U = [ x ] .V

(8) If U is a functional ob and x does not occur

in U , then [x].(Ux) = U . The instances of (7) and (8) for case 1 and case 2 are denoted by

subscripts. While (7) does not seem to depend upon the functional

nature of U and V , the algorithms used for the bracket abstract

in either case brings along this dependence. So (6) is equivalent 1

to the conjunction of (7) and (8)1, and (6)2 is equivalent to the 1

conjunction of (7) and (8) 2 2

The rules (7) and (8) above differ in one major respect from

their analogues in the A-calculus. Each of them is actually a rule

scheme since the bracket abstract is not a part of the formalism as

was the functional abstract of the A-calculus. The question thus

arises as to whether it is possible by adjoining a finite number of

axioms to those of Ho to produce systems for which the rules (7)

and (8) are valid. In this section only the cases of the various

proofs that are not relatively straightforward are considered.

27 As in $2~2, the rules (6). (7) . and (8) here are the analogues of the rules (lo), (5), and (8) there respectively.

Page 49: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Consider f i r s t t h e r u l e ( 7 )

( 7 ) I f U = V t h e n [x].U = [x].V . I n o r d e r t h a t t h i s r u l e be v a l i d i t must be t h e c a s e t h a t whenever

t h e r e is a proof o f U = V i n t h e sys tem (H;)(x) w i t h a number o f

a d j o i n e d axioms) one i s a b l e t o c o n s t r u c t a proof o f [x].U = [x].V . The way t h i s is done is t o show t h a t t h e proof of U = V c a n b e t r a n s -

formed w i t h t h e h e l p of a number of axioms t o a proof o f [x].U = [x].V.

No s p e c i a l axioms a r e needed t o show t h i s f o r i n s t a n c e s of

1 , (2) , 3 ( 4 , o r (5 ) . For example, t h e c a s e of (4 ) can b e shown

a s f o l l o w s : l e t Xi = [x] .Y , suppose t h e e q u a t i o n Y1Y3 = Y2Y3 i

was o b t a i n e d from Y = Y by ( 4 ) , and t h e a l g o r i t h m is (fab) , t h e n 1 2

X1 = X2 ( t h e i n d u c t i o n h y p o t h e s i s )

SX1 = SX2 (by ( 3 ) )

[x].Y Y = [x].Y2Y3 1 3

(by c l a u s e ( f ) ) . Now, t h e a d j o i n e d axioms a r e each t o be o f t h e form U = V ,

where U and V a r e c o n s t a n t s ( t h a t is , o b s t h a t c o n t a i n no i n d e t e r -

m i n a t e ~ ) . Suppose U i s a c o n s t a n t t h e n , i f U i s a n atom

by any a l g o r i t h m , b u t i f i t is a combinat ion (U U ) , U , U a toms, then 1 2 1 2

[ x ] . U = 1x1. (U1U2) = S(KU ) (KU2) 1 by ( f a b ) .

Thus i f t h e r e were a n axiom a s s e r t i n g

i t c o u l d be shown f o r ary c o n s t a n t U by i n d u c t i o n on i t s s t r u c t u r e t h a t

Page 50: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Such an axiom can be formed us ing any a lgo r i t hm f o r t he fo l lowing

The a lgo r i t hm (a b c f ) g ives

S(BS(BK(BSK)))(KK) = BK

where BU is w r i t t e n a s an abb rev i a t i on o f S(KU). A s impler form is

BCK = BK. Any such axiom i s c a l l e d axiom (SK). The r u l e (7) can then

be e s t a b l i s h e d f o r t h e adjoined axioms by

U = V (axiom)

[x].U = [x].V (by axiom (SK)) . The only o t h e r way i n which one can a r r i v e a t an equa t ion

X = Y is a s a r e s u l t of one of t h e r educ t ion r u l e s ( I ) , (K), o r (S) .

The axioms needed t o d e a l wi th t h e s e a r e developed wi th e i t h e r (7) o r 1

(7)2 i n mind. Those f o r t h e r e s t r i c t e d c a s e 1 a r e considered f i r s t .

Throughout t h e fo l lowing X E [x].Y , X . E [x].Y and t h e express ion 1 i

2 8 Z U i s taken a s an abb rev i a t i on of S(KU)I o r B U I . 1

Consider t h e axioms ( I ) , (K) and ( S )

I Y1 = Y1

K Y1Y2 = Y1

s YlY2Y3 = Y Y (Y Y ) . 1 3 2 3

To s a t i s f y (7) i t must be shown t h a t 1

[ x ] . I Y = [xl.Y1 1

[x ] . K Y1Y2 = 1x1 .Y1

[ x ] . s Y1Y2Y3 = [x].Y Y (Y y ) . 1 3 2 3

28 B and Z1 a r e combinators having t h e d e f i n i t i o n s B S (KS)K

and Z1 E sB(KI), BU -1. S(KU) and Z U 2 S(KU)I . 1

Page 51: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

When the rule 2 9

(8)' [XI. ((ix1.y)~) = ix1.Y ,

is added, which asserts that ZIU = U whenever U is a bracket

abstract since for any constant U,[x].Ux = ZIU by (abf) ,

an axiom sufficient for the K case is found as follows:

and by (8)'

[x1.Y1 = Z1([xl.Y1) . Thus, a sufficient axiom is one that implies

S (S (KK)x)y = Zlx . In fact if M = N is postulated for any two constants M and N

which are such that

M x y 2 S(S(KK)x )y

N x y 2 Z x 1

the result follows. So let

M = [x,yl. S(S(KK)x)y

= s (KS) (S (KK) )

= BS (BK)

29 This is a special case of (8) in which U is a bracket abstract.

Page 52: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

then t h e axiom

a long wi th t h e r u l e ( 8 ) ' imp l i e s

Axioms f o r ( I) and (S) f o r t h e c a s e 1 can be found i n a

s i m i l a r manner. Forms of t h e s e axioms a r e

Thus, i n a system H which has t h e axioms of Ho a long wi th t h e axioms

(SK), (71)1, (7K)1, (7S)1, and t h e r u l e ( 8 ) ' , t h e r u l e (7)1 is v a l i d .

For t h e ca se 2 where t h e u n r e s t r i c t e d a lgo r i t hm (a b c f ) i s

al lowed, an axiom s u f f i c i e n t f o r t h e (K) c a s e can be found a s fol lows:

[x].K Y1Y2 = S(S(KK)X1)X2

and

Now i n t h i s c a s e one does no t need t o use t h e r u l e (8 ) ' t o a l low t h e

formation of a weaker axiom, i n s t e a d an axiom t h a t a s s e r t s

S(S(KK)X1)X2 = X1 d i r e c t l y i s accep tab l e . This , a s is t o be s een ,

i s t h e c a s e s i n c e t h e s t ronge r ( 6 ) can suppor t such an axiom. An 2

axiom t h a t guaran tees t h a t

us ing ( a b c f ) , is

Page 53: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

The f o l l o w i n g axioms f o r ( I ) and (S) f o r t h e c a s e 2 can be

found s i m i l a r l y :

(7S), B(BS) (BS(BS)) = s(BS(BK(BS(B(BS)S)))) (KS)

Then t h e r u l e ( 7 ) i s v a l i d i n any system c o n t a i n i n g t h e axioms of 2 Ho

and t h e axioms (SK) , (71) 2 , (7K)2, (75) .

I n o r d e r t o deve lop axioms t h a t imply t h e r u l e (8) t h e

f o l l o w i n g r e s u l t i s no ted . I f t h e axiom (SK) is p r e s e n t t h e n f o r any

c o n s t a n t U

[ x ] .Ux = S(KU)I by ( f a b ) and (SK)

d e f . of Z1

Thus, t h e r u l e (8) i s e q u i v a l e n t ( i n t h e p r e s e n c e of (SK)) t o t h e r u l e

I f U i s f u n c t i o n a l , t h e n ZIU = U .

For t h e c a s e 2 where e v e r y ob is f u n c t i o n a l , t h i s r u l e can be e s t a b l i s h e d

by t h e axiom

For c a s e 1, however, t h e f u n c t i o n a l obs a r e j u s t t h o s e obs of t h e form

I, K, KU, S , SU and SUV, and t h e r u l e Z U = U i s r e q u i r e d j u s t f o r 1

t h e s e obs . I t is s u f f i c i e n t t o have t h e r u l e s

( i ) [ X I . I x = I

( i i ) [ x , y ] .Kxy = K

( i i i ) [x ,y ,z ] .Sxyz = S

(where t h e a l g o r i t h m is ( a b f ) o r ( f a b ) ) P r e s e n t i n t h e system.

Page 54: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

For example, for the cases of K and KU , and the algorithm (a b f)

K = [x,y].~xy by (ii)

= s (BS (BK(Z~I) ) ) (KI) by (a b f)

= [X].S(BS(BK(Z~I)))(K~)X by (iii)

= Zl(S(BS(BK(ZII))) (KI)) by (a b f)

= Z1 K

Using the algorithm (a b f) the rules (i), (ii), and (iii) become the

Simpler forms of (8K) and (8s) are, respectively, 1 1

BZ1(ZIK) = K

Thus, in any system with the axioms of Ho

and the axioms (SK) and

(81) the rule (8)2 is valid. If the system has the axioms of 2 Ho and

the axioms (SK) , (81) (8K) and (8 I) the rule (8) is valid. 1

Let Haxl be the system Ho(xl, ..., x ) with the axioms n

(SKI, (71),, (7K)1, (7S)1, (81)1, (8KI1, and (8SI1, and let H ax2 be

the system Ho(xl,. . . ,x ) with the axioms (sK), (71)2, (7K)2, (7S)2, n

and (81)2, then the rule (6)1 is valid in H and the rule (6)2 is ax1

valid in Hax2 '

Page 55: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

All that remains to be shown is the validity of the adjoined

axioms for the systems H1 and H2 . Consider the axiom (SK) for the

system H1 and let x,u,v be indeterminates, then

S(K(S(Ku)))Kv BKuv

S(K(S(Ku)))K BKu

S (BS (BK (BSK) ) ) (KK) u BKu

S (BS (BK (BSK) ) ) (KK) BK

by (1)

by reduction rules

by reduction rules

by (611

by reduction rules

by (611

This shows that axiom (SK) is valid in H1 and it is then a fortiori

valid in H2 . The remaining axioms can be shown to be valid for their

respective systems in the same manner, however, the following demonstra-

tions of the validity of (71) and (71)2 for the systems H1 and H 1 2 '

respectively, are included to illustrate how the system H2 can support

the stronger forms of the axioms. The axiom (71)1 is seen to be valid

for H as follows: 1

I(ux) = ux 1

S(K1)ux S(Ku) Ix

S~(KI)u S(Ku)I

by reduction rules

def. of Z1

by (6)1 and def. of B.

Page 56: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

The v a l i d i t y of axiom (71) f o r H2 is shown a s fol lows: 2

by (1)

by r educ t ion r u l e s

by w2 by r educ t ion r u l e s

In t h e f i r s t c a s e ( f o r axiom (71) ) one i s forced t o r e p l a c e ux by 1

S(Ku)Ix s i n c e t h e r u l e (6) would o therwise no t apply a s u is no t 1

f u n c t i o n a l f o r t h e ca se 1 and hence Z1 appears i n t h e axiom. I n H 2 '

however, s i n c e a l l obs a r e f u n c t i o n a l t h e r e is no such problem i n

showing t h e v a l i d i t y of t h e axiom and t h e r e Z1 is n o t necessary .

The r u l e s (6)1 and ( 6 ) 2 a r e v a l i d i n Haxl and Hax2 '

r e s p e c t i v e l y , and t h e axioms of Hax l

and H ax2 a r e v a l i d i n H1 and

H 2 , r e s p e c t i v e l y . Let = be t h e equiva lence r e l a t i o n of Hax l

and ax1

- - ax2

t h a t of Hax2 , then t h e fo l lowing hold :

and

X = Y i f f X = Y . 2 ax2

The systems Hax l and Hax2

(or H1 and H ) of combinatory 2

l o g i c correspond t o t h e A@-calculus and t h e ABn-calculus of t h e previous

s e c t i o n . They can be shown t o be equ iva l en t i n t h e sense t h a t each can

be n a t u r a l l y in te rpre ted3 ' i n t h e o t h e r . For d e t a i l s s e e Curry [CLg]

v o l I, Ch. 6 o r Hindley, Lercher,and Selden [ICL].

30 A v a l i d and r e l a t i v e l y complete i n t e r p r e t a t i o n .

Page 57: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

C. Properties of the Systems

A few of the more important properties of the systems of

combinatory logic and the calculuses of A-conversion are presented

in this section. The two principal properties are the Church-Rosser

property which guarantees that all terminating complete reductions of

an ob end in the same ob, and the standardization property which

specifies for the system a particular reduction that will reach a given

end if any reduction will.

In most natural interpretations convertible obs are given the

same general meanings and so, in a sense, an ob in normal form is the

simplest of a class of obs (namely, those convertible to it) all of

which have the same meaning. A normal form of an arbitrary ob X is

31 an ob in normal form which is convertible to X (or, to which X

reduces). Examples of obs with normal forms, where v,w,x,y,z are

variables, are:

1. XW.((XX.(XY.(~X))Z)V) r AW.(ZV) 3 2

2. K(CIv(SKvz)) ' K(zv) . In the first example further a-reductions (that is, applications of (6)

in $A ) are possible so that any a-convertible ob such as Xx.(zv),

Au.(zv), etc. is a normal form of the left hand side. In the second

example no further reductions of K(zv) are possible and therefore if

there are any other normal forms of the left hand side they must be the

result of varying the order in which the reductions are made. The

31 Any form of = for the A-calculuses or =O for cornbinatory logic.

32 Note that while this is in @-normal form it is in Bq-normal form only if w 1 v or wf z.

Page 58: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

48.

various possibilities are indicated in the following diagram where

downwards movement indicates reduction:

From this diagram it is seen that any reduction of K(CIv(SKv2))

which ends in an ob in normal form in fact ends in K(vz). The following

property, called the Church-Rosser property, in a system guarantees this

type of behavior.

The Church-Rosser Property Let 2 be a quasi-ordering of the obs of

a system. If

X > U and X Z V ,

then there is an ob Z such that

U 2 . Z and V Z Z . Diagramatically, this can be pictured by

(Note: In chapter 3 this is called property (B) and the following

equivalent property is called the Church-Rosser property.)

Page 59: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

An equivalent form of this property is the following: Let = 3 3

be the symmetric closure of . If

U = V ,

then there is an ob Z such that

U z Z and V ' Z .

This can be represented by the diagram

The system Ho and all of the A-calculuses have this property.

The theorem asserting this is called the Church-Rosser Theorem and its

proof can be found in Curry [CLglI, Hindley, Lercher and Seldin [ICL],

Church [CLC], and in many other places. Various conditions which imply

this property are discussed in the next chapter in connection with

recursive definitions.

For the remainder of this section let the infix , called

equivalence, be defined by

3 4 ( ) X Z Y iff X ? Y and Y -'X .

The Church-Rosser property guarantees the equivalence of normal forms in

systems in which the class of obs in normal form has the property

(NF) If X is in normal form and X 2 Y , then X ' Y .

33 For combinatory logic, = , and for A-conversion, any form of conversion.

0

34 For combinatory logic .C is identity and for the A-calculus it is a-convertibility.

Page 60: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

To show this suppose an ob X has two normal forms U and V .

Then X = U and X = V . By the Church-Rosser property there is a Y

such that X 2 Y and U 2 Y , From these one has the following

U S Y by (W

Y Z U by (r)

X Z U by transitivity of 2 . Similarly it can be shown that X 2 V . By the Church-Rosser property

there is a Z such that

U - ' Z and V Z Z .

Since U and V are normal forms, by (NF) as above, one has

Z Z U and Z Z V ,

then by transitivity

U Z V and V Z U ,

and thus U 'G V.

The above systems of combinatory logic and the A-calculuses

have the property (NF) where z is identity for combinatory logic and 2

is a-convertibility for the A-calculuses so normal forms are unique for

the systems of combinatory logic and unique up to a-convertibility for

the A-calculuses.

While the Church-Rosser Theorem guarantees that normal forms

are unique for the systems of this chapter it says nothing about whether

a normal form exists for a given ob and if it does how one might go

about finding it.

Consider the ob SII(SI1) which is reduced as follows:

SII (SII) 2 I (SII) (I (SII)) by (S)

2 SII(SII) by (1)

Page 61: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

It is obvious that any possible reduction of SII(S1I) leads to

SII(SI1) and so it has no normal form. Now the ob KI(SII(SI1)) has

the normal form I, but not all reductions lead to I, for example:

KI(~II(SII)) 2 KI(I(SII)(I(SII))) 2 KI(SII(SII)) s . . . by attempting to reduce the component SII(SI1) as above.

For each of the systems of this chapter there is a particular

type of reduction, called a standard reduction, which has the property

that if X 2 Y in any way, then there is a standard reduction from

X to Y. In particular, such a reduction is important in determining

the normal form of an ob, since if a standard reduction fails to

produce its normal form, no reduction will. The theorem that asserts

this property of standard reductions is called the standardization

theorem (see Curry [CLg] I $ 4 ~ 1 and [CLg] I1 $11~3).

The head of a combinatory ob is the left-most symbol

occurring in the ob and for an ob of the A-calculus it is the left-most

occurrence of a variable or instance of Ax , for some x . Let the

notation 'X 2 Y' mean that X reduces to Y by a single contraction 1

in the combinatory case, or a single contraction or instance of rule (6)

of $ 2 ~ 1 for A-conversion. Then if X L Y there is a sequence Xo, ... ,Xn,

such that, x z x > X > 0 1 1 1"'

> x r y . 1 n

In this reduction the contraction yielding Xk is called the k-th ste~.

Page 62: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

52.

A standard reduct ion35 for the combinatory systems and the

hf3-calculus is a reduction in which the head of the redex contracted in

the k+lst step is,or lies to the right offhe head of the contractum of the

redex contracted in the k-th step. For the XBq-calculus a standard

reduction is one which consists of a standard f3-reduction followed by a

36 standard 0-reduction . A complete37 standard reduction is called a normal reduction.

For the combinatory systems and the he-calculus a normal reduction is a

reduction in which at each step the left-most redex is contracted. For

the XBq-calculus, the left-most f3-redex is contracted in each step'and

when no B-redexes are present the left-most 0-redex is contracted at

each step. Evidently, if a normal reduction terminates, it must termin-

ate in a normal form.

D. Church's I-systems

In Remark 1 of $2A1 it was noted that in Church's original

formulation of the calculuses the morphology of the obs was such that

(Xx.M) was an ob only when M contained x free. Such a system is

noncancelling in that if this ob is applied to an ob N the resulting

ob must contain N in the place (or places) which is homologous to

the occurrence(s) of x in K. This is not the case in the K-systems

35 This is called a 'standard B-reduction' for the XB-calculus.

36 Where 'standard 0-reduction' is defined analogously to a standard f3-reduc t ion.

3 7 A complete reduction is one that leaves no redexes uncontracted.

Page 63: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

5 3 .

where an ob such as (Ax.y) is allowed, since for any N , (Xx.y)N ' y

and N is thus cancelled. Combinatory systems of this sort cannot

contain K or any other atomic combinator which has a cancelling prop-

erty. There are various other possibilities but these systems usually

take I,B,C, and S as basic combinators, since these combinators fit

naturally into the definition of the bracket abstract when the case

3 8 [x].U where U does not contain x is no longer allowed .

The important result for the I-systems is that, since no

component of an ob is cancelled, each must have a normal form if the

ob is to have a normal form. This was, in fact, what Church intended

since he felt that an ob should not be considered to be meaningful if

some part of it was not meaningfuSand to him the possession of a normal

form was the criterion of meaningfulness.

Curry, on the other hand, felt that there was no reason to

assume that every natural interpretation considered only the obs with

normal forms significant and so adopted the K-systems.

The main interest in the I-systems stems from the following

theorem which has as a corollary the property mentioned above that every

component of an ob which has a normal form has a normal form.

38 B and C are used in the additional clauses, where U does not contain x and [x].Y E X , called (d) and (e):

(d) [XI .W r BUX (e) [x] .YU f CXU

Page 64: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

54.

Church's Normal Form Theorem3' For any noncancelling system

of combinatory logic or A-conversion, if X has the normal form Y ,

then there is a natural number n such that the number of contractions

in any reduction from X to Y is less than n .

-

39 This is Thm 7XXXI in Church [CLC].

Page 65: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Chapter 3. Recursive Definitions, Least Fixed Points, and the Church-Rosser Property.

The central theme of this chapter is recursion, however, its

treatment involves the examination of many related topics. In particu-

lar, certain properties of the systems of chapter 2 are discussed along

with various techniques for determining their presence.

Following some introductory remarks, $A, concerning functions

and functionals, there is a discussion, 5 ~ 1 , of the concept of recursive

definitions. Sections B2 and B3 consist of the presentation of a number

of evaluation methods for recursive definitions (that is, ways of

evaluating the functions associated with these definitions). These

evaluation methods are divided into two sections corresponding to the

so-called algorithmic approach and semantic approach to recursive

definitions. Section B4 examines a number of proof techniques which

have grown out of the topics of $~1-3. The chapter ends with SC; the

application of a form of the Church-Rosser property to the methods of

S B ~ and a consideration of the various conditions which guarantee the

existence of this property in a relational system.

A. Functions and Functionals

In the study of partial functions, it is often expedient to

adjoin a new element, indicated here by the symbol ' w ' , to the domains

concerned. This new element is called the undefined element. When a

partial function is undefined for a given argpment , it will be con-

sidered to be w. The function is thus a total function over the new

domain. While this approach does not remove any of the real problems

Page 66: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

56 .

concerning partial functions, it serves to streamline many of the discus-

sions in much the same way that the addition of the element 'm' does for

analysis.

1. The Undefined Element and Extensions

Suppose a set A. is given. The set A. is extended to the

set, which is called A , by adjoining a new element, denoted by 'w ' ,

which is not in A. , so A = AOU{w) . This element is referred to as

the undefined element. The expressions 'is defined' or 'takes a value

in A ' are understood to indicate some element of the domain other than

w, that is, some element of 4 0 41 Ao. A partial ordering , 5 , on A is

defined by

w c a C a for every a C A . -

It is further understood that for any two distinct elements, a and b ,

of A neither a c b nor b c a . So an assertion 'a c b' means that 0 - - -

either a is w or a = b . This partial ordering is used to define a

partial ordering , - L ~ ~ , on the cartesian product43 = ,Ax A x . . . xA, il - -

as follows: Let a = (al, ..., a ) and b = (bl, ..., b ) be elements of n n

A* then

k b - iff a C b forevery i , 1 5 i 5 n . i - i

4 0 A reflexive, transitive, and antisymmetric relation.

41 This is read as 'is less defined than or equal to' and is sometimes referred to as a 'definedness' relation or ordering.

42 The same symbol is used as confusion between the two is not likely.

43 More general cartesian products, e.g. A x A2x . . . xAn , are treated similarly. 1

Page 67: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

5 7 .

A partial n-ary function, f , from An to BO is now con- 0

sidered to be instead a total function from A>O B ; where f (a)

was previously undefined it is now taken to be w C B. An n-ary

(now total) function, f, from to B can be extended in many ways 0

to define a total function from An to B ~ ~ . The simplest such

n extension is a function which agrees with f on A. and is w on

n - A. , that is, it is w whenever one or more of its arguments

is w. This function is called the natural extension45 of f . Other

extensions are discussed below.

Partial relations are considered to be functions from a set

into the set To = {true, false), which is extended to T = T~U{U) ,

and then treated similarly.

A function g , from An to B , that is the extension of a

function, f , from An to B is said to be an extended function. 0

Note that this description refers to the function g not the function

f, contrary to the normal English usage. This terminology is generally

used when there is no interest in the original unextended function. In

particular, a naturally extended function, g , is one which results

from naturally extending some function f.

44 This is done to cover situations which arise in the composition of functions where one of the arguments may be a function which is w for some argument.

4 5 This is related to what Kleene calls a weak extension, ([1M~]$64).

Page 68: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

2. Monotonicity of functions

A function, f , from to B , is said to be monotonic

just when it preserves the partial order on its domain, that is, just

when

a c - implies •’(a) - c f(6) , for all a, c . The set of all monotonic functions from A to B is denoted by

' [ A -+ B ] ' . Note that a composition of monotonic functions is again a

- - - X = (XI, ..., Xn); f, gl, ...,gn are monotonic and of order n,nl,..,n n ' - - respectively. Let a = (a , . . . a ) , b = ( 6 . . . 6 ) and (- 6 ,

n - -

then a c , which implies gi(<) 5 gi(6i) , by the monotonicity of i - i

the i

, which in turn implies, by the monotonicity of f ,

1. The identity function, I, is monotonic.

Any unary constant function can be extended to a

monotonic function in two ways. Let f : A. + B

such that f(a) = b Va C Ao, then

(a) g = f on A. and g ( w ) = (o (the natural

extension) , and

(b) g(a) = b Va C A

are both monotonic. An n-ary constant function

can be extended in 2" ways to a monotonic function.

46 In this sketch it is assumed that all necessary considerations involving the domains and ranges of the involved functions have been made.

Page 69: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

3. The equality relation, = , is classically extended in two ways

(a) Weak equality, also denoted by the infix '=I,

is the natural extension, that is, it agrees

with the original equality relation on all

defined arguments and is w when one or

more of its arguments are w . (b) Strong equality, denoted by the infix " ,

agrees with the original equality relation

on defined arguments and is true if both

arguments are w and false otherwise. Note

that it is never undefined. Note also that

strong equality is not monotonic. Let

a be w and b F A then (a,b)c(b,b), 0 '

further a " b is false and b % b is true,

but false - # true, therefore a r b Q b ? b - and is not monotonic.

4. The conditional function (if x then a else b , x C T , a E A. , b E B ) found in computing science

0 0 is extended in three main ways to monotonic functions

on T x A x B . Unextended this function is taken to

be a if x is true and b if x is false. The

extens ions are :

(a) The natural extension.

(b) The sequential conditional, defined by the clauses:

(i) (if true then a else b) % a

(ii) (if false then a else b) + b (iii) (if w then a else b) r w

Page 70: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

( c ) The p a r a l l e l c o n d i t i o n a l , def ined by t h e c l auses :

( i ) ( i f t r u e then a e l s e b) ?% a

( i i ) ( i f f a l s e then a e l s e b) G b

( i i i ) ( i f w then a e l s e b) r a ,

i n t h e case t h a t a S b

( i v ) ( i f w then a e l s e b) r a,

i n t h e c a s e t h a t a $' b . The monotonicity of t h e p a r a l l e l c o n d i t i o n a l i s shown

a s fol lows: Let (x ,a ,b) 5 ( x ' , a ' , b l ) , where

x ,x ' C T , a , a ' C A , b , b t 6 B . Now cons ider t h e c a s e s

( i ) i f x is t r u e then x ' i s t r u e s i n c e x 5 x ' , t h i s t oge the r wi th t h e f a c t t h a t a - c a ' y i e l d s

i f x then a e l s e b c i f - X ' then a ' e l s e b '

( i i ) i f x is f a l s e , r e s u l t (1) fo l lows s i m i l a r l y

s i n c e b c b ' -

( i i i ) i f x is w and a b , then " if x then

a e l s e b" i s w and hence (1) holds t r i v i a l l y

( i v ) i f x is co and a r b , then i f a and b

a r e w t h e r e s u l t fo l lows a s i n case ( i i i ) ,

o therwise i f a and b a r e def ined then

they a r e equal and f u r t h e r they a r e a l s o equal

t o a ' and b ' s i n c e a - c a ' and b 5 b ' ,

hence (1) fol lows.

Page 71: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

61.

In t h e above examples t h e r e a r e c a s e s o f ex tended f u n c t i o n s

t h a t a r e monotonic even though they were n o t n a t u r a l e x t e n s i o n s (2b, 4b

and 4 c ) . It is e a s y t o show, however, t h a t a l l n a t u r a l l y ex tended

f u n c t i o n s a r e n e c e s s a r i l y monotonic. L e t f from An t o B be a

- - - - n a t u r a l l y ex tended f u n c t i o n and l e t a , c C An such t h a t a 5 c .

- - Now i f a = c t h e n f ( 2 ) = f ( c ) and hence f ( a ) c f ( c ) , s o l e t - - - - - a # c , o r a c c . I f t h i s i s t h e c a s e t h e r e must be some p l a c e , s a y

i where a c c which i m p l i e s t h a t a i s w w h i l e c i i s d e f i n e d , i i i

b u t s i n c e f i s n a t u r a l l y ex tended f ( a ) is o and hence

f ( a ) c - f ( c ) t r i v i a l l y .

A p a r t i a l o r d e r i n g , r on [A + B ] , is d e f i n e d i n t e rms -f '

of t h e b i n a r y r e l a t i o n , L , on B by:

h c g i f f h ( a ) ~ g ( a ) f o r a l l a E A . - f

The symbol 'c ' i s r e a d a s ' i s l e s s d e f i n e d t h a n o r e q u a l t o ' . The - f

s u b s c r i p t ' f ' w i l l be g e n e r a l l y o m i t t e d u n l e s s t h e r e i s some danger

of c o n f u s i o n .

Note t h a t i f f (: g t h e n whenever f t a k e s a v a l u e d i f f e r e n t - from L f o r some argument , g must a l s o t a k e t h e same v a l u e on t h a t

argument. I f f u n c t i o n s a r e thought of i n t e rms o f o r d e r e d p a i r s , then

t h e e x c l u s i o n o f any p a i r s of t h e form (a,to) a l l o w s t h e r e l a t i o n

'c ' t o be though t of a s t h e o r d i n a r y s e t i n c l u s i o n r e l a t i o n . - f

Page 72: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

A sequence of func t ions i f i ) i n [ A + B] is c a l l e d a cha in

if f i L fi+l f o r a l l i . A f u n c t i o n f is c a l l e d an w e r bound

of • ’ 1 i f f i c - f , f o r every i , and a l e a s t upper bound o r l ub -

i f a l s o f o r every upper bound g , f 5 g . Note t h a t every cha in ,

{f ), has a l e a s t upper bound, f , def ined by i

f ( x ) " f i ( x ) i f t h e r e is an i such t h a t f i (x ) $ o I I - otherwise .

3. Monotonicity and Cont inu i ty of Func t iona l s

A f u n c t i o n a l is simply a func t ion which t a k e s func t ions a s

arguments and perhaps produces func t ions a s va lues . A f u n c t i o n a l , F ,

from [ A -+ B ] t o [ A -+ B] is monotonic i f F ( f ) (_ F(g) whenever f I; g

( f o r f , g C [ A -+ B]) . A f u n c t i o n a l , F , is cont inuous i f i t preserves

l e a s t upper bounds of cha ins , t h a t is, f o r a cha in I f i ]

F( lub{f i ) ) = l ub{F( f i ) ] . Note t h a t c o n t i n u i t y impl ies monotonici ty .

Func t iona l s a r e gene ra l l y expressed i n p r a c t i c e i n terms of a

4 7 composition of known func t ions and a func t ion v a r i a b l e . For example,

t h e express ion

i f x = 0 then 1 e l s e x- f (x-1) (1)

could be considered t o d e f i n e a f u n c t i o n a l F , whose va lue a t f is

t h e f u n c t i o n , whose va lue a t x is given by (1 ) .

S o (F ( f ) ) (x) r ( i f x = 0 then 1 e l s e x . f (x-1) )

and (F(g) ) ( a ) % ( i f a = G then 1 e l s e a . g(a-1)) .

47 i n t h e c a s e of unary f u n c t i o n a l s ; n-ary f u n c t i o n a l s would use n func t ion v a r i a b l e s .

Page 73: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

6 3 .

If the functions used in the composition and f are monotonic, then

F(f) is a monotonic function, by the composition of monotonic func-

tions result.

A functional, F , which is the composition of monotonic

functions and a function variable, f , can be shown to be continuous

by an induction on its structure . Let F be such a functional. Basis step: If F(f) is f

or a (monotonic) function g , then F is the identity functional or

a constant functional, respectively, for which the result is trivial.

Inductive step: There are two cases to consider: (i) (F(f))(x) is

g ( (Gl(f)) (x) , . . . , (G,(f)) (x)) , where g is a monotonic function and

G1, ..., G are functionals, and (ii) (F(f))(x) is f((G(f))(x)), k

where G is a functional. In both cases one shows that if the G's are

continuous, then F is continuous.

Case (i). In order to show that F is monotonic, where

(F(f))(x) is g((Gl(f))(x), ...,( Gk(f))(x)), let h c h and assume that 1- 2

so F is monotonic.

Page 74: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

I n o r d e r t o show t h a t F i s cont inuous , l e t h be a

cha in , then

and t o show t h e i n c l u s i o n i n t h e o t h e r d i r e c t i o n , l e t a C A , then

g ( (lubt ~ ~ ( h ~ ) ) (a), . . . , ( lubt Gk(hi)) (a) 1.

by t h e c o n t i n u i t y of t he Gi. Now,recalling t h e c o n s t r u c t i o n of t h e l ub ,

t h e r e e x i s t n a t u r a l numbers nl, ..., n such t h a t f o r j=l, ..., k , f o r a l l k '

n ? n j ' G j (hi)) (a) I (Gj (hn) 1 (a).

i

hence f o r t h i s case F i s continuous.

Case ( i i ) . ( F ( f ) ) ( x ) is f ( ( G ( f ) ) ( x ) ) ; t h i s case i s very

s i m i l a r t o c a s e ( i ) , but i n s t e a d of u s ing t h e monotonici ty of g , one

:1u4<,, r , """I

'w

"'!:@,:;B

uses t h e monotonici ty of h and h 1 2 '

Page 75: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

4. The Fixed Point Theorem

The principal result concerning continuous functionals that

is of special interest in this thesis, is due to Kleene and provides,

as will be seen in the next section, a very natural method of assigning

meanings to recursive expressions.

Fixed Point he or em)^ (Upwards)

If F is a continuous functional on [A + B], then the

equation

F(f) = f

has a solution f which is extended by every other solution, that is, P

if F(g)=g then f c g . P -

The proof of this theorem will be put off until 5 ~ 3 following

a discussion of recursive definitions.

B. Recursive Definitons

The term 'recursive definiton' is very familiar to most con-

cerned with mathematics or computing. Many of even the simplest func-

tions of arithmetic, such as addition and multiplication, are defined

recursively. Most higher level computing languages feature some type of

facilities allowing recursive definitons. However, despite this

familiarity with the term, its meaning often varies significantly among

those who use it. Today the term is used loosely to include definitions

of a somewhat more general nature than those originally associated with

4 8 This is essentially the First Recusion Theorem in Kleene,[IMM] Theorem XXVI.

Page 76: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

the term by Kleene [TMM], for example. A definition is simply a con-

vention by which a new symbol or symbol combination is introduced to

a language with the understanding that it will stand for some other

combination that is already understood, perhaps by virtue of other

definitions. In a definition the new symbol or symbol combination is

called the definiendum, and the symbol combination it stands for is

called the definiens. If the definiens consists only of symbols of

the original system, the definition is said to be explicit. A recur-

sive definition differs basically from an explicit definition in

allowing occurrences of the definiendum or other symbol combinations

containing new symbols to appear in the definiens.

A slightly more general approach in which a number of defini-

tions are made simultaneously is considered below. This type of system

extension is called a definitional extension by Curry [CLg] vol. I.

1. Definitional Extensions

a. The Classical Approach of Kleene, Curry, etc.

Suppose S is the original system under consideration. All

parts of S will be referred to as 'basic'. Let T be the extended

system, whose parts which were not originally in S will be referred

to as 'new'. - There is a new binary predicate, here represented by the

infix I + ' , which is used to denote the fact that a definition is being

made.

Page 77: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Elementary statements made with this predicate are then of the form

X +- Y 4 9 (1)

where X and Y are obs of T . In such a statement X is called

the definiendum and Y the definiens. The axioms of + consist of

all elementary statements of the form

X 4- x ( 2 )

where X is an ob of T , along with a set of defining axioms each

of which has the form

•’(XI, ".,X ) + Y n (3)

where f is a new operation of degree n called the principal

operation of ( 3 ) , and X1, ..., X are obs of S and Y is an ob of T. n

These axioms, being part of the system T , are called new axioms. Note

that XI, ..., X are basic obs. Finally, there is a rule of deduction 5 0 n

allowing inferences of the form

X * Y X f Y'

where Y' is obtained from Y by

definiendum of a defining axiom by

A deduction from the new

is called a definitional reduction

replacing some occurrence of a

its definiens.

axioms by application of this rule

. Since all replacements are made in

the definiens, a definitional reduction can be represented by the

sequence Y, Y', Y", etc. Such a sequence obviously ends when an ob,

Z, of S is encountered, since Z can contain no occurrence of the

49 This is read 'X is (recursively) defined by Y'.

50 This is the rule Rd in Curry [FML] $ 3 ~ 2 - and [CLg] $2~1. -

Page 78: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

definiendum of a defining axiom. When this is the case, Z is called

an ultimate definiens of X. Since the arguments of the principal

operations in defining axioms are obs of S, the components of a given

definiens Y which can be replaced in an application of the rule are

nonoverlapping and therefore can be replaced in any order without

affecting the final outcome. A definitonal reduction therefore pro-

ceeds by replacing any of the innermost (with respect to the new

operations) occurrences of new symbol combinations (closures of new

operations). It is clear that if a definitional reduction does not

reach an ultimate definiens it may take two courses. It may continue

indefinitely without ever resulting in an ultimate definiens, or it

may result in a new ob which contains a component for which no

defining axiom is available in which case the reduction is said to be

blocked. In either case the ob could be said to be undefined. While

for a recursive definition a blocked reduction when it arises can be

diagnosed, it is not always the case that a nonending reduction can be

seen to be such.

The only thing that may affect the uniqueness of the ultimate

definiens is the existence of two instances of defining axioms with the

same definiendum and different definiens. When this possibility is not

permitted the definitional extension is said to be proper.

A definitional extension, T , is said to be (partial)

recursive just when the defining axioms are given by a finite number of

axiom schemes containing variables ranging over arbitrary basic obs,

and every new ob has at most one ultimate definiens. A (partial)

Page 79: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

recursive definitional extension is said to be total just when for

every new ob there is at least one definitional reduction to an ulti-

mate def iniens.

The definitional reductions to ultimate definientia of the

new obs of T constitute a valuation of the obs of T in S . Note

that any ob of T originally in S is its own ultimate definiens by

a single application of (2). The ultimate definiens, Y , of an ob,

X , is sometimes called the 'value' of X in the original system.

Examples. Take as a basic system, called No , the non-negative

integers made up of the basic atom 0 by applications of the basic

operation, ' ' ' , the successor function. Then the operation of

addition can be defined by the axioms

O + X + X

Yf + X + Y + X f

where X,Y are integers (that is, obs of the system No). The system

with this new operation is called N1 . A definitional reduction of

0"' + 0" (that is, 3 + 2) is: 0"' +o" +. 0" + O W '

c 0' + 0""

c 0 + 0""' + Of'ff'

tion of multiplication for the above extended sys

N1 , is defined by the axioms

O 0 X + O

X'- Y + (X Y) + Y

The opera tern,

Page 80: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

where X and

will be called

(3 - (2 + 1)) is

Y are obs of the above system. The resulting system

N2 . A definitional reduction of 0'" (0" + 0')

as follows:

This can be further reduced in the second system, N using the 1 '

axioms for + . Now the operations of addition and multiplication could have

been defined simultaneously yielding a system Nj

in which case the

reduction of 0"'~(0"+01) could take the following course, the

arrows indicating the replaceable component:

Page 81: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

71.

Note t h a t obs of N and N3 t ake v a l u e s i n 1

No , whi le obs of 2

t a k e va lues i n N1 . Because of s i t u a t i o n s l i k e t h i s , one must be

c a r e f u l when us ing t h e term ' v a l u e ' , e s p e c i a l l y i n c a s e s l i k e N2 ,

where t h e va lue of an ob may be an express ion con ta in ing t h e symbol

'+', whi l e t h e common understanding is t h a t t h e va lue should be an

i n t e g e r .

The d e f i n i n g axioms f o r a given new ope ra t i on can be taken

toge the r and considered t o be a f u n c t i o n a l , F , so t h a t a r e c u r s i v e

d e f i n i t i o n can be represen ted by

f(X X n ) + (F(f))(X1 , . e m , X n

This n o t a t i o n i s u s e f u l i n many s i t u a t i o n s , f o r example, Kleene 's

F i r s t Recursion Theorem ( t h e f i x e d p o i n t upwards theorem of s e c t i o n 1 )

then holds f o r r e c u r s i v e d e f i n i t i o n s formulated i n t h i s way. Basi-

c a l l y what t h i s theorem says i s t h a t a r e c u r s i v e d e f i n i t i o n of an

ope ra t i on determines uniquely an ope ra t i on which can be viewed a s t h e

l e a s t f i xed po in t of t h e f u n c t i o n a l I?. This t o p i c i s re turned t o i n

d e t a i l i n 5 ~ 3 .

b. Call-by-Name, Call-by-Value, and t h e Condi t iona l Funct ion.

I n t h e examples of t h e prev ious s e c t i o n , i t was o f t e n neces-

s a r y t o choose between two o r more axioms when c a r r y i n g ou t a d e f i n i -

t i o n a l r educ t ion of an express ion . For i n s t a n c e , i n eva lua t ing

0 + O l " " t h e axiom 0 + X + X was chosen in s t ead of Y' + X + Y + X '

s i n c e t h e f i r s t argument of + was 0 . Sometimes t h e r e a r e ope ra t i ons

w i th in a language o r system which a r e such t h a t du r ing t h e i r eva lua t ion

Page 82: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

72.

a s i m i l a r choice is made which usua l ly depends upon t h e va lue of some

argument of t h e s e opera t ions . his type of ope ra t ion w i l l be l oose ly

r e f e r r e d t o a s a branching opera t ion . A t t h e end of t h e previous

s e c t i o n i t was noted t h a t sometimes d e f i n i t i o n s a r e considered t o be

given i n terms of a func t iona l . Funct ions def ined i n t h i s way a r e

gene ra l ly branching func t ions s i n c e t h e choice of a p a r t i c u l a r axiom

is then incorpora ted i n t o t h e no ta t ion .

Perhaps t h e most w e l l known func t ion of t h i s s o r t is t h e

c o n d i t i o n a l func t ion , a l s o known as t h e ' i f --- then --- e l s e ---' 51 func t ion . A c l o s u r e , ' i f A then B e l s e C ' of t h i s func t ion

is eva lua ted by f i r s t determining t h e va lue of A and i f i t s va lue i s

' t r u e ' , B is chosen, i f i t s va lue is ' f a l s e ' , C i s chosen, and i n

t h e case t h a t t h e eva lua t ion of A produces n e i t h e r ' t r u e ' nor ' f a l s e '

t h e c l o s u r e is no t def ined . The express ion A is c a l l e d t h e

c o n d i t i o n a l c l ause , and B and C a r e c a l l e d t h e branch express ions

o r simply branches.

The d e f i n i t i o n of t h e f a c t o r i a l func t ion can be given i n

terms of t h e c o n d i t i o n a l func t ion a s fol lows:

X! + ( i f X = 0 then 1 else X*(X-I)!)

In t h i s way a s i n g l e express ion r e p l a c e s t h e axiom and axiom scheme

O! 4- 1

51 There a r e many s i m i l a r func t ions i n t h e l i t e r a t u r e , t h i s p a r t i c u l a r one is t h e s e q u e n t i a l form of Example 4b i n $ ~ 2 above.

Page 83: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

73.

The introduction of this new function, however, brings along

certain problems of its own. Consider the example

f(x) +- (if x = 0 then 1 else '/x) . If the conditional function is treated like a usual function one might

endeavor to evaluate the branch expressions before the conditional

clause. This approach, while always being inefficient, could be dis-

asterous as in the case that x=O . Studies of this type of function in which a parameter is

passed without evaluation have led to a generalization of the concept

of definitional extension as given in $a. Most of the above approach

remains unchanged however the restrictions on the form of the para-

meters in the defining axioms are loosened. The axioms of + are

taken to be all expressions of the form (2) along with a set of

defining axioms each of which now has the form

f(X1, ..., X ) + Y n (3 ) '

where f is a new operation of degree n called the principal opera-

tion and X1, ..., X Y are obs of T . The generalization is that n '

XI, ..., X are no longer restricted to S and may themselves contain n

occurrences of new operations (that is, components which are obs of T).

The notions of 'recursive definition1, 'total', and 'proper' are

defined as above.

The main consequence of this generalization is that now the

replaceable components of an ob Y may be overlapping and hence the

reduction need not proceed in an innermost-outward direction. In the

case of a recursive definitional extension (in this generalized sense)

Page 84: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

the course of reduction becomes important since while the ultimate

52 definiens must be unique, if it exists (the definition of recursive) ,

there may be some reductions that yield it while others do not. Con-

siderations of this sort make up 5 ~ 2 below and will be returned to

there.

Restricting attention to the occurrence of a particular new

operation in an expression, the approach of $a required that none of

its arguments contain new operations themselves in order that the

closure of the new operation be replaceable. So before a particular

new principal operation could be replaced, all of its arguments con-

taining new operations had to be replaced by their ultimate definiens,

if they existed, and if any of them did not exist, then the closure of

the principal operation could never be replaced. The parameter posi-

tions of this type of new operation (i.e., one whose defining axioms

are of the form (3)) are called call-by-value parameter positions

(or simply call-by-value parameters) since the value of the para-

meter must be known before the principal operation can be evaluated.

The generalization, ( 3 ) ' , above allows the closure of a

principal operation to be replaced by its definiens even when some of

its arguments contain occurrences of new operations. Since the argu-

ments need not be evaluated before their principal operation these

52 Note that a recursive definition is taken here to be (by definition) one in which the ultimate definiens is unique (if it exists). Conditions that imply this property for an arbitrary definitional extension are discussed as a special case of a Church Rosser property for such systems in $C of this chapter.

Page 85: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

parameter positions are called call-by-name parameter~sitions - (or

simply call-by name parameters). In many cases it is useful to con-

sider defining axioms which fall between the two above approaches ,

that is, defining axioms having the form

where f is a new operation of degree m+n , Y1, ..., Y are obs of m

S , and X l,...,Xn, Z are obs of T . The Y , ranging over S , i

are call-by-value parameters and the Xi , ranging over T are

call-by-name parameters.

c. Two approaches: DeBakker and Manna

The above, ( 3 ) " , method for defining functions allows for

an explicit choice between call-by-value and call-by-name parameters.

Further the properties of these two types of parameters call for

different mechanisms when evaluating functions containing both types

of parameters; the call-by-value parameters must be evaluated before

the principal operation, while the call-by-name parameters may be

passed unevaluated in the evaluation of the principal operation.

DeBakker, in [LFP], considers such a system in which there

exists both an explicit choice between parameter types and different

evaluation mechanisms for dealing with each of the types. The call-

by-name parameters are textually substituted in the definiens (that

is, they are evaluated as late as possible, apparently the possibility

of earlier evaluation is left open) and the call-by-value parameters

are evaluated before the principal operation, and effect a change in

the environment (which is essentially a list of variables along with

Page 86: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

their current meanings).

In another approach, inspired53 by the work of Manna (see

[MTC], etc.), the conditional function is admitted as a special func-

tion, and all other functions, whose definitions contain no reference

to the conditional function, are assumed to have solely call-by-name

parameter positions (that is, always defined by axioms of the form

( 3 ) ' 1

The inclusion of the (sequential) conditional function pro-

vides a method of defining functions with call-by-value parameters,

since the above (Sb) procedure of evaluating this function gives one

call-by-value parameter position (namely, the conditional clause) to

work with. In the case of a function defined by means of the condi-

tional function (as a composition of it and perhaps other functions),

any parameter of the function being defined which occurs in a condi-

5 4 tional clause can be thought of as call-by-value. For example,

consider the following functions of the nonnegative integers:

fl(x,y) + 1

f2(x,y) +if x = 0 then 1 else 1

f3(x,y) +if (x = 0 and y = 0) then 1 else 1 .

53 It should be noted that while this seems to be the natural way to deal with call-by-value parameters in the systems of Manna, he never actually deals with the case of parameters which are explicitly call-by-value.

54 In a nontrivial way, i.e., not as a call-by-name parameter of another function whose value does not depend upon the value of the parameter.

Page 87: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

In the function fl both parameters are call-by-name; in f2 x is

call-by-value, since its value must be determined before f2(x,y) can

be evaluated; and in f3 both x and y are call-by-value, since

they both must be evaluated before f (x,y) can be evaluated. 3

In the above example it should be noticed that if x and y

are defined then the three functions are the same, however when y is

undefined f3(x,y) is undefined and when x is undefined both

f2(x,y) and f (x,y) are undefined. In general (in any case where 3

call-by-value or call-by-name is allowed, not just the approach of

Manna), extended functions, in the sense of $ A , are necessarily

naturally extended in their call-by-value parameters. An extended

function may not be naturally extended in its call-by-name parameters,

consequently, it could be defined even though some of its parameters

(the call-by-name ones) are not.

These two approaches have created a number of problems con-

cerning terminology, especially the terms 'call-by-name' and 'call-by-

value', and results. In $ ~ 3 they will be returned to following a

discussion of Kleene's First Recursion Theorem.

d. Definitional Reductions to Ultimate, Definientia.

To this point it has been stated what it means for an expres-

sion to have an ultimate definiens, but no general method for obtaining

such a definiens has been given.

The main problem that arises in this endeavor concern simpli-

fications (with respect to the operations present in S , i.e., the

basic operations) of the definitia which are essential to the course

Page 88: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

78.

of the (definitional) reduction. The most important case is probably

that in which S contains branching functions. For instance if a

replaceable component of a definiendum is in a branch that can be shown

(by evaluations involving the operations of S) not to be used then a

replacement there is not necessary to the reduction to an ultimate

definiens. Consider the following expressions, assuming the 'if --- then --- else ---' function is in S , where 'true', 'false', 'A',

A , A , A are in S and 'X', 'XIt, 'X2' are in T . The

expressions

If true then A else X

If false then X else A

If A. then A else A2 1

should all be considered at most one step from ultimate definientia

since the first and second simplify (due to properties of S) to A

while the third is already an expression in S . The expression

If A then X else Y

would be alright if it could be reduced to any of the above three,

yet to choose any one of A, X, or Y to concentrate on would be a

mistake since its evaluation might continue indefinitely while an

evaluation of the other two might lead to an acceptable form. In such

a case some technique such as dovetailing or parallel evaluation seems

to be called for.

Since in most cases of interest the evaluation of an expres-

sion consists of all possible reductions in both the extended system

and the basic system (that is, the result 'if A. then A1 else A2

Page 89: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

and perhaps even 'A' above would probably not be considered as "values"

as they could be further reduced in So), this is all that will be

said of this problem here. Later considerations in this chapter will

involve this question to a certain extent, especially when all of the

operations of a system are considered new simultaneously.

2. Evaluation Procedures: The Algorithmic Approach to Recursive Definitions.

This section deals explicity with functions defined by axioms

of the form (3)' of sib, that is, functions having exclusively call-by-

name parameter positions. Since, as was noted above, the call-by-value

parameters of a function must be evaluated before the closure of the

function can be evaluated, the results apply to functions of the more

where the 'i

are basic obs and the Xi are new obs, under the

assumption that in the evaluation of a closure of f the parameters

in the places of the Yi are evaluated in a preliminary step.

This section consists mainly of an examination of the various

evaluation techniques for functions with call-by-name parameter posi-

tions, that is, of the form

f(X1,-,X n ) + (F(f))(X1,...,X n ( 4

where X1, ..., X range over new obs and F is a continuous functional. n

In the discussions involving the evaluation of the closure of a parti-

cular function f (as given by (4)) attention is restricted to f

and all other involved functions are considered to be well known.

Page 90: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

That is, for any function g and for any argument (list of arguments)

which contains no occurrences of f in a call-by-value position.

the value of that closure of g is known or it is known to be unde-

55 fined. All functions other than f are referred to as basic .

Early in the study of this type of definition it was noted

that the evaluation of these functions was not as simple as in the

case of functions with call-by-value parameters and sets of rules

directing these evaluations were set up. For instancgMcCarthy (in

- [BMT]) suggested that a function f defined by (4) at an argument a

should be evaluated as follows:

1. If (F(f)) (a) is of the form

if bl then b2 else b3

then b should be evaluated. If it takes the value 'true', 1 b2

should be evaluated, and if bl takes the value 'false', bg should

be evaluated

2. If (F(f))(e) is of the form g(bl, ..., b ) where m

g is a basic function, the bi are evaluated and g is applied to

the results.

3. If f (6) occurs, it is evaluated from the defining equation (4) .

4. All subexpressions of (F(f)) (a) are evaluated

according to these rules.

55 Note that such things as simultaneous recursions will not be considered under this approach, however, no fundamental differences would appear if they were. Since the system is strong enough as it stands to define all the partial recursive functions (given a few basic functions) this is not an important omission.

Page 91: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

This procedure has a number of drawbacks; the two most

important are that it is not precise enough in specifying the order in

which the evaluation should proceed and it only allows call-by-value

parameter places in the basic functions (or at least evaluates them

as if they had call-by-value parameters exclusively). The possible

ways to remedy this situation are the topics of this section.

In general, any method for evaluating a function56 defined

by ( 4 ) , such as McCarthy's above, is called an evaluation procedure.

An evaluation procedure is simply a set of rules that

produces a sequence of results that are closely related to the

sequence of results in a definitional reduction; the primary differ-

ence is that here the base functions are simplified along the way

(and the end result, if it exists, is a value in the sense of the

most basic underlying system). The goal is not only to remove all

occurrences of the new function from the definiens but also simplify

all the basic functions which appear.

Each main step in this sequence of results can be thought

of as consisting of two parts. The first is a substitution in which

one or more occurrences of f (b) are replaced by (~(f)) (b) and the

second part is a simplification in which various parts of the expres-

sion which can be simplified (i.e. the closures of basic functions

that don't have call-by-value parameters containing f) are simplified.

56 Note that one actually evaluates a function at an argument or the closure of a function, however, this phrase will be used synonymously.

Page 92: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

An evaluation sequence is a finite or infinite sequence of expressions

E in which E is f ( a ) and E ~ + ~ 0

is obtained from E by i

first a substitution step and then a simplification step. An evalua-

tion is said to terminate if it gives rise to a finite evaluation

sequence in which the last expression of the sequence contains no

occurrence of the function letter f . Consider the evaluation of 2! , that is, the evaluation of

f(2) , where f is defined by

f(x) +- if x = 0 then 1 else x-f(x-1) . The evaluation sequence is formed as follows:

E is f(2) which is replaced by 0

if 2 = 0 then 1 else 2*f(2-1) Substitution

if 'false' then 1 else 2*f(2-1) I Simplification 2. f (2-1)

E is 2. f (1) which is replaced by 1

2*(if 1 = 0 then 1 else lof(l-1)) Substitution

E is 2 - 1.f (0) which is replaced by 3

2*1.(if 0 = 0 then 1 else O0f(0-1)) Substitution

2-1*(if 'true' then 1 else Oaf(0-1)) 1 i Simplification

Page 93: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

E is 2 which does not contain any occurrences of f . 4

An evaluation procedure is then simply a collection of two

rules. There is a substitution rule that specifies exactly the parti-

cular occurrences of f in an expression which are to be replaced by

F(f). And there is a simplification rule which specifies the parti-

cular parts of the expression that are to be specified. In the above

example, since in every E there was only one occurrence of f , i

the substitution rule was not of particular importance. In more

complex functions, however, there may be several occurrences of f

in an expression in which case the choice of a substitution rule

becomes nontrivial. The next section deals specifically with different

forms of substitution rules.

In the above example the simplification rule was such that

every base function that could be simplified was, and for the purposes

of this chapter such a simplification rule would suffice. It should

be noted though that this type of simplification rule is not the most

efficient. In particular, since parameters in call-by-name positions

may be cancelled their evaluation may be unnecessary and therefore

inefficient. On the other hand a parameter may be spread throughout

an expression (that is, repeated several times) when the principal

function is evaluated and in this case it would be more efficient to

evaluate it first. As a general rule the simplifications that must be

made are those upon which the course of the evaluation depends, This

rule is rather vague and depends strongly on the substitution rule

that is chosen. Consider for example the expression

Page 94: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

f(g(f(a>)) ,

where g is a basic function,of one call-by-name parameter,which is

defined to be identically '0', then if the substitution rule calls

for replacing the innermost occurrence of f , the simplification of

g(f(a)) is important as it makes the leftmost f the innermost.

Now if the substitution rule calls for replacing the outermost

occurrence of f , then the evaluation of g would not affect the

choice of f's and in the case that f cancelled its argument

the evaluation of g would be inefficient.

For the remainder of this chapter, since it is the substitu-

tion rule that is of real interest, the simplification rule will be

considered to specify all possible simplifications of basic functions.

a. Substitution Rules

Substitution rules were studied primarily by McCarthy and

Manna (see McCarthy [BMT], Manna and McCarthy [PPP], and Manna

[MTC], [MTP]). Much of the notation and terminology of this subsection

can be found in the above book and papers.

As was mentioned, often in an expression arising in the

evaluation of a function f , there are two or more occurrences of f . When this is the case there are a number of different substitutions

that can be made. In order that a substitution rule be useful, it

should unambiguously specify a nonempty set of these occurrences.

Some of the common substitution rules are:

Page 95: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

1. The Outermost Rule, in which all occurrences of

f which do not occur in an argument of another

f are replaced by F(f).

2. The Leftmost Rule, in which the leftmost occurrence

of f is replaced by F(f).

3. The Innermost Rule, in which all occurrences of

f whose arguments contain no f's are replaced

by F(f).

4. The Leftmost-Innermost Rule, in which the leftmost

occurrence of f whose arguments contain no f's

are replaced by F(f).

5. The Full Rule, in which all occurrences of f

are replaced by F(f) . The following example illustrates these strategies; the

arrows indicate the f's to be replaced by F(f):

1. Outermost

2. Leftmost

3. Innermost

4. Leftmost-Innermost

5. Full

The leftmost and outermost rules are sometimes referred to

as call-by-name substitution rules, since the arguments are evaluated

after the function, while the innermost and leftmost-innermost are

referred to as call-by-value rules since the arguments are evaluated

first. Note that this has nothing to do with whether the parameters

Page 96: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

are in call-by-name or call-by-value positions; they all are, in fact,

in call-by-name positions. It is just the similarity to the usual

evaluation methods for those two types of parameters that prompts the

names.

An algorithmic explanation of a recursive definition of the

form (4) is that, given an evaluation procedure,

the function determined by the definition (4) is the function whose value at a given argument is obtained from (4) by using the evaluation procedure.

It is clear that there may be more than one function determined by a

definition of the form (4): there may be one for each substitution

rule. The functions determined by the five strategies above will be

denoted by fo, fL, fI, fLI, and fF , respectively. In the case that

the particular rule is not important but only the fact that the function

is determined algorthmically it will be denotedby f (for algorithmic). A

Example. Consider the definition

f(x,y) 4- if x = 0 then 1 else f(x-1, f(x,y)) . For integer arguments j and k the functions fL and fo are

evaluated as follows (again the arrows 'f' indicate the replaceable f's):

f(j,k) + if j = 0 then 1 else f(j-1, f(j,k)) f

+ f (j-1, f(j,k)) f

+ if j-1 = 0 then 1 else f((j-1)-1, f(j-1, f (j,k))) i + f (j-2, f(j-1, f(j,k))) f . . .

+ if j-j = 0 then 1 else f ((j-j)-1,. . . ,f (j,k). . .)

j +l steps

Page 97: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

So f L and fo are found to be

The functions f I and LI

are evaluated at (j ,k) as follows (the

substitution and simplification combined into one step):

It is clear that the only time this evaluation terminates is when j = 0,

so the functions fI and fLI are given by:

fI(x,y) + if x = 0 then 1 else w

fLI(x,y) + if x = 0 then 1 else w .

The function f F is evaluated at (j,k) as follows:

So f F can be defined by

Page 98: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

For t h i s example then , t h e va r ious f u n c t i o n s a r e r e l a t e d by

I n o rde r t o i n v e s t i g a t e f u r t h e r t h e r e l a t i o n s h i p s between these

func t ions a s p e c i a l diagram is developed. Suppose one has a r e c u r s i v e

d e f i n i t i o n of t h e form (4 ) i n which (F ( f ) ) ( 2 ) c o n t a i n s two occur rences

of f . Let t h e s e two occur rences be denoted by t h e occur rences of f

i n t h e n o t a t i o n F ( f , f ) . I n an eva lua t ion sequence i f one pays a t t e n -

t i o n t o on ly t h e s u b s t i t u t i o n s , t h e s u b s t i t u t i o n s may form a sequence

such a s

f , F ( f , f ) , F(F(f , f ) , f ) , F(F(F(f , f ) , f ) , f ) , . . . This p a r t i c u l a r sequence was t h a t of f L

i n t h e above example, i f t h e

f i r s t and second occur rences of f i n F ( f , f ) correspond t o t h e f i r s t

and second occur rences of f i n ( F ( f ) ) ( x , y ) , r e s p e c t i v e l y .

A l l p o s s i b l e s u b s t i t u t i o n sequences a r e r ep re sen t ed i n t h e

5 8 diagram below, c a l l e d a s u b s t i t u t i o n diagram .

57 The express ion f c g is taken t o mean t h a t f 5 g but f # g .

58 This diagram is f o r t h e ca se t h a t ( ~ ( f ) ) (;) con ta in s two occur- rences of f . I t can be genera l ized i n t h e obvious way t o c a s e s i n which (F ( f ) ) (R) con ta in s any number of occur rences of f . The diagram is c a l l e d a 'computation diagram' i n Manna [MTC].

Page 99: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

A sequence ( f i n i t e o r i n f i n i t e ) from t h i s c h a r t , i s c a l l e d a

s u b s t i t u t i o n sequence, i s denoted by {o i ( f ) } . I n t h e above example

o,(f) = f , = F ( f , f ) , o , ( f ) = F ( F ( f , f ) , f ) , = F ( F ( F ( f , f ) , f ) , f ) ,

e t c .

Page 100: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Note that since a substitution sequence itself provides no

information involving simplifications and that the order of the f's

in a (f) may not be the same as in (~(f)) ( 2 ) , it is not possible 1

to tell what type of substitution rule is being used in an evaluation

if one is given only a substitution sequence without this additional

informat ion.

Since the substitution diagram contains every possible

sequence of substitutions, each evaluation sequence corresponds to a

substitution sequence. In particular, if E . is an evaluation 1

sequence, there is a substitution sequence (a. (f) 1 , such that in 1

each sequence exactly the same f's are substiuted for at each step,

and at each step i , the result of simplifying the basic functions in

(ai(f))(Z) wherever possible, is ci , or in other words

E = (oi(f)) (a) . Furthermore, i -

Consider the case that the evaluation sequence { E ~ } termi-

nates in a value b , that is, for some n , E = b . This is the case n

whenever in an evaluation an expression is reached that contains no

occurrence of f and is defined. If {ai(•’)) is the corresponding

substitution sequence, it must terminate in an expression an(•’)

which when evaluated (simplified) at the point a yields b, that is

(an(f))(5) is an expression in which all of the occurrences of f

are in the call-by-name parameter positions of basic functions which

cancel these parameters. Since this is the case,the sequence

Page 101: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

( ~ ~ ( $ 1 ) where Q is the everywhere undefined function, is seen to

Furthermore by the monotonicity of F , the sequence {ai(&?)} is a

chain and therefore has a least upper bound, yielding the result that

Example. Consider the evaluation, by the outermost rule, of f(2,O)

where

f(x,y) + if x = 0 then 1 else f(x-l,f(x,y)) . Let the right hand side be abbreviated as above by (F(f,f))(x,y)

(i.e., (F(f,g))(x,y) if x = 0 then 1 else f(x-l,g(x,y))). Now the

evaluation sequence { E ~ } is as follows:

The substitution sequence {a. (f) is 1

ao(f) is f

al(f) is F(f,f)

u2(f) is F(F(f,f),f)

a3(f) is F(F(F(f , f ) , f ) ,f)

as follows:

59 The i-th element of this sequence is often referred to as the i-th approximation to the function (being defined).

Page 102: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Now, in particular (03(f)) (2,O) is

if 2 = 0 then 1 else

if 2-1 = 0 then 1 else

if (2-1)-1 = 0 then 1 else

f(((2-1)-1), f((2-11-1, f(2-1, f(2,0)))),

which contains occurrences of f only in a branch that is not chosen

and is (strongly) equal to (o3(C2))(2,O) or

if 2 = 0 then 1 else

if 2-1 = 0 then 1 else

if (2-1)-1 = 0 then 1 else w . The f unc t ions fo, fL, fI, fLI and f, can be seen, by

their definitions and the monotonicity of F to be related in the

following way:

f C f Cf, L - 0 -

and

fL1 5 f, 5 f, .

The example above of the evaluation of f(j,k) where

f(x,y) +- if x = 0 then 1 else f(x-1, f(x,y)),

showed that sometimes the relation between fL and fI is one of

proper inclusion (i.e., fI c fL).

The example

f(x) 4 if x = 0 then 0 else g(f(x+l), f(x-l)),

where g(x,y) is 'strong multiplication' defined by

60 g(x,y) + if x = 0 or y = 0 then 0 else xoy ,

6o Note that g(0,w) = g(w.0) = 0 but if a # 0 then g(a,w) % g(w,a) 2 U .

Page 103: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

show that the following can sometimes hold:

fL C f 0

fL C f I

I *

Certainly there are many cases for which

same (in particular, for any definition

all these functions

in which there is on

occurrence of f on the right hand side, since then all the

are the

ly one

rules

agree). The only relationship which has not been shown to be sometimes

proper is fg L fF . It turns out that in fact fo = fF , but this

fact will be easier to show after the introduction of some new concepts

in $ 3 ~ .

b. McCarthy's Label Operator

Sometimes evaluation methods are used in which the distinction

between the two parts, substitution and simplification, is not clearly

indicated. This is often the result of the introduction of a special

operator which when evaluated performs a substitution. Two of the

earliest attempts to specify evaluation procedures for recursive

definitions in a precise way were of this sort and are due to McCarthy

and Landin. McCarthy's approach appeared in 1960 in his [RFS] and in

greater detail in 1961 in his [BMT]. Landin's approach appeared first

in his [MEE] in 1963.

Both McCarthy and Landin employed A-notation to abstract from

the argument variables in the defining expression, so (4) is rewritten

f + Ax. (F(f)) (3, (5)

Page 104: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

o r i n t h e c a s e of t h i s n o t a t i o n

f + ( F ( f ) ) . ( 5 ) '

McCarthy t h e n no ted t h a t w h i l e t h i s n o t a t i o n s u g g e s t s t h a t

XZ.(F(f) ) (G) could be t aken a s t h e f u n c t i o n f , t h e obv ious

problem a r i s e s t h a t i t i s n o t c l e a r i n t h i s approach t h a t t h e

o c c u r r e n c e o f f i n A%.(F( f ) ) (Z) s t a n d s i t s e l f f o r t h e whole o f

t h e e x p r e s s i o n . I n o r d e r t o remedy t h i s problem McCarthy i n t r o d u c e d

a s p e c i a l o p e r a t o r c a l l e d t h e l a b e l o p e r a t o r which i n many ways is

s i m i l a r t o t h e A o p e r a t o r o f t h e A-calculus . Using t h i s o p e r a t o r

a f u n c t i o n d e f i n e d by (5) is t a k e n t o b e

l a b e l ( f , A%. ( F ( f ) ) ( Z ) ) ,

and i n t h i s way t h e f i s i n d i c a t e d t o s t a n d f o r t h e whole of t h e

r i g h t hand s i d e of ( 5 ) . I n t h i s e x p r e s s i o n , i t shou ld be no ted t h a t

f i s bound and i n f a c t cou ld be changed s y s t e m a t i c a l l y t o any o t h e r

f u n c t i o n l e t t e r wi thou t a f f e c t i n g t h e d e f i n e d f u n c t i o n . T h i s i s , of

c o u r s e , t h e u s u a l u n d e r s t a n d i n g of r e c u r s i v e f u n c t i o n d e f i n i t i o n s . With

t h i s n o t a t i o n t h e f o l l o w i n g ' r e d u c t i o n r u l e ' is a s s o c i a t e d :

l a b e l ( f , AS. (F( f ) ) (2) ) (a) +-

[ l a b e l ( f , A x . ( ~ ( f ) ) ( % ) ) I f ] (Ax. ( F ( f ) ) ( 5 ) ) (2) . A s an i l l u s t r a t i o n c o n s i d e r t h e e v a l u a t i o n o f t h e f u n c t i o n

d e f i n e d by

f ( E ) +- i f x = 0 t h e n 1 e l s e f ( x l - l , f ( x l , x 2 ) ) , 1

where 2 = (xl , x2) , a t t h e argument ( 2 , O ) . For s i m p l i c i t y l e t

F ( f ) 5 A f . i f x = 0 t h e n 1 e l s e f ( x l - l , f ( x x ) ) . 1 1' 2

Page 105: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Then the evaluation proceeds as follows:

f(2,O) label (f,F(f))(2,0)

+ [label (f ,F(f))/fl ((F(f)) (2,011

. . . +- [label(f ,F(f>)/fl (f(0,f (1,f (l,f(2,0)))))

+ [label(f,F(f>)/fl ((F(f 1) (0, (F(f)) (1,

(F(f>) (1, (F(f>) (2,O)))))

+ [label(f,F(f))/f] 1

+ I .

Due to the simplification made in the sixth step (and made implicitly in

the eighth) the evaluation followed a full substitution rule. This

approach is certainly not the only possibility. In particular if, when-

ever the label operator is evaluated (for example, the step from line

one to line two or line four to line five), it is required that before

the substitution is made, the right hand part of the expression (that

is, ((F()(2,0)) in the case of line two) is simplified as much as

possible, then the evaluation is closely related to one which follows

an innermost substitution rule. If for instance in lines two, five

Page 106: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

and eight the substitution is made before the simplification then the

order in which the substitutions are made and the course of the subse-

quent simplification would affect the type of substitution rule to which

this is related.

McCarthy noted in [BMT] that if one allowed functions that

were capable of taking themselves as arguments the label operator could

be replaced. Suppose oncl llos a definition of the form

f ( i ) ( F ( f ) ) ( ? ) (4).

For the purposes here suppose juxtaposition denotes functional applica-

tion and that parentheses are omitted in an association to the left

fashion. For example, the definition (4) could be written

fj? 4 Ffx . Now if the definition

F* E X~.A~LF(X~.~~:)~

is made, the function given by (4) can be represented by

F*F* ,

(that is, f? sF*F*Z if f is the function determined by (4)).

Consider the evaluation of the function of the above example at the

argument Z = (2,O). Again, let

F(f) G Ax. if x = 0 then 1 else f(x -l,f(x x ) ) . 1 1 1' 2

Further let G E AG.F*F*u , then

Gs 2 F*F*s and

F*F*% 2 F(XU. ~*~*ii); = F G Z .

Page 107: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

So,

f (2,O) 4- F*F*(2,0)

r F G (2,O)

1 if 2 = 0 then 1 else G(2-1,G(2,0))

+ G(l,G(2*0))

2 F*F*(l,F*F*(2,0))

2 F G (l,F G (2,O))

2 if 1 = 0 then 1 else G(l-l,G(l,

if 2 = 0 then 1 else G(2-1,G(2,0)))

+ G(O,G(l,G(l,G(2,0))))

2 F*F*(O,F*F*(l,F*F*(l,F*F*(2,0))))

Z F G (0,F G (l,F G (1,F G (2,O))))

2 if 0 = 0 then 1 else G(0-l,G(O,

if 1 = 0 then 1 else G(1-l,G(l,

if 1 = 0 then 1 else G(l-l,G(l,

if 2 = 0 then 1 else G(2-l,G(2,0))))))))

+ l .

This evaluation followed a full substitution rule, but as

with the label operator such a procedure was not necessary. In the

fifth line, if one chose to evaluate only the first F* then the

evaluation would be basically one following a leftmost or outermost

rule, while evaluating only the third F* is equivalent to an inner-

most or leftmost-innermost substitution procedure.

Page 108: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

McCarthy argued that this approach replaced his label operator

at an "excessive cost" due to both the complexity of the form of the

function being defined and the need to postulate the existence of

functions capable of taking themselves as arguments. It is true that

the expression chosen for the function is rather complex: with no

abbreviations except for conventions regarding parentheses f% is

(Xg.Ay.F(XG.ggu)~)(Xg.A~.~(&.~~~)j;)x . However, with two q-reductions it becomes

(Xg. F(gg> > (k. F(gg) )x which is much simpler. Further simplifications can be made but rather

than deal with them here, it is more informative to consider an approach

that uses combinators initially and subsequently produces much simpler

results directly.

c. Landin's Fixed Point Operator

Landin (in [MEE]), like McCarthy, employed A-notation to

abstract from the parameter list in the defining expression

f(2) + (F(f))(Z) ( 4 )

to obtain

f + Ax. (~(f)) (Z) . (5)

(Again the parentheses will be removed as above so that Ax.(F(f))(Z)

is written as hZ.FfZ .) Now at this step, rather than introducing

something like the label operator, Landin noticed that we could abstract

further, this time with respect to the function letter f , to give

f + (~f.~Z.~fx)f . ( 6 )

Page 109: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Note t h a t t h e occurrence of f i n ~ f x is bound and thus t h e whole

r i g h t s i d e can be rep laced by (Ag.AZ.FgE)f without caus ing any funda-

mental change i n t h e d e f i n i t i o n . I n ( 6 ) , when viewed a s t h e equat ion

f = (Af.AG.FfG)f ,

f appears e x p l i c i t l y a s a f i x e d po in t of t h e f u n c t i o n a l

- 61 (Xf . Ax. Ffx) .

Now, i f t h e r e is a func t ion , Y , which f i n d s f i xed p o i n t s of f u n c t i o n a l s ,

then t h e func t ion def ined by (4 ) can be expressed by

There a r e a number of func t ions which do have t h i s f i xed po in t f i n d i n g

proper ty . I n p a r t i c u l a r t h e r e a r e a number of combinators and

A-expressions t h a t w i l l s e r v e t h i s purpose. They a r e gene ra l l y denoted

by t h e l e t t e r ' Y ' , and have t h e p rope r ty

t h a t is, f o r any f u n c t i o n a l F , (YF) is a f i x e d po in t of F .

6 1 By two v-cont rac t ions t h i s becomes F , however t h i s longer form i s used he re s i n c e i n a c t u a l examples t h e express ion he re abbrevi- a t e d by F i t is r a r e l y of a form t h a t a l l ows rpcon t r ac t i ons . The l e t t e r ' F ' , however, w i l l o f t e n be taken a s an abb rev i a t i on f o r t h e longer express ion ' h f . A % . ~ f x ' .

62 This is not e n t i r e l y p r e c i s e a s w i l l be seen i n s 3 . There i t w i l l be noted t h a t Y should f i n d t h e minimal (with r e spec t t o c _ ) f i xed poin t .

6 3 For combinators ' = I i s weak c o n v e r t i b i l i t y o r '= '

0 and f o r

A-expressions '= ' i s $ - c o n v e r t i b i l i t y o r '= ' B '

Page 110: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

R e t u r n i n g t o McCarthy's approach , t h e s i m p l i f i e d form of his

replacement f o r t h e l a b e l o p e r a t o r ,

can b e w r i t t e n

Now, i f one d e f i n e s

which r e q u i r e s a n expans ion t o show t h a t t h i s Y s a t i s f i e s ( 7 ) . Another p o s s i b i l i t y which s a t i s f i e s ( 7 ) is t h e more complex A-expression

I n t h i s c a s e

s o YF ;, F(YF) d i r e c t l y w i t h o u t r e q u i r i n g any e x p a n s i o n s t o o b t a i n ( 7 ) .

S i n c e such f u n c t i o n s a r e a v a i l a b l e t h e f i x e d p o i n t f i n d e r s used below

w i l l a lways be c o n s i d e r e d t o have t h e r e d u c t i o n r u l e

64 A combinatory form o f t h i s Y is S(SB(K(SII)))(SB(K(SII))), which is o b t a i n e d by u s i n g t h e a l g o r i t h m ( a b c f ) . A s i m p l e r form is B(SWW)B. T h i s p a r t i c u l a r Y is c a l l e d Yo .

65 A combinatory form of t h i s Y found u s i n g t h e a l g o r i t h m ( a b c f ) i s B(S1) ( S I I ) (B(S1) (SIX)) and a s i m p l e r form is W I (B(S1) (WI)) . This p a r t i c u l a r Y i s c a l l e d Y1 and is r e l a t e d t o Yo by Y1 =I YO(SI) f o r combina to r s and Y1 =B Yo(Ax.Ay.y(xy)) f o r

A-expressions.

Page 111: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Consider again the evaluation of f(2,0), where

f(x) + if x = 0 then 1 else f(x -l,f(x x ) ) . 1 1 1' 2

Let F 5 Af.hx. if xl = 0 then 1 else f(xl-l,f(xl,x2)) ,

then the evaluation proceeds as follows:

f (2,O) + (YF)(2,0)

:* F(YF)(2,0)

2 if 2 = 0 then 1 else (YF) (2-1, (YF) (2,O))

+ (YF) (1, (YF) (2,O)

' F(YF)(l,(YF)(2,0))

if 1 = 0 then 1 else (YF) (1-1, (YF) (1, (YF) (2,O))) - (YF) (0, (YF) (1, (YF) (2 ,O) ) )

2 F(YF) (0, (YF) (1, (YF) (2 ,O)))

2 if 0 = 0 then 1 else (YF) (0-1,. . .)

Since, in the fourth and seventh lines, only the leftmost occurrence of

(YF) was reduced, this evaluation followed a course equivalent to one

using a leftmost substitution rule. In those steps, however, other

occurrences of (YF) may have also been chosen to give evaluations

related to the other substitution rules. The standardization theorem

for the A-calculuses and for weak combinatory reduction guarantees that

a reduction in which only the leftmost redex is contracted at each step

will terminate if any reduction will, however the presence of other

base functions which are not part of these systems, and in particular

non-naturally extended monotonic functions, make it possible to find

cases in which the leftmost reduction fails while others (namely,

Page 112: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

1 0 2 .

more substitutive ones) succeed. (For example, see the example towards

the end of :;a that showed fL ( fo .) Notice that in this approach

if one attempts to reduce the (YF) in an innermost manner the

evaluation will never terminate since

(YF) (2,O) 2 F(YF) (2,O)

F(F(YF)) (2,O)

" F(F(F(YF) 1) (2,O)

. . . )

so in the steps that are only concerned with reductions (combinatory

or B-) a leftmost strategy guarantees the best possible results.

Landin's actual approach differed slightly from the above in

that, while he obviously chose the name Y for his fixed point finder

because of its properties as a combinator, he treated the function Y

strictly as a basic function that automatically found a fixed point.

As such, evidently the above evaluation would go

f(2,O) +- (YF)(2,0)

+ 1 .

In Landin's approach A-notation was used at first to obtain

f +- Aji.Ffj;

and

f +(~f.~;.~f;)f . The reason that instead combinators aren't used to obtain

f +([f]. [x].~fx)f

is that even for relatively simple F's once the abstraction had been

carried out the right hand side would generally be extremely lengthy and

complex.

Page 113: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

3. Recursively Defined Functions as

- Least Fixed -- Points of Functionals

In the last section a function fA

was assigned to a recursive

definition (as the function it defines) by means of specifying a deter-

ministic evaluation algorithm for the definition. This understanding

of a recursive definition is called an algorithmic explanation. Quite

often in mathematics and traditionally in computing such an approach is

used; when a formalism is given, some method, usually similar to the

above evaluation procedures, is also included in order to interpret

the new expressions.

The question arises as to whether all the information available

in a recursive definition is obtained by the associated evaluation

mechanism or is there perhaps some property inherent to the mechanism

that causes it to deliver undefined resu

or blocked evaluations) when a different

yield the desired result. For instance,

of the evaluation of f(2,0), where f(

ts (that is, result in unending

method of evaluation could

in the above ($$2b,c) examples

) + if x = 0 then 1 else 1

f(xl-l,f(xl,x2)), it was noted that a call-by-value (innermost) substi-

tuition strategy would give a nonterminating evaluation while a

call-by-name (leftmost or outermost) produced the desired result.

In this section again a recursive definition is considered to

be of the form

f ( G ) + (F(f))(F) , (1)

where F is a continuous functional. However, the function defined

by (1) will now be taken to be the least fixed point of the functional

F , whose existence is guaranteed by Kleene's fixed point theorem of S A ~ .

Page 114: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

This approach is closely related to what is called the semantic

explanation of recursive definitions and a discussion of this relation-

ship makes up $a. This is followed by a discussion of fixed point

theorems and, a study of the relationships between the algorithmically

obtained functions and the least fixed point (Sb), and finally a number

of observations concerning ~leene's first recursion theorem and some

recent developments (•˜$c and d).

a. Least Fixed Points and the Semantic Explanation

It was noted that the algorithmic approach essentially assigned

a function to a recursive definition by associating a deterministic

evaluation procedure with the definition. Here another somewhat more

general approach, called the semantic explanat ion66 of recursive def ini-

tions, is considered.

Consider a recursive definition of the form

An interpretation, J , of a recursive definition is a mapping from

function letters into functions (monotonic total functions over domains

extended with w , the undefined element) and from functional letters

into continuous functionals. Thus, J(f) , denoted by fJ , is a

function in [A+B] for some extended domains A and B . The

function fJ is referred to as the principal function. An interpreta-

tion J is said to solve the recursive definition (1) if it makes

66 The terms 'algorithmic explanat ion ' and 'semantic explanat ion' are found in Rosen [TMS] with a slight difference in meaning.

Page 115: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

105 .

- a true statement for every x in A . Note that generally (F(f))(x)

stands for the composition of basic function letters, f , and the -

parameters x , and as such by F~

will be understood the functional

that is explicitly defined in terms of the composition of monotonic

basic functions which are the interpretants of the basic function

- letters, the function letter f , and the parameters x . The func-

tional defined in such a way is necessarily continuous as was shown

in $ ~ 3 .

The function f, in the case of an interpretation J that

solves (1) is called a fixed point of F since

A solution J , for which given any other

agrees with fJl wherever f~

is defined (i.e.,

called a canonical solution. Now while there can

canonical solution (evidently two interpretations

disagree on the interpretants of function letters

solution J' , f~

be more than one

could certainly

not occurring in the

definition (4) and even in certain cases on function letters which do

occur and still be canonical solutions) the principal function (fJ)

determined by each of these must be the same. This follows immediately

since if J and J' are canonical solutions then fJ and fJ1 are

extended by the principal functions of every other solution, and in

particular by each other. Thus fJ 5 fJ, and fJl 2 fJ , hence

- fJ - 'J'

67 The extensionality result 'if f (Z) r g(f), then f = g ' is shown as follows: f(2) ? g(2) implies f(f) 5 g(Z) and g(Z) 5 f(G) , for all Z, in other words f 2 g and g c f , hence f = g .

Page 116: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

The function fJ of a canonical solution J can thus be characterized

as being the least (with respect to the partial ordering L on

[A+B]) fixed point of the functional F . The semantic explanation of recursive definitions is that the

function determined by the definition (1) is the principal function of

a canonical solution of (I), if one exists. The fixed point explanation

is that the function determined by (1) is the least fixed point, if it

exists, of the functional F . As noted above the function given by

the semantic explanation is the same as that given by the fixed point

explanation. This function, when it exists, will be denoted by s ( S for semantic) or by f J if there is specific interest in the inter-

pretation J . Unlike the algorithmic approach, the semantic explanation does

not provide a deterministic process that produces a function, but

rather characterizes the function in a nonconstructive manner. While

there was never any question that the algorithmically determined

functions fL, fF, f I , etc. existed, the existence of the least fixed

point of a functional or the existence of a canonical solution requires

a formal proof. The existence of the least fixed point of a (monotonic)

functional can be deduced from the following theorem of Knaster and

Tarski.

Fixed Point Theorem (Downwards) (Knaster, Tarski)

If F is a monotonic functional from [A+B] to [A+B], then F

has a least fixed point, fS , in [A-+B]~~ This fixed point is the

ill

greatest lower bound (glb) of the set {f l ~ ( f ) = f 1 . 6 8

Vote that this theorem holds only if [A+B] is a complete lattice, which requires the addition of a top element that extends every other element and is thus not a function. Therefore, if the only restriction on the functionals is that they be monotonic, then

Page 117: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

The usua l proof i s of t h e more gene ra l r e s u l t t h a t f o r

Proof . S t ep 1. gS i f S , s i n c e {f / ~ ( f ) 5 f ) con ta in s {f [ ~ ( f ) = f )

S tep 2 . To show fS i gS i t i s s u f f i c i e n t t o show t h a t gS

- is a f i xed p o i n t of F , i . e . , FgS - gS . a . To show Fg i gS , suppose F ( f ) i f , then gS 5 f by

d e f i n i t i o n of gS , then F(g ) c F ( f ) by monotonici ty of F , but S -

F ( f ) 5 f , s o F(gS) 5 f . Since t h i s ho lds f o r every f i n

{ f 1 ~ ( f ) 5 f ) i t fo l lows t h a t F(gS) g lb{f 1 ~ ( f ) 5 f 1 = gS . b. To show gS 5 F(gS) ; from above F(gS) 5 gS , thus

F(F(gS)) 5 F(gS) by monotonici ty of F , but gS is minimal wi th t h i s

p roper ty by d e f i n i t i o n so gs C- F(gS)

I t is informat ive t o cons ider he re t h e f i xed po in t theorem

(upwards) of $A , which can now be s t a t e d a s fol lows.

Fixed Poin t Theorem (Upwards) (Kleene)

I f F is a cont inuous f u n c t i o n a l on [A-+B], then F has a

l e a s t f i xed p o i n t , f S , which can be c h a r a c t e r i z e d by f s = l u b { f i l ,

where 0

= R and fi+l = F ( f i ) . The usua l proof is a s fol lows: l e t F be cont inuous and con-

s i d e r t h e sequence i f i } . NOW ( i ) f o f t r i v i a l l y and ( i i ) i f i t

is assumed t h a t f f , then f i = F(fi-l) "(fi) = fi+l s i n c e

F is monotonic. Therefore f . is a cha in and has a l e a s t upper 1

bound by t h e l e a s t upper bound theorem i n $A. Let f S = lub{f i )

68(cont ' ) i t is p o s s i b l e t h a t t h e l e a s t f i x e d poin t of a f u n c t i o n a l

is t h i s t o p element and not a func t ion i n [A+B] a t a l l . I n t he case t h a t F is cont inuous, which i s not a s e r i o u s r e s t r i c t i o n i n view of $A3, t h e Fixed Point Theorem (Upwards) guaran tees t h e e x i s t e n c e of a l e a s t f i x e d p o i n t which i s a func t ion , and s o , i n t h i s c a s e , t h e downwards theorem provides another c h a r a c t e r i z a t i o n of t h e l e a s t f i x e d po in t .

Page 118: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Step 1. To show fS is a fixed point of F . P(fS) = F(lub{fi)) = lub{F(fi)} by continuity of

- l ~ b { f ~ + ~ } by definiton of fi+l

= fS

Step 2. To show fS is the least fixed point of F . Let g be a fixed point of F , i.e., F(g) = g , then

(i) fo 5 g trivially and (ii) if fi 5 g then fi+l = F(fi) 2 F(g) I g . So by (i) and (ii) fi L g for every i, and therefore fS = lub{fi] i g .

Note that this characterization of the least fixed point

requires that F be continuous. This, however, does not seem to be an 'All i,*

important restriction since, as noted in $A , functionals defined in the

usual manner, as the composition of monotonic functions and the function

letter f , are conti.nuous. Further there seem to be general grounds

for regarding continuity as a property of functionals essential to the

computability of functions defined in terms of them.

The important difference between the two characterizations of

the least fixed point is that the upwards version is constructive where

the downwards version requires the examination of all (perhaps infinitely

many) of the fixed points before the least can be determined.

The upwards version also provides an evaluation procedure as

follows: for an argument a C A consider the sequence

f (a) 2 Q (a) S I,) 0

f (a) 2 F(f ) (a) 1 0

Page 119: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

now if for some i , f.(a) is defined then f(a) is taken to be that 1

value, fi(a) , (which is common to all fi(a) , where i ' n and n

is the least number for which fn(a) is defined). This process

essentially corresponds to the full substitution procedure of $2a,

(each of these being simplified where possible), which continues until

there are no occurrences of f present. If for some i , fi(a) is

defined then the i-th term of the evaluation sequence,

(F (F( ...( F(f)) ...)))( a), is also defined and has the same value since - i

B 5 f and F is monotonic . This is an important result since it guarantees the existence

of evaluation procedures that yield the same functions as given by the

semantic approach.

b. The Strength of the Algorithmic Approach

In the substitution diagram of $2a the bottom-most sequence is

the one in which at each step substitutions are made for every f . The full substitution rule states that, in an evaluation sequence, at

the substitution step all occurrences of f are replaced. Now, while

the substitution sequence, {a. (f) 1 , that corresponds to a given evalua- 1

tion sequence, {~~(f)}, which follows a full substitution rule is often

not the bottom-most substitution sequence, for a given argument the

corresponding terms of the two sequences are strongly equal. This is

the case since the f's that are not replaced in the terms of

Page 120: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

110.

{a. (f) 1 at various steps are those f's that have been cancelled in 1

prior simplification steps. These same f's, or more precisely the

expressions that have subsequently replaced them, in the terms of the

bottom-most substitution sequence will be similarly cancelled upon

simplification.

The bottom-most sequence will be denoted by {Fi (f) I where

0 i+l i F (f) = f and F (f) = F(F (f)). The notation, {~~(f)}

is not necessary to be precise, will also be taken to stand

substitution sequence of an evaluation sequence following a

substitution rule for the reasons above.

The sequence {Fi(il) 1 is precisely the sequence

in the upwards characterization of the least fixed point of

, when it

for the

full

Ifi} used

F . Since

this is the case one can conclude that fF = fS . This result, however,

is shown in a more precise way below. Now since each term ai(R) of

any substitution sequence other than {Fi(C2) 1 can be substituted further

(that is, certain occurrences of R can be replaced by F(il), p2(R),

etc.) to obtain Fi(R) , the monotonicity of F implies that

oi(R) L Fi(il)

for every i . Thus, the following theorem holds.

Algorithmic Explanation Theorem

Let fA be the function determined by a given evaluation

procedure, then fA 2 f s - This theorem suggests the hierachy of functions:

fLI E fI C fF C fS

Page 121: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

111.

All of the inclusions, with the exceptions of fo 5 fF 5 fS , were

investigated in $2a. Here a sufficient condition for a substitution

rule to produce a function equal to fS is considered.

Suppose the i-th member of an evaluation contains n

occurrences of the function letter f . Let the separate occurrences

be denoted by superscripts and let the notation

indicate the occurrences in E (not necessarily in order). Now as i

1 far as the term E is concerned the function letters f , . . . ,fn i

are simply denoting places where further substitutions might be made

and the 'value' of & remains the same if these f's are each re- i

placed by R . Some of the f's are replaced in subsequent steps of

the evaluation and ultimately one or more of the f's may be replaced

by fS , the least fixed point. Note that being replaced by fS is

the best possible result due to the above theorem.

n The depth of fJ in Ei[fl,. . ,fj,. . .f ] is understood to be

the number of F's , in the term a . ( f ) of the substitution sequence 1

corresponding to , of which fJ is part of an argument. For

instance, if E corresponds to F(F(f,F(f,f)),f) , then the occur- i

rences of f from left to right have depths 2,3,3,1, respectively.

Consider the upwards characterization of the function fs ' - Suppose for some argument a , fS(& it w . This means that there

exists a natural number, n , such that (Fn(R))(a) ?j! w . Note that

every occurrence of R in Fn(n) has depth n . Now if (ci) is an

evaluation sequence which at each step substitutes for at least one f

which has a depth of less than n eventually a term will be reached

Page 122: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

that is the same as fS(& , since at the very worst eventually a term

in which every f has a depth of greater than or equal to n will be

reached which extends (Fn (Q) ) (a) and thus equals f (;) . One can guarantee that at least one f of depth less than

1 n is substituted at each step if it is required that f , . . . ,fJ be

substituted only when

j

1 To show this assume the f , . . . ,f3 each have depths greather than or

equal to n , then all the R in

have depths greater than or equal to n and thus,

Fn (Q) & E [Q, . . . ,Q ,I?" (a) . . . . , Fn (R) 1

But if Fn(Q) 8 w , it is the case that ci[R ,..., Q,fS ,..., fS] 7?? . So under the assumption that F"(Q) $ w , the condition that, for 1 f , . . . ,fj , ci[R,. . . ,R,fs,. . . ,f ] I w implies that at least one of

S 1 the f , . . . ,fJ has a depth less than n .

1 A substitution, for f , . . . , fJ , in which at least one of these f's has a depth less than n or equivalently for which

E~[R, ..., Q,fs, ..., f ] S w is said to be a safe substitution. A rule S

that specifies only safe substiutions is called a safe substitution

rule6', and as noted above such a rule always specifies a function

which is the least fixed point.

69 These terms are found in Manna [MTC] .

Page 123: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Both the full substitution rule and the outermost substitution

rule are safe. This can be seen for the full rule as follows: suppose

the i-th term of the evaluation sequence is of the form

f (---- )

then Ei[Q7...,Q] % W since Q(---) is w . If instead E~ is of the

form

g(f(---), ..., f(---)) where g is a monotonic basic function, then E~[R, ...,Q] % w , because

g(Q(---) , . . . ,Q(---)) % w since if g(w, . . . ,w) were anything but w ,

it would have to be constant over its domain (since it is monotonic)

and as such would have been simplified further before any substitutions

were to take place. The argument for the outermost substitution rule

is exactly the same since the f's indicated above for the full rule

are just those f's that are replaced in the outermost rule also. So

it is the case that fo = f = f and so the hierarchy of functions is F S

The example of 92a that gave the proper inclusions f c f L 0

and fLI c fI contained a non-naturally extended function (namely,

strong multiplication). If it is required that all of the basic

functions (with the exception of the sequential 'if---then---else---')

be naturally extended then fL = fo and fLI = fI . This is the case

since in the naturally extended functions all of the parameter positions

are call-by-value and as such if, for instance, the leftmst rule fails

to produce a value in some argument place so will the outermost rule

Page 124: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

111'.

in that same place and the whole expression will remain undefined. The

only place where there might be difficulties is in the non-naturally

extended 'if---then---else---' function, but since the call-by-value

position of this function (i.e. the conditional clause position) is in

the leftmost parameter position the leftmost rule produces a result

whenever the outermost rule does.

c. Manna, deBakker, and ~leene's First Recursion Theorem

There has been a certain amount of confusion around the area

of the evaluation of recursive definitions especially with respect to

the work of Manna. DeBakker has attempted (in [RP] and [LFP]) to clear

up some of it but in doing so has apparently missed the point of some

of the work. The original confusion stems from some of the terminology

of Manna. He calls a substitution rule which gives a function equal to

fS a fixed point rule, then, for example, the outermost and full sub-

stitution rules are fixed point rules and if basic functions are

restricted to naturally extended functions(excepting 'if---then---else

--- 1 ) so is the leftmost substitution rule. Evidently the innermost

and leftmost-innermost rules are not fixed point rules. He also calls

the leftmost and outermost rules call-by-name substitution rules, and

the innermost and leftmost-innermost rules call-by-value substitutuion

rules. Using this terminology one could then say of the above results

that while call-by-name substitution rules lead to least fixed points,

call-by-value substitution rules do not. Such statements are found

in [MTC], Manna, Ness and Vuillemin [IMP], and Manna and Vuillemin [FAT].

The confusion comes from the fact that Kleenes First Recursion Theorem

Page 125: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

([IMM] $66 Thm. X X V I ) states that in fact recursive definitions of

functions with only call-by-value parameter positions do have canonical

solutions (i.e. when looked at in the form f (x) + (F(f)) (x) ; F has a

least fixed point). This is the result for recursive definitions of the

form of •˜la. Note that in the evaluation of such a function one neces-

sarily has to follow a call-by-value substitution strategy since f(a)

can be evaluated only when the a contain no occurrences of f . i

That is, in the terminology of $la, when the a are obs of S . i

Now in $lb the form of a recursive definition was generalized

so that the closures of the f's did not necessarily have to be re-

placed from the inside out, that is, the function being defined was

allowed to have call-by-name parameter positions. Again the least fixed

point theorems hold for these definitions (this was shown in Rosen [TMS]

and in essence in Scott's work). However, the least fixed points for

the two different forms of recursive definition may not be the same,

In general, the canonical solutions of recursive definitions which allow

call-by-name parameter positions in the principal function extend those

that allow only call-by-value parameter positions. This raises a slight

problem in terms of least fixed points of functionals since one must be

able to incorporate into the functional which parameters of the function

being defined are call-by-value and which are call-by-name.

DeBakker in [FPR] developed a notation for functionals that

brought along this information with the functional and proved the result

that the functional F in the definition

f(Y1,. . . ,Ym,X1 ,... ,X n + (F(f))(Y1,e~O,Ym,X1,OO~,Xn) ,

where Y1, ..., Y are call-by-value parameters and XI, ..., X are m n

Page 126: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

call-by-name parameters, has a least fixed point. And, furthermore, if

F' is the same as F except that one or more of the call-by-value

parameters Y1, ..., Y are allowed to range over T (that is, be m

call-by-name parameters) the least fixed point of F' is the same

as or extends that of F . Now, while deBakker noted that recursive definitions of func-

tions with call-by-value parameter positions (which had to be evaluated

in a call-by-value manner in the call-by-value parameters) had canonical

solutions, he missed the point that Manna was investigating the

various evaluation techniques possible for functions with call-by-name

parameters. In the case of call-by-value parameters there is only one

possible technique and thus nothing to investigate. ~anna's results

were that if one had a recursive definition of a function with

call-by-name parameters, then a full or outermost substitution strategy

(or any safe substitution strategy) would give an evaluation process

that yielded least fixed points while an innermost, leftmost-innermost

or call-by-value substitution strategy need not.

d. Examples

Example 1

Landin (in [MEE]) introduces an abstract machine, called the

SECD machine, which evaluates expressions of a language, called appli-

cative expressions or AE's, based upon Church's A-notation. These

expressions are of three sorts: identifiers (these are considered

to be atomic and include function letters and variables), A-expressions

(functional abstractions of AE's from identifiers), and combinations

Page 127: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

(functional applications of AE's). The SECD machine evaluates recursive

definitions in much the same way as in $ 2 ~ . To begin with, the function

associated with the recursive definition

f(;) 4 if x = 0 then 1 else f(xl-l,f(xl,xg))

is initially represented for evaluation by the machine as

~ h f .A;. if x = 0 then 1 else f (xl-1,f (xl,xt)) . 1

Now the evaluation of combinations in this machine follows a leftmost-

innermost or call-by-value strategy, that is, it evaluates the operand

before the operator. It would appear then that in the evaluation of

f(2,O) one would run into difficulty if the machine evaluated expres-

sions involving Y in the manner of $ 2 ~ (by using a leftmost-innermost

rather than leftmost strategy). However, Landin, for this machine,

considers Y as a primitive function which automatically finds a fixed

point (apparently assumed to be the least fixed point) so this problem

does not arise.

While, in view of this use of Y , the call-by-value approach

is acceptable for evaluating recursive definitions, another problem

arises in the evaluation of constant functions which are not naturally

extended (which are allowed as AE's). In a simplification step a

function g which is constant on A' should be replaced by its

value whether its argument expressions have been evaluated or not.

The following expression is an AE allowable for evaluation by the

SECD machine

(X(X,Y> .Y) ((Xx.xx> (Xx.xx) ,O)

Page 128: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Now whi le a l e f tmos t s t r a t e g y (o r f u l l ) produces t h e va lue 0 , t h e

machine f i r s t e v a l u a t e s (Xx.xx)(Xx.xx) by

(Ax.xx) (Ax.xx) 2 [xx.xx/xlxx

= (Ax. xx) (Ax. xx)

z . . .

which l e a d s t o an unending computation. Apparent ly , i f t h e eva lua t ion

of Y were mechanized, problems would a l s o a r i s e i n r e c u r s i v e d e f i n i -

t i o n s . Th i s s i t u a t i o n doesn ' t a r i s e i f t h e o p e r a t o r is eva lua ted be fo re

t h e operand but t h i s i n t roduces some a d d i t i o n a l d i f f i c u l t i e s . McGowan

( i n [IPT]) h a s i n d i c a t e d t h a t by i n t roduc ing two more components t o t h e

s t a t e and an extended ope ra t i ng func t ion Landin's machine can be modi-

f i e d i n such a way t h a t a l lAE's a r e c o r r e c t l y eva lua t ed . Apparently

t h i s i nc ludes t h e eva lua t ion of Y a l s o . (Note t h a t Landin's ' v a l '

f unc t ion i s c o r r e c t a s i t s t ands s i n c e i t fo l lows a f u l l s u b s t i t u t i o n

r u l e . )

Exainple 2 Find t h e least f i xed p o i n t F where

( F ( f ) ) ( x , y ) E i f x = 0 then 0 e l s e f ( x - l , f ( x , y ) ) ,

and x,y a r e call-by-value parameters. Le t i , j be i n t e g e r s then

f ( i , j ) + i f i = 0 then 0 else f ( i - l , f ( i , j ) ) .

Now i f i = 0 then f ( i , j ) + 0 , but i f i # 0 then

and before t h e outermost f can be rep laced i t ' s arguments can con ta in

no occur rences of f , s o f ( i , j ) must be eva lua ted next . The eva lua t ion

then goes f ( k , j ) + f ( i - l , f ( i , j ) )

1. + f ( i - l , f ( i - l , f ( i , j ) ) )

f

Page 129: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

and thus never terminates. The least fixed point is then

f (x,y) 2 if x = 0 then 0 else w . S

Now find the least fixed point of F' which is the same as F but

allows x and y to be call-by-name parameters. Since Ft is made

up of naturally extended functions, a leftrnost substitution strategy

gives the least fixed point, as follows:

Thus the least fixed point of F' is

-I

f(i,j) + f (i-1,f (i,j)) + +- f(i-2,f(i-l,f(i,j)))

.f

. . . + f(O,f(l), ..., f(i.3) ...))

+- 0 I

The upwards characterization of fS for Ft goes as follows

i steps

f , ; (i,j)

if i = 0 then 0 else R(i-l,R(i,j))

if i = 0 then 0 else w

if i-1 = 0 then 0 else w

- f3(i,j) = if i = 0 then 0 else

if i-1 = 0 then 0 else

if 1-2 = 0 then 0 else w

fi(i,j) 2 if i = 0 then 0 else

if i-1 = 0 then 0 else . . .

if 0 = 0 then 0 else w -. = 0

Page 130: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Now, fS(i,j) f (i,j) if there is an n such that fn(i,j) n

is defined

w otherwise

and since for any (i,j) , fi(i,j) = 0 , the least fixed point s must be

4. Some Techniques for Proving Properties About Programs

The various characterizations and properties of the least

f ixed point fS and related functions suggest a number of methods for

proving that this function possesses certain types of properties.

These methods fall roughly into two classes collectively called

inductions. The methods of the first class are called approximation

inductions and are essentially inductions on the depth of recursion,

where the functional F and the function R play the parts

analogous to the successor function and the natural number 0 in the

usual mathematical induction. Approximation inductions are related

to the upwards characterization of fS . The methods of the second

class are called fixed point inductions and are based on the downwards

characterization of

The

and

the

Throughout this section the following notation is used:

0 i+l F ( f ) = f , F (f) = F(Fi(f)), and fi = Fi(n) .

functions fi are those used in the upwards characterization of s

the function fi is referred to as the i-th approximation to, or

i-th truncation of, the function fs

Page 131: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

a. Approximation Inductions

Suppose one wished to show that the function fS has a

certain property P . The upwards characterization of the least

fixed point is that fS = lub ifi) , SO if one could show that each

approximation i to fS has the property P and futhermore that

when every element of a chain has a property the lub of the chain

has the property, then it is clear that fS has the property.

Unfortunately the fact that every element of a chain has a

particular property does not imply in general that the lub of the

chain has the property. For instance, consider the predicate

and the chain {gi} , where -

gi (x) = if x < i then 1 else w . Now P(gi) is true for every i however lubig. 1 is identically 1,

1

so p(lubigi}) is false.

A predicate, P , is said to be admissible if whenever P

holds for every element of a chain it also holds for the lub of the

chain. DeBakker (in[RP]) shows that predicates of the following form

as well as finite conjunctions of them are admissible:

P(f) +-+ F(f) c G(f)

P(f) * F(f) = G(f)

P(fIo f c_gs

P(f) +-+ f = gs

where F,G are continuous functionals.

Page 132: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Another type of admiss ib le p r e d i c a t e is c a l l e d a p a r t i a l c o r r e c t n e s s

s ta tement i n Manna and McCarthy [PPP] and is of t h e form

where Q is some b ina ry p r e d i c a t e over AxB. Manna went on i n [MTC]

t o show t h a t f i n i t e d i s j u n c t i o n s of admis s ib l e p r e d i c a t e s were admis-

s i b l e a s w e l l a s exp re s s ions of t h e form VxQ(x,f) where Q(x , f ) is

a t o t a l p r e d i c a t e over i t s extended domain and, f o r a given va lue of x ,

is cons t an t over [A+B] ( i . e . c o n t a i n s no occur rences of f ) , a

p r e d i c a t e of t h e form ( F ( f ) ) (x) L (G( f ) ) (x) , where F,G a r e

cont inuous f u n c t i o n a l s , o r a f i n i t e conjunc t ion of such p red i ca t e s .

Once a p r e d i c a t e is known t o be admis s ib l e t h e problem then

becomes one of showing t h a t t h e p r e d i c a t e ho lds f o r each approximation

i t o f S .

S c o t t and deBakker were among t h e f i r s t t o develop an

i nduc t ion r u l e . The i r r u l e is c a l l e d t h e p- induct ion r u l e a f t e r t h e

p-ca lcu lus i n which i t is t h e main deduct ion r u l e . This c a l c u l u s is

t h e s u b j e c t of deBakkerVs book [RP] . The r u l e is given i n an i n t u i t i v e

form here .

p- induct ion Rule (deBakker,Scott) Let F be a cont inuous func t iona l

on [A+B] and P and admiss ib le p r e d i c a t e . I f

( i ) P(R) ho lds ,

and ( i i ) i f f i s i n [A-+B] and P ( f ) holds, then P ( F ( f ) ) ho lds ,

then P( fS) ho lds . The v a l i d i t y of t h i s r u l e is ev iden t s i n c e t oge the r w i th t h e

b a s i s s t e p t h e i nduc t ion s t e p guaran tees t h a t t h e p r e d i c a t e ho lds f o r

Page 133: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

all approximations to is. In fact since it is only the functions of

the sequence {fi} that are of interest, the induction step requiring

the fact that P(f) holds to imply that P(F(f)) holds for all f

in [A-+B] is stronger than necessary. Morris (in [ARI]) discusses a

generalization of the above rule in which the induction step is con-

cerned only with the approximations, or truncations, of

Truncation Induction Rule (Morris) Let F and P be as above. If

(i) P(R) holds, and

(ii) for every i , if P(fi) holds then P(fi+l) holds,

then P (f S) holds.

b. Fixed Point Inductions

The term 'induction' doesn't really apply to the methods of

this section in the same way as those of $a. Rather than being induc-

tions on the depth of recursion these methods employ the downward

characterization of fS (namely, f s = glb{fl~(f) = f} , or

= g$b{fl ~ ( f ) L f)). An induction rule that follows immediately from

this characterization is considered in some detail in Park [FIP]:

Fixpoint Induction Rule (Park) Let F be a monotonic functional on

[A+B] and g an element of [A-tB]. Then

if F(g)Gg ,then f S c g .

McCarthy (in [BMT]) was responsible for the first induction

rule of this type, called recursion induction. Its main use is to

show the equivalence of functions over certain domains. It is expressed

as follows:

Page 134: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Recursion Induction (McCarthy) Let F be a monotonic functional over

[A+B] such that fS is defined on A' , a subset of A . If F(g) = g

and F(h) = h then g = h on A ' . This rule can be strengthened by only requiring F(g) 5 g

and F(h) L h , which is sufficient for the result because of the

stronger characterization (viz., the glb{fl~(f) I f)) of the least

fixed point. The obvious weakness of this rule is that in order to

prove that g = h on A' one has to show that fS is in fact defined

on A' . In fact, if g and h are themselves not defined on some

part of A' then evidently it is impossible to find such a functional

F and fixed point fS . The rule can be slightly strengthened by

allowing a functional that has a least fixed point that may be un-

defined on part of the set A' , if it is the case that the functions,

g and h , under consideration are undefined wherever fS is

undefined on A ' . The strengthened rule can then be expressed as

follows :

Strengthened Recursion Induction Let F be a monotonic functional on

[A+B] and A ' is a subset of A . Then

if (i) F(g) i g and F(h) 5 h

and (ii) for every a in A' , if h(a) 2 w or g(a) 2 w then

fs(a) 2 w ,

then g = h on A' . The dependence of this method upon the functional F and its

fixed point fS

seems to be rather slight and in actual practice it is

often easier to prove g = h directly using another method than to go

Page 135: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

through this type of argument. For instance, if g and h are

the least fixed points of the functionals G and H, respectively,

then one might try to apply the Fixpoint Induction Rule twice by

showing that H(g) 5 g and G(h) c - h and then by the rule

g c h and h c g or h = g .

C. Relational Systems and the Church-Rosser Property

This section considers systems of a more general type than

those discussed so far. These systems are called relational systems.

A property, called the Church-Rosser property after its similarity to

the property asserted of the combinatory system Ho by the Church-

Rosser Theorem, is discussed in respect to these systems. The impli-

cations of the possession of this property by a relational system are

considered in terms of evaluation procedures. The second subsection,

$2, is concerned with a number of properties that are equivalent to,

or sufficient to imply, the Church-Rosser property. Finally an

application of these results to the systems of $ ~ 1 shows that the

equational approach to recursive functions is determinate, that is,

no matter what evaluation procedure is used, if it produces a value,

this value agrees with the value produced by any other procedure.

1. The Church-Rosser Property and Evaluation Procedures

A relational system will be understood to be a system with a

single binary relation r . Elementary statements are of the form

70 X r Y , where X and Y are obs of the system .

70 A number of statements, for example X r Y and Y r Z , are some- times strung together as X r Y r Z. This is also done with the auxiliary relations.

Page 136: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

A number of auxiliary relations are defined as follows:

X I Y iff X r Y or X Z Y 7 1

X = Y iff X r Y or Y r X lr

X 2 Y iff there exists a sequence of obs r Xo,-.,Xn9

such that, X Z X r X1 r ... 0 r X n G Y

X = Y iff there exists a sequence of obs r Xo,-,Xn,

such that,

The relation r is the reflexive closure of r , - - - is the lr

symmetric closure, 2 is the reflexive, transitive closure (if the r

case that the sequence may be of length 0 is allowed), and = is r

the reflexive, symmetric, and transitive closure.

The Church-Rosser property can now be formulated as follows:

(CR) If X = Y , then there is a Z such that, r

X Z Z and Y Z Z . r r

This property is especially important in systems in which:

(i) there is an equivalence relation % associated with the relation

of the system by

if X g Y ,then X'Y and Y ? X ,

and (ii) there is a category of obs, called obs in normal form, which

is such that

7 2 if X is in normal form and X ' Y , then X % Y .

7 1 The infix 'E' is taken to be identity of obs.

72 For the combinatory system Ho identity (i.e. E) is such a relation and for the systems of A-conversion a-convertibility is such.

Page 137: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

In these systems the Church-Rosser property implies the following:

a. If X is innormal formand X = Y , then Y - - X

b. If X and Y are in normal form and X = Y , then X 2 Y . In a. X is said to be a normal form of Y . So for a system, if the

relation can be identity of obs, then (CR) implies that normal forms

are unique. This is the case for the system Ho of Chapter 2 and for

the systems of A-conversion normal forms are unique up to a-converti-

bility. In both of these cases the relation r is contraction.

For the systems of $ ~ 1 which are proper, can be taken as

identity of obs, where the relation r is ' and the obs in normal

form are the ultimate definientia, that is, those obs which contain no

occurrences of instances of the lefthand side of a defining axiom.

Thus if these systems are Church-Rosser, then the ultimate definitia

are unique.

The uniqueness of normal forms in a system may be important

for a number of reasons. For the systems of combinatory logic and

A-conversion for instance, this result establishes their consistency in

the sense that all obs are not equal (= for weak reduction and = for 0 a

A-conversion). As far as evaluation procedures for obs of a system

goes, if normal forms are unique in the system any evaluation procedure

that produces a value will be in agreement with any other procedure

that produces a value.

The impact of this property can be seen in a number of ways.

In particular, in systems of this type one can often find a certain

evaluation procedure that produces a result if any procedure can. For

Page 138: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

1 2 '

combinatory logic and A@-conversion a reduction in which at each step

the leftmost redex was contracted are of this sort. For the

definitional systems of 8 ~ 2 evaluations which followed an outermost or

full substitution rule were also of this sort. This type of evaluation

procedure is often called a standard evaluation procedure.

In these systems often questions of efficiency are easy to

study, since one is not concerned with the possibility of two evaluation

procedures giving different results (unless one produces no result).

A third result is that in systems employing a nondeterministic

evaluation prcedure uniqueness of normal forms is important in order

that the procedure always produce the same result. But also in the

other direction if normal forms are unique in a sys tem,anondeterminis t ic

evaluation procedure can be employed to guarantee that, if any result is

possible, the result will be obtained. This is the case that since the

procedure is not deterministic one does not have to worry about being

trapped in an evaluation that continues forever when there are others

that terminate (for instance, being forced to use an innermost substi-

tutlon rule for

f(x) + if x = 0 then 0 else f(x-l,f(x,y))

when a more substitutive rule will produce a result).

2. Testing for the Church-Rosser Property

This section is concerned with a number of proper ties rela ted

to the Church-Rosser property. In order to make the content of these

properties more visible the following diagrams are used. A statement

in the lefthand column is considered to be represented by the

Page 139: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

129

corresponding diagram of t h e middle column o r i f t h e r e is s p e c i f i c

i n t e r e s t i n t h e r e l a t i o n r , t h e r ighthand column

X r Y -

X ? Y r

I f t h e e x i s t e n c e of an ob is being concluded t h a t ob w i l l be preceded

by ' 3 ' . The proper ty (CR) then can be s t a t e d :

The proper ty (CR) can be thought of a s say ing t h a t i f i t is

p o s s i b l e t o move from X t o Y by a series of c o n t r a c t i o n s and expan-

s i o n s , i t is p o s s i b l e t o move from X t o Y by a series of contrac-

t i o n s followed by a s e r i e s of expansions. A second p rope r ty , which is

a l s o o f t e n r e f e r r e d t o a s t h e Church-Rosser p rope r ty , is t h e fol lowing:

(B) I f U ?r X and U Y , then t h e r e i s a Z , such t h a t , r

X ? Z and Y ? Z . r r

Page 140: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

This is represen ted diagrammatical ly by

U

3z A weakened form of (B) is :

(C) I f U r X and U 1 Y , then t h e r e is a Z , such t h a t , r

X ' Z and Y 1 Z . r r

This proper ty is represen ted by t h e diagram: U

Now s i n c e (C) is a s p e c i a l c a s e of (B) which i s a s p e c i a l c a se

of (CR), (CR) impl ies (B) impl ies (C). I t is easy t o show t h a t (C)

imp l i e s (CR) and thus (CR) , (B) , and (C) a r e equ iva l en t . Assume

X = Y , then by d e f i n i t i o n t h e r e is a sequence of obs Xo, . . . ,X r n

such t h a t

The proof p r ceeds by induc t ion on t h i s n a s fo l lows:

( i ) ( b a s i s s t e p ) i f n = 0, then choose Z E X E Y ,

( i i ) ( i nduc t ion s t e p ) assume a 'n-1

has been found such t h a t

X ? Z and Xn-l ' zn-l , then n- 1

i f Xn r Xn-l , choose Z I Z n n-1 ' otherwise r X and t h e r e f o r e

'n-1 n

Page 141: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

by (C) there is a Z such that Y E X ' Z and 'n- 1 ' Z .

n

But X'Z and so by transitivity X ' Z and n-1

Y'Z.

Another property which implies the above properties is

(D) If U r X and U r Y , then there is a Z , such that,

X r Z and Y r Z . - - The diagram for (D) is

u

The property (D) is shown to imply (C) by a simple induction on n

where U E X r... r Z Y . 0 n

Sometimes within a system there are two relations r and s

present and one wishes to show that the relation rs defined by

X r s Y iff X r Y or X s Y

satisfies (CR). Consider the following property of r and s :

1 (E ) If U ?r X and U ' Y , then there is a Z , such that, S

X'Z and Y 1 Z . s r

This is diagrammed by:

Page 142: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

1 Now i f both r and s s a t i s f y (CR) and (E ) holds , then rs

s a t i s f i e s (CR). The proof of t h i s is s i m i l a r t o f i l l i n g i n a j igsaw

puzz le ; diagrams of t h e s o r t

a r e completed u s ing (CR) f o r each of r and s , whi le diagram o f

t h e s o r t

1 73 . a r e completed u s ing t h e proper ty (E )

1 A number of o t h e r p r o p e r t i e s a r e equ iva l en t t o (E ) . One of

t h e s e is t h e fol lowing:

2 (E ) I f U r X and U s Y , then t h e r e is a Z , such t h a t ,

X ? Z and Y r Z . S -

73 For d e t a i l s of t h i s and o t h e r proofs of t h i s s o r t s e e Curry [CLglI, Hindley [CRP], and Rosen [TMS].

Page 143: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Diagrammatical ly t h i s is:

u

32 2 1

I n o r d e r t o show t h a t (E ) i m p l i e s (E ) a double i n d u c t i o n i s r e q u i r e d .

T h i s is e s s e n t i a l l y an i n d u c t i o n on m where U 5 X r X r . r X E X 0 1 m

which t o show t h e i n d u c t i v e s t e p a n i n d u c t i o n on n where

- - s Y -

'lo-1 - 'm-1.0 m-1.1 * . . Ym-l,n ' zm-l i s r e q u i r e d , where t h e s e

o b s are as i n t h e diagrams below:

The i n d u c t i o n on m: u

The i n d u c t i o n on n?m-l

Page 144: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

It is possible to support (CR) with another property similar

1 to (E ) which is as follows:

(F) If U ? X and U ? = Y , thentherearea V anda 2 , r s

such that X 2 Z and Y ' V ' Z . s r s

Diagrammatically this is:

3 z The proof that (F) along with (CR) for each of r and s imply (CR)

for rs can be found in Rosen [TMS]. Further results on these and

related properties can be found there and in Hindley [CPR].

Properties of the sort (E) and (F) are useful when a system

has two or more different types of reduction yet one wants to show (CR)

for reduction in general. These properties have been employed for

example in showing that Bn-reduction of the XBn-calculus has the Church-

Rosser property. In that proof it is shown that 6-reduction and

n-reduction each have the property (CR) and that furthermore they have

the property (E) from which it is concluded that reduction in general

satisfies (CR) . Rosen (in [TMS]) found conditions,for relational systems of a

general sort of which the systems of 5 ~ 1 are a special case,that implied

the Church-Rosser property. What that means in the terminology of

this thesis is that when these conditons are satisfied by a definitional

system, the ultimate definientia are unique or in other words the

Page 145: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

1 3 5

definitional extension is partial recursive. To formulate Rosen's

conditions in the framework of the definitional systems of this chapter

the notion of a residual must be introduced.

Suppose X is an element of T of the form

W 1 , - ,X n )

and that X contains as a proper component a definiendum U as an

Xi or part of an Xi . Suppose further that X 4- Y by the defining

axiom

which is an instance of the axiom scheme

where the x range over the obs of T and Z is an ob in i

T(xl, ..., xn), that is, the system T with xl, ..., x adjoined as n

new atoms. Then if U is Xi or part of Xi then the occurrences

of U in Y that are homologous to the occurrences of x in Z i

are the residuals of the definiendum U in Y . Rosen's conditions are then that for each statement X + Y

of the system (i) X + Y is an instance of a unique defining axiom,

(ii) ifX has as a proper component the definiendum U which is such

that U + V, then X' 4- Y' is an instance of the defining axiom of (i),

where X ' is the result of replacing U in X by V and Y' is the

result of replacing the residuals of U in Y by V , and (iii) the

system is proper, that is, there are no two defining axioms

f(xl ,..., x ) + Z and f(xl,. ... x ) + Z' where Z $ 2 ' . n n

Page 146: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

136.

The condition (ii) is satisfied by the systems of $ ~ 1 as they

stand so for those systems the conditions (i) and (iii) guarantee that

the system has the Church-Rosser property. The condition (ii) essen-

tially guarantees that choosing a particular definiendum to be

contracted does not spoil the possibility of contracting other

definienda that were present originally. Diagramatically this enables

one to complete (indicated by a dotted line) the following:

by asserting the existence of the definition X' +- Y'. Condition (i)

guarantees that the class of residuals for a particular definiendum is

well defined.

Page 147: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Chapter 4 . Syntax, Semantics and Programming Languages

The p re sen t chap te r and chap te r 5 d e a l wi th t o p i c s of computer

s c i ence i n a framework b u i l t up from t h e no t ions introduced so f a r . A

s h o r t p re l iminary d i s cus s ion a p p l i c a b l e t o bo th c h a p t e r s 4 and 5 is

followed by t h e main developments of t h i s chap te r .

A. Computing Science

The computer s c i e n t i s t is concerned, among o t h e r t h i n g s , wi th

programs, semant ics , syn tax , problems, a lgo r i t hms , procedures , and s o

f o r t h . The meaning of t h e s e terms is o f t e n vague, even when cons ide r ing

e x p l i c i t examples, bu t an i dea of t h e i r meaning can be given. A

problem can , i n a s ense , be cha rac t e r i zed by s p e c i f y i n g t h e c r i t e r i o n

t o be m e t i n o rde r t h a t something be accep tab l e a s a s o l u t i o n of i t .

It is o f t e n t h e c a s e t h a t one can understand a problem, i n s o f a r a s

knowing what would be accepted a s a s o l u t i o n , y e t have no proposed

s o l u t i o n nor any idea a s t o where such a s o l u t i o n might be found. The

s o l u t i o n t o a problem is o f t e n given i n terms of an a lgor i thm o r pro-

cedure. Procedures a r e gene ra l l y b u i l t up from c e r t a i n a c t i v i t i e s

c a l l e d elementary (or atomic, b a s i c , e t c . ) procedures by va r ious means

of combinations such a s us ing one procedure a s p a r t of ano the r ,

fo l lowing one procedure by ano the r , e t c . A programming language is

simply a language t h a t is used t o s p e c i f y (o r r e p r e s e n t ) a lgor i thms

and procedures.

Of primary importance i n t h i s f i e l d is t h e a b i l i t y t o show

t h a t a given t e x t of a programming language (a program) s p e c i f i e s a

given procedure t h a t so lves a given problem. Requ i s i t e s f o r t h i s

Page 148: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

138.

are: (i) an understanding of the procedure (one must be able to deter-

mine whether or not it satisfies the criterion for solution of the

problem), together with (ii) an understanding of the language in which

the program is written (one must be certain that a given program

corresponds to a given procedure).

The considerations that lead to the decision that a procedure

gives a solution to a problem depend at least partly upon how the

problem and procedure are formulated. While this formulation is not of

central interest here, a fair amount of insight concerning such things

is gained in the following discussion of programming languages and

their specification.

The second condition above is one of the major topics of

interest in computer science. Ideally the user has a complete under-

standing of the programming language and no complications arise, but

generally these languages are so large and complex that very few

people do, in fact, have such an understanding. It would be wrong,

however, to cite size and complexity as the sole contributors to this

lack of understanding; quite often the fault lies in the methods

employed in defining these languages. It is common to give the

definition under two headings, namely, syntax and semantics.

Intuitively, the syntax contains considerations of the physical structure

of the expressions of the language, while the semantics contains consid-

erations concerning the designata or meanings of the expressions.

Page 149: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

139.

The syntax was the first of the two to be formulated in a

way that made the use of that part of the definition somewhat systematic.

The semantics, on the other hand, has generally been,until recently,

specified by discourse in a natural language, such as English, much in

the manner of a dictionary. This approach brings with it not only the

possibility of shortcomings in the definitions themselves, but also of

vagueness due to ambiguity within the natural language being used. The

aim of many recent approaches has been to formulate the information

contained under the heading of semantics in some manner similar to the

syntax. Ideally, with a proper formulation, an expression of a pro-

gramming language could be effectively shown to designate a certain

procedure, thereby eliminating such techniques as debugging in favor

of formal proofs.

As will be seen, there are many different approaches to this

formulation possible if one is simply interested in a formal system

that gives the meanings of expressions. Many of these, however, would

be discarded, being judged too awkward, too lengthy, nontransparent,

etc. Thus, the main difficulty in the construction of a formalism

that facilitates proofs of such things as program correctness, termina-

tion, etc., is in meeting the usual requirements of the language user.

To complicate things further it turns out that many formalisms excel

in certain applications while being next to useless in others. A

notion of usefulness, called acceptability, of a formalism relative to

a given application which was mentioned in $1 is considered in detail

later in the chapter.

Page 150: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

140.

This chapter includes a discussion of the formal specification

of semantics and in particular an examination of specifications which

utilize the concept of "levels of semantics" and the functional nature

of programs. Specifications of this type are in some ways much simpler

and useful than other methods in use. However, not unexpectedly, they

have certain drawbacks and limitations. In chapter 5 an example is

given which illustrates many of the points made in this chapter.

In the two main sections of this chapter the structure of

expressions and the meaning of expressions are discussed. The topics

of formalization and acceptability figure strongly in these discussions.

In particular the concept of semiotics, as discussed in chapter 1 is

employed to provide a uniform standard of terminology for this chapter.

The main purpose of the chapter is the determination of the meaning of

the phrase 'formal semantics for programming languages' as understood

by those in the field.

B. The Structure of Expressions

1. Syntaxes and Grammars

In a communicative language, which one hopes a programming

language is, there are often certain classes of symbol strings that are

of more interest than the class of all strings. Some of these classes

may be specified by what is called the syntax of the language, which

is essentially a discipline whose subject matter is the structure of

the expressions of the language. This term agrees with the use of the

term 'syntactical' of $ 1 ~ 3 for a language just when it is required that

the truth of the statements of the syntax (i.e. the elementary statements

Page 151: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

of t he d i s c i p l i n e ) can be determined i n a manner involv ing only cons idera-

t i o n s of exp re s s ions of t h e language a s symbol s t r i n g s . I t is p o s s i b l e

t h a t a syn t ax may simply s p e c i f y c l a s s e s of exp re s s ions without

( d i r e c t l y ) a s s o c i a t i n g wi th t h e s e exp re s s ions any information o t h e r

than c l a s s membership. When t h i s is t h e c a s e t h e d i s c i p l i n e is c a l l e d

pu re ly s y n t a c t i c a l o r a p u r e syn tax wi th r e s p e c t t o t h e language.

Often, though, t h e t e r m ' syn tax ' is def ined t o be a s p e c i f i c a -

t i o n of t h e programs and phrases74 of t h e language and is i d e n t i f i e d

wi th t h e t e r m Following $ 1 ~ ~ a grammar is he re taken t o be

a s p e c i f i c a t i o n of programs and phrases of t h e language ( a s grammatics

is t h e subd iv i s ion of semantics t h a t s t u d i e s t h e sen tences and phrases

of a language, see $ 1 ~ 3 ) . A grammar n e c e s s a r i l y a s s o c i a t e s wi th expres-

s i o n s information concerning t h e meanings of t h e s e exp re s s ions , namely,

t h a t of be ing a program o r a phrase. Therefore a grammar cannot i n t h i s

sense be a pure syntax. However, i t is o f t e n t h e ca se ( a t l e a s t f o r

programming languages) t h a t a grammar can be formulated i n a s y n t a c t i c a l

way, t h a t i s , t h e programs and phrases can be s p e c i f i e d i n a manner t h a t

involves on ly cons ide ra t i ons of t h e i r s t r u c t u r e . I n such a ca se a

grammar can be considered a syntax. Fu r the r i f t h e meanings a s s o c i a t e d

wi th t h e c l a s s e s s p e c i f i e d ( i . e . , be ing a program, e t c . ) can be a b s t r a c t e d

from, t h e grammar can be considered a pure syntax .

7 4 These terms a r e taken a s i n t u i t i v e analogues of t h e terms ' sen tence ' and 'phrase ' a s app l i ed t o an o rd ina ry language.

7 5 There a r e o t h e r t e c h n i c a l uses of t h i s t e r m , he re i t is taken a s suggested by chap te r 1.

Page 152: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

1 4 2 .

Looking at this from the syntax side, there is no reason to

believe that a syntax (but not a pure one) might not contain the informa-

tion of a semantical nature provided by a grammar and therefore be a

grammar (in fact a necessarily syntactical one).

An example of this is the syntax for Algol 60 as given in

Naur [RRA]. It is a syntax in that it specifies various classes of

expressions of the language in a manner that involves only the consider-

ation of these expressions as symbol strings. It is also a grammar in

that the English words and phrases within the angled brackets, ( ),

provide information concerning the meaning or designation of expressions

of that class. If the meanings of the words within the angled brackets

is disregarded one has a pure syntax, however, it is then a syntax that

is of no use to the programmer.

It should be noted then that while there are many cases in

which a syntax is a grammar and vice-versa, the two words should not be

identified. In fact, it is the attempt to make semantical notions

syntactical that prompts most of the work in this field as well as the

study of formal systems in general. The next section considers syn-

taxes and grammars in an attempt to see how to make grammars syntactical

and the following section considers the more general question of how to

make a semantical system syntactical.

It should be noted that while the syntaxes and grammars of the

next section may not be formal systems in the strict sense of SIC, they

are considered to be at least partially so, in that it makes sense to

talk about the A language of a syntax or grammar, if necessary.

Page 153: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

2. Structure -- and Representation

The remainder of this section is devoted to a discussion of

structure and the methods employed in its determination and specifica-

t ion.

The structure of an expression is essentially the relation of

the expression to its subparts and the modes of combination that join

them. An expression can have one or more of many possible structures,

certainly any way of visualizing the expressions of a language as an

inductive class gives rise to such possibilities. In the considerations

of syntactical systems ($1~1) two different means (namely, affixation

and concatenation) were presented in order to render the expressions of

an object language as an inductive class. For example, the expression

'3 + 5' of arithmetic can be considered to be: (i) the result of

affixing '5' to '3 +', which in turn is the result of affixing '+' to

'3', or (ii) the result of concatenating '3 +' and '5', where '3 +' is

the result of concatenating '3' and '+' (or alternately, the result of

concatenating '3' and '+ 5' and so on). In practice, there are

generally many other ways to give the expressions as an inductive class.

A structure for an expression can be indicated by various

means. Any particular means amounts to associating with the expression

under consideration a contensive object that has the same structure as

the chosen one for the expression. Such an association is a representa-

tion in the sense of $ 1 ~ . Among the most popular means of indicating

structure is the tree diagram (see $1~). The two possibilities in the

concatenation example, (ii) above, are associated with the following

(labelled) tree diagrams.

Page 154: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

The structure of an expression can sometimes be indicated in

a more concise way by using a familiar notation in which the structure

of the expression under consideration is made more explicit (at least

to those who are familiar with the notation). The use of brackets

and parentheses is often a case of this, for instance, in the previous

example the two concatenative forms of '3 + 5' correspond to structures

that are more clearly indicated when written '(3+)5' and '3(+5)'. The

expressions '(3+)5' and '3(+5)' are understood to be U expressions

(or perhaps A expressions of a discipline concerned with structures)

in which juxtaposition denotes concatenation in the object language.

It should be noted that concatenation is the only operation of concern

and thus that the parentheses inserted above apply only to that opera-

tion in contrast to their usual use in arithmetic.

There are, of course, many other common and often useful

representations. The Cukasiewicz and GGdel representations were

mentioned in $1~1. The only necessary criterion for a representation

is that the structure of the expression can be exemplified in the

contensive object which is associated with it. The usefulness of a

particular representation is often relative to a particular applica-

tion or even to a particular person and in some contexts (certain

proofs, etc.) a suitable choice of representation may make the

Page 155: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

difference between confusion and transparency.

3. Grammatical Structure

The main interest in structure stems from considerations of

the meanings of expressions. One of the easiest ways to specify

meanings is to assign meanings to various symbol strings that are in

some sense atomic and to associate with the various modes of combina-

tion operations on these assigned meanings. These notions belong to

the next section, but it is easy to imagine cases in which perhaps

certain structures for expressions may be more useful than others in

assigning meanings. It is, in fact, that structure of an expression

which is suggested by considerations of its meaning that is generally

of primary concern. If one understands the expression '3 + 5' in the

normal sense of arithmetic, then none of the structures mentioned above

corresponds very closely with the structure usually given it, namely,

the application of the function of addition, denoted by the infixed

symbol ' + I , to the arguments 3 and 5. These ideas can be further

illustrated by the following example. Consider the expression

'a + b . c' in a language which is essentially the same as ordinary arithmetic (in which, as usual, multiplication binds more closely than

addition), but in which only the "numerals" a, b,and c are present,

and superfluous parentheses are allowed. Because of the conventions

regarding binding and parenthesis usage, a + b . c in this language will be the same as a+(b.c) and not (a+b).c . If functional

application is taken to be the only mode of combination designated

by the infixing of the symbols '+' and '.' in the ordinary manner

Page 156: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

1 4 6 .

for addition and multiplication, then a + b c has the following

tree diagram:

application of add i t ion

application of multiplication

The complication referred to above that often arises in the

consideration of structure from the viewpoint of meaning (hereafter

called the grammatical structure) is that the semantically interesting

expressions of a language may, in fact, be specified in a manner that

does not, even implicitly, suggest their grammatical structure, but

which rather suggests a structure that is of little or no value from

a semantical viewpoint.

In order to illustrate this point three syntaxes are pre-

sented below which might be considered for the simple arithmetic

language just introduced above. Following the syntaxes a number of

conclusions are drawn concerning their relationships with the language.

The first consists of a set of productions in the style 7 6

of the Algol 60 report (Naur [RRA]) . Expressions enclosed by the

squared brackets I [ ' and ' 1 ' are called nonterminals and are not part

of the alphabet of the language, which are called terminals. One

particular nonterminal, [s], is called the start symbol. The symbol

1 . .. . = t separates each production into a lefthand side and a righthand

side and is read as "can be replaced by". The symbol ' 1 ' is understood as an exclusive or which demands the choice of exactly one clause. '

7 6 NO attempt has been made to match the rigor of that report.

Page 157: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

The product ions a r e :

[ s ] ::= [ f ] I [ s ] + [ s ]

[ f l ::= [ • ’ I [ f l I ( [ s l ) I a I b I c

An express ion s p e c i f i e d by t h e s e product ions is any symbol s t r i n g

(of t h e a lphabe t ) t h a t can be 'produced' by s t a r t i n g w i th [ s ] , then

s y s t e m a t i c a l l y r ep l ac ing some occur rence of a nonterminal , i f one

e x i s t s , by one of t h e c l a u s e s of t h e r igh thand s i d e of i ts p a r t i c u l a r

p roduct ion , and con t inu ing i n t h i s way u n t i l no nonterminals remain.

Note t h a t a t f i r s t only t h e nonterminal [ s ] is p re sen t and s o on ly

i t can be rep laced . The exp re s s ions of t h e language a r e j u s t those

express ions which a r e s p e c i f i e d by t h e s e product ions .

The express ion 'a + b . c ' can t h e r e f o r e be seen t o be

produced a s fol lows:

S t e p

0

1

2

3

4

5

6

Page 158: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

The f o l l o w i n g diagram is more c o n c i s e as w e l l a s be ing independent o f

t h e o r d e r i n which n o n t e r m i n a l s a r e r e p l a c e d :

The f a c t t h a t m u l t i p l i c a t i o n i s more b i n d i n g t h a n a d d i t i o n is

i n c o r p o r a t e d i n t o t h e p r o d u c t i o n s by t h e i n c l u s i o n o f [ s ] + [ s ] i n

t h e p r o d u c t i o n f o r I s ] , w h i l e [ s ] is n o t i n c l u d e d i n t h e p r o d u c t i o n

f o r [ • ’ I . Thus, t h e o n l y way a sum can be a term i n a p roduc t is i f i t

i s e n c l o s e d by b r a c k e t s and t h i s is al lowed by t h e i n c l u s i o n o f ( [ s ] )

i n t h e p r o d u c t i o n f o r [ f ] . Note t h a t even d i s r e g a r d i n g t h e o r d e r i n which n o n t e r m i n a l s

a r e r e p l a c e d , e x p r e s s i o n s of t h e form X * Y o Z and X+Y+Z can be

produced i n more t h a n one way. For i n s t a n c e , t h e e x p r e s s i o n a+b+c

can be produced i n two ways i n d i c a t e d by {a+b)+c and a+{b+c). I n

some c a s e s t h i s ambigui ty cou ld c a u s e d i f f i c u l t y , however h e r e t h i s

a g r e e s w i t h t h e u s u a l unders tand ing o f a sys tem i n which t h e o p e r a t i o n s

a r e a s s o c i a t i v e . For t h e e x p r e s s i o n s o f t h e language t h e n t h i s s y n t a x

s u g g e s t s t h e u s u a l s t r u c t u r e a s s o c i a t e d w i t h t h e s e e x p r e s s i o n s .

The second s y n t a x i s one i n which, r a t h e r t h a n be ing genera ted

d i r e c t l y , a r b i t r a r y symbol s t r i n g s are t e s t e d t o s e e i f t h e y are w e l l

formed. There a r e t h r e e c o n d i t i o n s t h a t a symbol s t r i n g must s a t i s f y

i n o r d e r t o be juhged t o be a n e x p r e s s i o n o f t h e language. These a r e :

Page 159: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

1.

2.

3 .

at least

this syntax is more closely related to a syntactical system with a pro-

per subclass of the class of all symbol strings called well-formed

expressions.

The third syntax is similar to the first, however it is

simpler having only one nonterminal [s] and only one production:

[sI ::= a I b I c I ([sl) I [sl + [sl 1 [sI [sl

Notice that most expressions of the language can be formed in more than

one way. For instance, 'a+b*ct could have either of the structures

{a+b)-c or a+(b*c) .

If one moves from left to right counting one for every

opening parenthesis and minus one for every closing

parenthesis, then at the end of the symbol string the

count must equal zero and a negative count must never

have been encountered.

Every opening [closing] parenthesis must be followed

[preceded] by a numeral or another opening [closing]

parenthesis.

Ignoring the parentheses, the symbol string must be of

one of the forms:

(i) a numeral standing alone, or

(ii) a string of 2n+l symbols (n 3 1) of the set

{a,b,c,+,*) which begins with a numeral and

alternates between numerals and members of the

set {+, - I . Note that the first syntax is essentially an ob system, since

in the important cases the expressions are monotectonic, while

Page 160: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

150

Now i t can be shown t h e symbol s t r i n g s generated by t h e f i r s t

and t h i r d syntaxes and those accepted by t h e second a r e e x a c t l y t h e

same. Furthermore, i n i t s manner of gene ra t i ng t h e exp re s s ions , t h e

f i r s t syn tax sugges t s t h e s t r u c t u r e u s u a l l y a s s o c i a t e d w i th t h e s e

express ions . The problem t h a t a r i s e s , t hen , is t h a t whi le t h e second

and t h i r d syntaxes g ive t h e same expres s ions a s t h e f i r s t , t h e second

sugges t s no p a r t i c u l a r s t r u c t u r e a t a l l , and t h e t h i r d gene ra l l y

sugges t s a number of s t r u c t u r e s .

This example shows t h a t i n o r d e r t o determine t h e grammatical

s t r u c t u r e of t h e exp re s s ions of a language more is r equ i r ed than simply

a syntax t h a t gene ra t e s t h e express ions . A c e r t a i n amount of semanti-

c a l in format ion concerning t h e language must be a v a i l a b l e . In t h e ca se

of t h e second syntax some information is necessary t o even begin t o

suggest any s t r u c t u r e f o r t h e express ions . I f , f o r i n s t a n c e , one knew

t h a t I+' and ' . ' represen ted o p e r a t i o n s and t h a t paren theses were

employed i n t h e u sua l way one could deduce a s much information about

t h e s t r u c t u r e of t h e express ion a s one might deduce from t h e t h i r d

syntax. The t h i r d syntax , a s noted, sugges t s s e v e r a l p o s s i b l e s t r u c -

t u r e s f o r most express ions and a s s e s e m a n t i c a l in format ion ( a t l e a s t

t he in format ion t h a t i s more b ind ing than +) is necessary t h e r e

t o be a b l e t o p i ck t h e c o r r e c t s t r u c t u r e . Even i n t h e ca se of t h e

f i r s t syn tax , which suggested t h e "cor rec t" s t r u c t u r e , semant ica l

information i s necessary i f on ly t o confirm t h a t i t does g ive t h e

c o r r e c t s t r u c t u r e s . Syntax one taken above does no t n e c e s s a r i l y g ive

t h e grammatical s t r u c t u r e , i t on ly does when t h e information above is

Page 161: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

151.

available concerning the language. Certainly if in the language the

symbol '+I was interpreted as multiplication and '0' was interpreted

as addition then the first syntax would not be useful in determining

grammatical structure.

More or less, in order to determine the grammatical structure

of the expressions of a language the necessary semantical information

is that which enables one to: (i) specify the various (possibly one)

classes of symbol strings that are atomic with respect to meaning in

such a way that these classes are definite,(ii) specify the modes of

combination, their order and domains, i.e. the type of expression

appropriate in each place, in such a way that the question of whether

a given expression is the result of applying a given mode of combina-

tion to given arguments-expresssions is definite, and (iii) select

from nonatomic expressions their various subparts.

With this information, some of which may be irrelevant or

redundant in certain cases, it is possible to determine the grammati-

cal structure of an expression. Note that this does not preclude

the possibility that an expression may have more than one structure,

but when this is the case it is a property of the language itself,

not a lack of information.

The ability to determine the grammatical structure of

expressions of a language is the aim of many popular approaches to

the specification of programs and phrases (i.e.,the grammatics),

for example the "abstract syntax" approach of McCarthy [TMS]. The

idea is to present a formalism that enables one not only to build up

Page 162: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

1 5 2 .

expressions from starting elements and other expressions (a synthetic

approach) but also to analyse a given expression with respect to

grammatical structure (an analytic approach). The main advantages of

including the analytic side in a formalism is that (i) it saves the

trouble of an often very difficult or complex analysis of the rules for

building up expressions in the attempt to determine the grammatical

structure of an expression, and (ii) it frees the synthetic side from

having to follow the grammatical structure, for instance, if one had

a means of determining the structure of expressions of the simple

arithmetic language above, any of the three syntaxes, including the

simplest third syntax could be used for the synthetic side.

Most syntaxes neglect the analytic side and adopt a synthetic

approach that follows the grammatical structure, the Backus-normal

form grammars used in the Algol 60 Report (Naur [RRA]) and the first

syntax above are examples. Note that the synthetic approach is better

suited for translating into a language (writing programs and the like),

while the analytic approach is better suited for translating out of a

language, which is essentially what one does when determining the

meanings of expressions.

The notion of an analytic syntax (i.e. a system for determin-

ing the grammatical structure of expressions) is made more precise in

the following, where it should be noted that the treatment is indepen-

dent of any particular representation of the expressions.

Page 163: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

4 . A n a l y t i c Syntax - -.

A n a n a l y t i c s y n t a x i s g e n e r a l l y made up o f : ( i ) a s e t of

c l a s s e s A , . . . A , (n 1 c o n s i s t i n g of symbol s t r i n g s which arc

c o n s i d e r e d t o be a tomic w i t h r e s p e c t t o meaning and a s e t of r e c u r s i v e

p r e d i c a t e s P I , ..., P a s s o c i a t e d w i t h t h e s e c l a s s e s f o r t e s t i n g member- n

s h i p , ( i i ) a s e t of f u n c t o r s (modes of c o m b i n a t i o n ) , C1, ..., Cm, (m - 11, 7 7

o f t e n c a l l e d c o n s t r u c t o r s , t h e i - t h one hav ing o r d e r Qi , 1 ' i , m ,

and a s e t of p r e d i c a t e s , R1, ..., R each a s s o c i a t e d w i t h a c o n s t r u c t o r , m

1 Y" i and ( i i i ) sets of o p e r a t o r s , c a l l e d s e l e c t o r s ; a s e t S i , ..., S is

i

a s s o c i a t e d w i t h each i

where S' s e l e c t s t h e j - t h argument of an i

e x p r e s s i o n hav ing i

a s i t s pr imary mode of combinat ion.

C l a s s e s of e x p r e s s i o n s a r e t h e n d e f i n e d by r e c u r s i v e d e f i n i -

t i o n s of a p r e d i c a t e E a s s o c i a t e d w i t h each c l a s s of t h e form:

E(x) +- Z ,

where Z i s a l o g i c a l s t a t e m e n t made up u s i n g some o r a l l of t h e p r e d i -

c a t e s and s e l e c t o r s above, t h e p r e d i c a t e E i t s e l f and pe rhaps o t h e r

s i m i l a r l y d e f i n e d a u x i l i a r y p r e d i c a t e s . For example, l e t A1 be an

i n f i n i t e set of v a r i a b l e s , C1 be f u n c t i o n a l a b s t r a c t i o n and C 2 be

f u n c t i o n a l a p p l i c a t i o n , then t h e c l a s s o f A-expressions is t h e c l a s s

a s s o c i a t e d w i t h t h e r e c u r s i v e l y d e f i n e d p r e d i c a t e E , where

E(x) + P1 (x) o r

1 2 (R1(x) and P1(S1(x)) and E ( S l ( x ) ) ) o r

1 2 (R2(x) and E ( S g ( x ) ) and E ( S 2 ( x ) ) ) .

7 7 For i n s t a n c e i n Landin [MEE].

Page 164: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

The a r i t h m e t i c e x p r e s s i o n s i n t h e f i r s t s y n t a x above can b e a s s o c i a t e d

w i t h t h e p r e d i c a t e E d e f i n e d by l e t t i n g A1 = { a , b , c ) , C1 be

a d d i t i o n , C 2 be mult i p l i c a t l o n , C j be p a r e n t h e s i z a t i o n , a s f o l l o w s :

where

1 F(x) + Pl ( x ) o r (R3(x) and E ( S 3 ( x ) ) ) o r

1 2 (R2(x) and F ( S 2 ( x ) ) and F ( S 2 ( x ) ) ) .

Note R R 2 , and R a r e t h e p r e d i c a t e s a s s o c i a t e d w i t h a d d i t i o n , 1' 3

m u l t i p l i c a t i o n and p a r e n t h e s i z a t i o n , s1 and s2 are t h e s e l e c t o r s 1 1

a s s o c i a t e d w i t h a d d i t i o n , S: and s2 a r e t h o s e a s s o c i a t e d w i t h 2

m u l t i p l i c a t i o n and 1 S3

is t h e s e l e c t o r a s s o c i a t e d w i t h p a r e n t h e s i z a -

t i o n .

So g i v e n a p u r p o r t e d e x p r e s s i o n of t h e a r i t h m e t i c language

one c a n t e s t t h a t f a c t w i t h t h e p r e d i c a t e E and f u r t h e r d e t e r m i n e

i t s s t r u c t u r e u s i n g t h e p r e d i c a t e s RI, R2, R j and P I i n c o n j u n c t i o n

w i t h t h e s e l e c t o r s S! . I n t h i s way no m a t t e r what s y n t a x is used t o 1

produce t h e e x p r e s s i o n s t h i s " a n a l y t i c s y n t a x " c a n be used t o d e t e r m i n e

t h e i r grammatical s t r u c t u r e .

C . The Meanings of Express ions

To t h i s p o i n t t h e t e rms 'meaning' , ' des igna tum' , ' s e m a n t i c s ' ,

e t c . have been used i n an i n t u i t i v e way. I t i s t h e purpose of t h i s

s e c t i o n t o make more p r e c i s e t h e u s e of t h e s e terms.

Page 165: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

1. Semantical Systems

Following chapter one, a semantical statement in a semiotical

discipline is one that gives information concerning the relation between

expressions of the language under consideration, called the 0 language,

and a class of objects called the designata, and as such its truth can

be judged by considerations involving the "meanings" of the expressions.

A semantics for a language is then a discipline whose elementary state-

ments are semantical statements.

A semantics, S = (E,D,R), for a language L involves three

things :

1. A class E of expressions of L.

2. A class D of objects called the designata.

3. A relation R between E and D.

In order to be able to express a semantics (in the U

language) a certain amount of machinery is needed, namely, nouns for

referring to the expressions of the 0 language and the designata,

and a verb denoting the relation R . Together these make up the A

language of the semantics. The elementary statements of a semantics

are of the form 'e' 'R' 'dl, where 'e' is the name of e , a member

of E , 'd' is the name of d , and 'R' is the name of R. Since

confusion rarely results, the quotes will, when possible, be omitted

and the elementary statement will be indicated by e R d.

While there are no restrictions on how the A language of

the system is chosen, a natural approach is to pick a representation

of the elements of E and D to be the A nouns, as both E and D

Page 166: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

156

can usually be considered to be the formal objects of two (for now,

purely morphological) systems. This approach is quite often helpful

later, when one is dealing with the formalization of the system. In

presenting a semantics it is usually the case that an autonymous

representation is used for the members of E , however as the members

of D are not necessarily expressions of a language, but may be

objects of any contensive discipline, the autonymousroute for D is not

always possible. Further the choice between various representations

can often have a great effect on the simplicity and transparency of

the resulting system. This is even more so than in the case of the

representation chosen for the structures associated with the expres-

sions by the syntax, as the relationship between an expression and its

designata can be of a much more general nature than that between an

expression and its structure. These matters are of more concern later

in this section where formalization is considered.

It will on occasion be useful to indicate a semantics (E,D,R)

by the following diagram

Very often, especially in the field of computing science, a

semantics is taken to be a many-one partial mapping from E to D.

Such a mapping is called a valuation. Evidently a semantics,which has

as its basic predicate the predicate associated with a valuation,can give

at most one designatum for each expression of the 0 language. A

semantics having this property is called unequivocal. The notions of

equivocality and structural ambiguity are often related, especially in

the case that the designata are associated with the expressions in a

Page 167: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

manner that depends upon the structures of the expressions.

2. Interpretations

There are many ways in which two semantics, S1 and S2 ,

can be related. One of the simplest consists of a (many-one partial)

mapping, u , from the elementary expressions of S1 into the elemen-

tary expressions of S2. In this case S1 is said to be interpreted

in S2 or that S2 is an interpretation of S1'

The interpretant of

the expression s of S1 is (us1) of S2 if it exists. The 1

interpretation is said to be full if u is total. As in chapter 1,

the interpretation is valid if (usl) is true whenever s is true 1

and, relatively complete if s is true whenever (us1) is true. 1

For the purposes here, a stronger form of interpretation

similar to the direct interpretation of chapter 1 is often interesting.

Let S1 = (E D R ) and S2 = (E D R ) be semantics and let 1' 1' 1 2' 2' 2

v : El + E2 and w : D 1

-+ D2 be (many-one, partial) mappings. Now

define a mapping, u , from elementary expressions of S1 to elemen-

tary expressions of S2 by:

if ve and wd exist, then

u 'e R d' = 've R wd' . 1 2

In these circumstances S2

is said to be a direct interpreta-

tion of s~'~. As before, 've R2 wd' is said to be, if it exists,

the interpretant of 'e R1 d' . Evidently such an interpretation is

full if v and w are total.

7 8 This is a slightly different form than that of chapter 1, however, it could be reformulated to agree with that usage.

Page 168: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

A s p e c i a l c a s e o f a d i r e c t i n t e r p r e t a t i o n is one i n which S 1

and S2 a r e s e m a n t i c s f o r t h e same language , i . e . , E l , E2 5 E , t h e

c l a s s o f a l l e x p r e s s i o n s of t h e 0 l anguage , v is t h e i d e n t i t y

mapping on E II E and undef ined on 1 2 El - E2 , and w is a s above.

Then t h e s t a t e m e n t ' e R d ' h a s t h e i n t e r p r e t a n t ' e R2 (wd)' , i f 1

e is i n E2 and (wd) is d e f i n e d . T h i s t y p e of i n t e r p r e t a t i o n is

q u i t e u s e f u l i n t h e d i s c u s s i o n o f l e v e l s of s e m a n t i c s l a t e r i n t h i s

s e c t i o n .

I t s h o u l d b e no ted t h a t i t is , o f c o u r s e , d e s i r a b l e t h a t a n

i n t e r p r e t a t i o n of o n e sys tem i n a n o t h e r be b o t h v a l i d and r e l a t i v e l y

complete . However, some c a s e s i n which t h i s canno t o r h a s n o t been

demons t ra ted t h e i n t e r p r e t a t i o n may s t i l l be o f i n t e r e s t . The comments

o f c h a p t e r 1 concern ing a c c e p t a b i l i t y a p p l y h e r e . These p o i n t s are

d i s c u s s e d f u r t h e r i n t h e n e x t s e c t i o n .

The concep t of a n i n t e r p r e t a t i o n o f one s e m a n t i c s w i t h i n

a n o t h e r w i l l b e u s e f u l i n t h e d i s c u s s i o n s c o n c e r n i n g s e m a n t i c a l l e v e l s

of t h e n e x t s e c t i o n .

3 . S e m a n t i c a l L e v e l s , In tended Meaning, and L e v e l s o f Semant ics .

I n t h e s t u d y o f s e m a n t i c s a s i t p e r t a i n s t o programming

l anguages , t h e r e a r e two main q u e s t i o n s o f i n t e r e s t . The f i r s t i s 'how

shou ld t h e s e m a n t i c s o f a language be p r e s e n t e d i n o r d e r t h a t a pe r son

be a b l e t o u s e t h e l anguage w i t h a minimum of d i f f i c u l t y ? ' . The

second, which i s c l o s e l y r e l a t e d t o t h e f i r s t is ' g i v e n a language w i t h

a n i n f o r m a l l y s p e c i f i e d s e m a n t i c s , i n what ways c a n t h e s e m a n t i c s be

Page 169: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

formalized t h a t enable one t o use o r i n v e s t i g a t e t h e language i n a more

p r e c i s e way?' . In p a r t i c u l a r , t h i s second ques t i on i s o f t e n asked

r e l a t i v e t o a p a r t i c u l a r t a s k , such a s proving c o r r e c t n e s s , t e rmina t ions ,

o r o t h e r p r o p e r t i e s about programs.

I n o r d e r t o ga in some i n s i g h t i n t o t h e s e ques t i ons one should

f i rs t cons ide r t h e r o l e of semantics f o r a language and, i n p a r t i c u l a r ,

f o r a programming language. E s s e n t i a l l y a t e x t of a programming

language (a program o r phrase) is meant t o d i r e c t a computer t o make

v a r i o u s changes i n a memory, which can be simply thought of a s a s t r u c -

t u r ed o b j e c t of some s o r t . Now, one n o t e s upon examining many of t h e

programming languages used today t h e i r extreme s i z e and complexity. An

a t tempt t o s p e c i f y t h e meaning of such a language by desc r ib ing , f o r

example, t h e changes t h a t t ake p l ace i n t h e memory of an a p p r o p r i a t e

computer f o r each express ion of t h e language would no t on ly be an

extremely t e d i o u s t a s k , but would y i e l d a semantics t h a t would probably

be of useonly t o a very s e l e c t few. Y e t , on t h e o t h e r hand, i f such a

d e s c r i p t i o n were no t p o s s i b l e , t he se languages would f a i l t o be u s e f u l

i n programming, a f t e r a l 1 , t h e y a r e e x p e c t e d t o be a b l e t o d i r e c t a

computer.

A l o g i c a l approach t o t h e s p e c i f i c a t i o n of semantics then

might involve a number of l e v e l s , each of which p r e s e n t s a c e r t a i n

amount and type of in format ion . The idea i s t h a t one has on ly t o

s tudy t h e l e v e l s t h a t a c t u a l l y concern t h e intended a p p l i c a t i o n of

i n t e r e s t a t a given time; some l e v e l s be ing more s u i t e d than o t h e r s

t o a c e r t a i n task . The l e v e l s u s e f u l t o a programmer a r e almost

Page 170: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

c e r t a i n l y d i f f e r e n t than those u s e f u l t o an implementer o r compiler

des igner .

The meaning of a program should a t t h e h ighes t l e v e l s be

expressed i n terms n a t u r a l t o t h e expected u s e r s . These l e v e l s then

might give t h e meaning of a program a s a func t ion from t h e c l a s s of

i n p u t s t o t h e c l a s s of ou tpu t s , a s a c e r t a i n type of a lgo r i t hm, o r

perhaps a s something e l s e depending on t h e t a s k s f o r which t h e language

is expected t o be used. Each subsequent lower l e v e l is concerned wi th

t h e r e a l i z a t i o n s of va r ious no t ions of t h e l e v e l s above i t , u n t i l a t

t h e lowest l e v e l t h e meaning of a t e x t is given i n terms of a v a i l a b l e

hardware and sof tware.

One can th ink of each l e v e l moving downwards a s adding in fo r -

mation t o t h a t a l r eady obta ined from above, u n t i l a t t h e lowest l e v e l

a l l a v a i l a b l e information is given. I n a s ense , each l e v e l provides

an approximation t o t h e meaning of t h e program i n t h a t perhaps no t a l l

t h e information concerning t h e program i s a v a i l a b l e a t t h a t l e v e l . By

moving downwards through t h e l e v e l s t h e approximation g e t s b e t t e r and

b e t t e r , t h e bes t approximation being given a t t h e lowest l e v e l .

Evident ly , an express ion which i s given no meaning a t one l e v e l might

be def ined a t a lower l e v e l , and two exp re s s ions i d e n t i f i e d a t one l e v e l

might be d i f f e r e n t i a t e d between a t a lower one. One can t h i n k of t h i s

p rocess i n terms of p a r t i t i o n s of t h e exp re s s ions of t h e language. The

h ighes t l e v e l may p a r t i t i o n t h e exp re s s ions i n t o a number of c l a s s e s by

v i r t u e of t h e i r u se fu lnes s w i th r e s p e c t t o c e r t a i n problems o r maybe

f o r some reason involv ing t h e i r b a s i c s t r u c t u r e , whi le each subsequent

lower l e v e l f u r t h e r p a r t i t i o n s t h e e x i s t i n g c l a s s e s by cons ide r ing t h e

Page 171: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

161.

f i n e r d e t a i l s of t h e e x p r e s s i o n s u n t i l a t t h e lowes t l e v e l t h e expres -

s i o n s have been p a r t i t i o n e d pe rhaps t o t h e p o i n t t h a t each c l a s s con-

t a i n s one e x p r e s s i o n , t h a t i s , each e x p r e s s i o n is g iven a d i s t i n c t

meaning.

Such a n approach is u s e f u l i n t h a t t h e r e a r e o f t e n c e r t a i n

q u e s t i o n s c o n c e r n i n g a n e x p r e s s i o n o r c l a s s o f e x p r e s s i o n s i n g e n e r a l

t h a t c a n be answered e a s i l y by c o n s i d e r a t i o n s i n v o l v i n g one l e v e l w h i l e

r e q u i r i n g a c o n s i d e r a b l e a n a l y s i s ( i f i t is t h e c a s e t h a t i t c o u l d b e

answered a t a l l ) a t o t h e r l e v e l s . I d e a l l y t h i s i s ach ieved by i s o l a t i n g

t h e v a r i o u s n o t i o n s and c o n s t r u c t s of t h e l anguage which can b e pre-

s e n t e d i n a n independent manner, s o t h a t e a c h l e v e l d e a l s w i t h n o t i o n s

o r t y p e s of e x p r e s s i o n s un ique t o t h a t l e v e l .

The lower l e v e l s t e n d t o d e f i n e a p a r t i c u l a r program a s a

h i s t o r y of t h e computat ion evoked upon r u n n i n g t h e program on a s u i t a b l e ,

pe rhaps a b s t r a c t , machine. These l e v e l s are c o l l e c t i v e l y r e f e r r e d t o

a s o p e r a t i o n a l l e v e l s . C e r t a i n h i g h e r l e v e l s , e s p e c i a l l y any which

might v iew t h e program a s a f u n c t i o n , pe rhaps v e r y complex, from t h e

c l a s s of i n p u t s t o t h e c l a s s of o u t p u t s , b u t which a r e n o t concerned

p r i m a r i l y w i t h t h e d e t a i l s o f i t s e v a l u a t i o n , a r e c a l l e d mathemat ica l

l e v e l s . The h i g h e s t and s i m p l e s t of t h e s e i s c a l l e d t h e inpu t -ou tpu t

l e v e l and is concerned w i t h n o t h i n g more t h a n t h e name i m p l i e s .

I n o r d e r t o b e a b l e t o d i s t i n g u i s h p r e c i s e l y t h e v a r i o u s

l e v e l s and t o d i s c u s s t h e i r r e l a t i o n s t o one a n o t h e r , i t is u s e f u l t o

v i s u a l i z e t h e s e m a n t i c a l l e v e l s a s c o r r e s p o n d i n g t o a number of seman-

t i c s r e l a t e d t o t h e language. One of t h e s e might b e a s e m a n t i c s which

a s s o c i a t e s no more w i t h a program t h a n i t s main s t r u c t u r e , w h i l e a n o t h e r

Page 172: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

If. .

is perhaps t h e o r i g i n a l semant ics o f t h e l anguage , t h a t semant ics which

i s r e f e r r e d t o a s g i v i n g in tended meanings o f t h e e x p r e s s i o n s . There

shou ld be a n o r d e r a s s o c i a t e d w i t h t h e s e s e m a n t i c s which cor responds t o

t h e l e v e l s p r e s e n t i n t h e o r i g i n a l semant ics . The h i g h e s t l e v e l g i v e s

t h e l e a s t amount of i n f o r m a t i o n i n terms of d e t a i l w h i l e t h e lowes t

g i v e s a l l t h e i n f o r m a t i o n of t h e h i g h e r s e m a n t i c s and more. The

f o l l o w i n g diagram i n d i c a t e s how t h i s h i e r a r c h y o f semant ics could be

v i s u a l i z e d :

O r i g i n a l Semant ics S I

Semant ica l Leve l s

I f t h e l e v e l s can be t r e a t e d i n a s u f f i c i e n t l y independent

f a s h i o n , t h i s sequence, I s i } , of semant ics can be c o n s i d e r e d t o be a

sequence i n which each semant ics is an i n t e r p r e t a t i o n ( v a l i d and

r e l a t i v e l y complete) of t h e p reced ing s e m a n t i c s . G e n e r a l l y each

i n t e r p r e t a t i o n is d i r e c t i n t h e s e n s e of t h e l a s t s e c t i o n where t h e

mappings v is t h e i d e n t i t y on Ei fl E i+l

and undef ined on i

Ei - Ei+l , Ei' Ei+l being s u b s e t s of t h e c o l l e c t i o n E of a l l

e x p r e s s i o n s o f t h e language. S i n c e a l l t h e mappings w a r e many-one i

p a r t i a l f u n c t i o n s , t h e e f f e c t o f moving downwards throughout t h e

semant ics w i l l be t o p a r t i t i o n f u r t h e r t h e e x p r e s s i o n s of t h e language.

Page 173: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

1(,3.

I f one is a b l e t o s e t up such a sequence of semantics i t

should be c l e a r j u s t what concepts should be introduced a t each l e v e l

i n o r d e r t h a t each of t h e i r t rea tments be a s independent of o t h e r

l e v e l s a s pos s ib l e .

Often when one a t t empt s t o fo rma l i ze t h e semantics of a

programming language a s i m i l a r s i t u a t i o n occurs . Suppose t h a t i n one

s t e p an informal semantics S1 can be converted i n t o a formal seman-

t i c s S2 . The s imp le s t way i n which t h i s could t ake p l ace i s by

s p e c i f y i n g a r e l a t i o n R 2 , t h a t ag rees wi th R1 , i n terms of a number

of p r e c i s e r u l e s . When t h i s i s t h e case one can t h i n k of t h e r e s u l t i n g

semantics a s being a f u l l i n t e r p r e t a t i o n of S1 where both v and w

a r e t h e i d e n t i t y func t ion , El = E2 and Dl = D2 . Diagrammatically

t h i s could be represen ted

So when a semantics can be formalized completely i n one s t a g e a sequence

of two semantics i s t h e r e s u l t . Genera l ly , however, such a one s t e p

fo rma l i za t i on is n o t p o s s i b l e , a t l e a s t r e l a t i v e t o a given formalism.

I t i s i n s t e a d u s u a l l y t h e ca se t h a t c e r t a i n t h i n g s w i th in a semantics

can be e a s i l y formalized ( f o r example, perhaps t h e meaning a s s o c i a t e d

wi th a c e r t a i n c l a s s of express ions) i n a way t h a t does no t lend i t s e l f

t o o t h e r concepts w i t h i n t h e semantics . Other t h i n g s may then be

f u r t h e r formalized i n a d i f f e r e n t way.

Page 174: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

16.'

An example of this is Landin's work ([CBA] parts I and 11) on

the formalization of Algol 60 semantics relative to a formalism based

upon Church's A-notation. He found there that certain things such as

function definitions, function application, lists and parameter treat-

ment (call-by-name versus call-by-value) could be treated easily and

others such as conditional expressions required a little more forcing,

while still others such as imperative statements, jumps, labels, etc.

could not be handled without some considerable changes of his formalism,

which in essence amounted to associating an abstract machine with the

original formalism that took into account certain things in a more

operational manner. Very roughly the situation there is indicated by

the diagram

First Formalism

v W 1,3 1,3 Second Formalism

S1: El-Dl Algol 60

where v 1,3

and v 1,2

are essentially translations of the expressions

of El (Algol 60) into a language based on the A-notation, w and 1,3

W 1,2

although not explicitly dealt with can be thought of as mapping

the meanings associated with Algol 60 texts by the original Algol 60

semantics into a class of functions and a class of machine histories,

respectively. As the modification of this original formalism (namely,

that giving S ) enabled more expressions to be dealt with 3 S3 can

Page 175: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

also be thought of as an interpretation of S2 where the mapping from

E to E l is the identity mapping on E2 11 E and the mapping from 2 3

D2 to D3 essentially associates a function with each machine history.

This example shows that even in the case that a semantics can

be completely formalized using one formalism it may be interesting to

consider another perhaps only partial formalization because it is based

upon a much simpler formalism or the mappings v and R are much

simpler. It is easy to imagine a language for which a number of

a3proaches to the formalization of the semantics are considered leading

to a situation indicated by the diagram

where the semantics connected above a particular semantics are inter-

pretations of that semantics and each is of interest in its own right

due to the way it is presented, the part of the original language it

covers or some similar thing.

Page 176: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

4 . Acceptability of Semantics

In the previous section there were two diagrams used to illus-

trate how the concept of levels of semantics arose in formalization.

The first was concerned with a one step formalization where the essen-

tial change was that the informal predicate R1 was replaced by an R2

which was specified by precise rules. This process is often called an

interpretational or direct approach to formalization. If dotted arrows

are used to denote informal relations, the diagram of $ 3 once again is

where I stands for the identity mapping.

In the example concerning Landin's work, rather than formal-

izing R1 directly, the expressions of El were translated into a

second language, whose expressions make up E2 , by means of a mapping

v , then a precisely defined relation R2

is used to determine the

designata of the expressions of E2 . This method is generally called

a translational approach to formalization and can be diagrammed as:

Page 177: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

There are several other forms of both interpretational and

translational approaches. In the case of interpretational approaches

there is the possibility that only certain parts of R1 can be easily

formalized while other parts are such that it is more sensible to leave

them informal than to try to force them into a particular formalism.

In such a case the mapping v may be the identity on a certain part

of El and undefined on the rest giving the diagram

where E 2 is a subset of El and I' is the identity function on

El f7 E and undefined elsewhere. It is also sometimes the case that 2

R2 associates each expression with less information than does R1 '

for example in the case that R2 gives the output while R1

gives the

whole history of the computation. In this case either of the following

two diagrams are possible:

Page 178: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

For the translational approach there are similar possibil-.

ities. In particular the case in which the class of designata remains

fixed is illustrated by the diagram

A particular case of interest, in which E2

is a proper subset of 1

and the mapping v is total, is called the devolution appr0ac.h.

The usefulness relative to a particular purpose, and person,

of a semantics related to the original semantics for a programming

language will be called its acceptability. The acceptability of a

semantics is based upon two criteria: (i) the simplirityof the mapping

v and the relation R2 , and (ii) the property that if ve 1 2 2 R d and

e R d 1 1 1 '

then wd = d2 and 1

d2 agrees with dl in the sense that

the information d2 provides concerning the expression e does not 1

conflict with that of dl , except that of dl may extend that of d2 .

The property (ii) will be called agreement and two semantics having

this property will be said to be & agreement. As the property of

agreement is expected of any reasonable formalization it is generally

the case that the acceptability of a particular semantics , S2 , as a

formalization of the given semantics , S1 , involves principally con-

siderations involving (i) . The importance of (i) is that, to begin with,the usefulness

of any system lies, at least in part, in the ease of determining the

Page 179: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

169

t r u t h of t h e i r e l ementa ry s t a t e m e n t s ( i . e . f o r S2 , s t a t e m e n t s of t h e

form ' e R d ' ) , and second ly a s e m a n t i c s 2 S2

c a n o n l y be u s e f u l w i t h

r e s p e c t t o a g i v e n s e m a n t i c s S1

i n s o f a r a s t h e mapping between t h e

sys tem is s imple .

The q u e s t i o n of ' s i m p l i c i t y ' is c e r t a i n l y a s u b j e c t i v e n o t i o n ,

a s is a c c e p t a b i l i t y i t s e l f , and a s such one canno t e x p e c t t o c h a r a c t -

e r i z e i t e x a c t l y , e x c e p t pe rhaps w i t h r e s p e c t t o a g iven a p p l i c a t i o n .

However, a q u a l i t a t i v e measure of t h e s i m p l i c i t y o f a mapping o r a I

r e l a t i o n i s c a l l e d h e r e i t s u n i f o r m i t y . I n t u i t i v e l y t h e more uniform

a r e l a t i o n o r mapping i s , t h e fewer t h e number o f axioms o r axiom

schemes r e q u i r e d i n o r d e r t o s p e c i f y i t comple te ly . Thus, a r e a s o n a b l y

uniform mapping c a n be s p e c i f i e d i n t e rms of a f u n c t i o n i n v o l v i n g a

number of pa ramete r s each r a n g i n g o v e r some p a r t of t h e domain s o t h a t

many e l e m e n t s of t h e domain a r e t r e a t e d i n a uniform manner.

The n o t i o n of u n i f o r m i t y c a n be d e f i n e d more p r e c i s e l y i n a

number of ways. For i n s t a n c e , suppose A and B a r e i n d u c t i v e c l a s s e s

and R i s a r e l a t i o n between them. Then i f P is an n-ary mode o f

combinat ion f o r A and t h e r e is a n n-ary mode of combina t ion , Q , f o r B

such t h a t f o r eve ry al' . . 'a

i n A i t is t h e c a s e t h a t n

- - P ( a l , . .. , a n ) R ? ( a l , . . . , a n ) ,

where a R 5 , then R is s a i d t o be uniform w i t h r e s p e c t t o P. If i i -.

f u r t h e r , R is uniform w i t h r e s p e c t t o e v e r y mode of combinat ion of A ,

then R is s a i d t o be uniform. There a r e c e r t a i n l y many weaker forms

o f t h e n o t i o n t h a n t h o s e g iven h e r e , f o r i n s t a n c e R may be uniform

w i t h r e s p e c t t o a p a r t i c u l a r argument o f a mode of combinat ion o r w i t h

r e s p e c t t o a c e r t a i n s u b s e t of A .

Page 180: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

170.

Some examples of a mapping which is uniform with respect to a

number of modes of combination can be found in Landings [MEE] and [ C B A ]

referred to above. His first step is to translate expressions of Algol

60 into A-expressions. The expressions on the left are basically Algol

60 expressions while those on the right are their translations, in each

case if X is an Algol 60 text X denotes its translation:

Algol 60 A-notat ion

If P then A else B if m u ) . A , A( ) . G ) ( 1

(A,B,C,) prefix(i) (prefix (g) (pref ix(C) (nullist) ))

f = ~ ( f ) F = Y F

Further discussion of the concepts of uniformity and agreement

take place in chapter five where, as an illustration, a number of

semantics are associated with a simple programming-type language. Also

included there are questions concerning the designata and the well-

def inedness of the relation R .

Page 181: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Chapter 5. Illustration: Towards a Formal Semantics -

This chapter introduces a simple programming-type language

as a means of illustrating a number of the concepts from the pre-

ceding chapters. There are three semantics given for the language:

an informally stated operational semantics, SL , which gives the

intended meanings of the expressions, a mathematical semantics, S3 ,

based upon the A-notation, and a semantics, S2 , lying between 1

and S3 , which stresses the functional nature of the expressions of

the language while retaining some of the operational facets of S1 '

S2 and S3 are presented in order to provide two formalisms

which can be used in the formalization of some of the notions of S1 . The acceptability of S2 and S in this respect is supported by the

3

following properties:

1. They are relatively simple compared to ' in that the

0 expressions (that is, the expressions of the programming-

type language) are considered in S2 and S3 to denote

functions and as such a detailed account of such matters

as means of computation is avoided. This can be contrasted

with the operational approach used in S1 where a direct

formalization would involve many more or less arbitrary

choices of methods for keeping track of various partial

results, questions of sequencing, etc., many of which add

to the complication while not being essential for an under-

standing of the language.

Page 182: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

2 . The t h r e e s e m a n t i c s a r e i n agreement i n t h e s e n s e

t h a t t h e f u n c t i o n s a s s o c i a t e d i n S 2 and S 3

w i t h 0 e x p r e s s i o n s t a k e t h e same v a l u e s a s S1 s p e c i -

f i e s as t h e o u t p u t o f t h e s e 0 e x p r e s s i o n s . There i s

some f u r t h e r agreement between t h e t h r e e c o n c e r n i n g

o r g a n i z a t i o n and p h r a s e s t r u c t u r e .

3. When viewed a s i n t e r p r e t a t i o n s o f S1, S2 and S a r e 3

v a l i d and r e l a t i v e l y complete .

The p r e s e n t a t i o n is i n t h r e e b a s i c p a r t s : t h e f i r s t o u t l i n e s

t h e l anguage , and i t s i n t e n d e d meaning a s g i v e n by S1 i n a n i n f o r m a l

way, t h e second is concerned w i t h t h e p r e s e n t a t i o n of S2 , i ts

r e l a t i o n s h i p w i t h S1 , and c e r t a i n q u e s t i o n s c o n c e r n i n g t h e w e l l -

d e f i n e d n e s s o f c o n c e p t s invo lved t h e r e , and t h e t h i r d d e a l s w i t h t h e

s e m a n t i c s S 3

Notions o f t h e A-calculus and of combinamry l o g i c a r e i n -

volved i n a number of ways i n c l u d i n g p r i m a r i l y t h e f o l l o w i n g :

1. N o t a t i o n a l l y , obs of t h e A-calculuses and t h e combinatory

sys tems a r e used t o d e n o t e f u n c t i o n s i n o r d e r t o avo id

c o n f u s i o n between a f u n c t i o n and i t s c l o s u r e .

2 . I n S , p r o p e r t i e s o f t h e s e sys tems a r e used t o d e a l 3

w i t h ass ignment i n a n a t u r a l way.

3 . I n b o t h S and S j t e c h n i q u e s of c h a p t e r 3 i n v o l v i n g 2

t h e combinator Y a r e used t o d e a l w i t h r e c u r s i v e ex-

p r e s s i o n s .

Page 183: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

4. Properties of the system, in particular the Church-Kosser

property, are useful in guaranteeing both the equivalence

of certain classes of 0 expressions (with respect to

S2 and S ) and the equivalence of various means of 3

evaluation, i.e., implementations, (again with respect

to S2 and S 3 ) .

A. The Language L and the Semantics 1

This section presents a simple programming-type language,

called L . The presentation includes a specification of the syntax

of L followed by a short discussion of the intended meanings of the

expressions of L , that is the semantics S1 '

The syntax of L is given in the style of the Algol 60 report

(Naur [RRA])~~, but no attempt is made to match the rigor of that

report. The terms 'expression' and 'statement' are taken as

technical terms which refer to particular sets of symbol strings.

Note that '0 expression' still refers to symbol strings in general. 80

The programs, [p] ; statements, [s] ; expressions, [a] and [b] ; and

identifiers, [i] of L are given by the following productions:

79 The syntax examples of $ 4 8 4 are also in this style.

80 This usage agrees with that of chapter 1.

Page 184: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

In these productions c, a and b are taken to denote any

elements of classes which are made up of various (for the purposes here,

atomic) statements and expressions that would be added to the language

if a practical programming language was desired. In particular,

various b's may be closures of predicates, logical functions and

connectives. The a's may include numerals and closures of various

arithmetical functions, while the c's may include the 'dummy' statement

and such things as well as perhaps 'read', 'write', etc. statements.

These classes may be defined in terms of other productions similar to

those above. The nonterminals [a] and [b] stand for arithmetic

statements and boolean statements, however, note that the clauses for

[a] include [b] so that boolean expressions are allowed as arith-

metic expressions. The clauses ([p]), ([s]), ([a]), and ([b]) are

unnecessary but are included for the sake of readability.

In order to keep track of various things concerning a compu-

tation such as, among other things, 0 expressions whose meanings can

vary during the course of the computation due to the change of values

of identifiers or similar things, it is often necessary to postulate

the existence of a store. A store, for the purposes here, can be

thought of simply as a set of locations with which the variable

Page 185: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

1 7 ~ .

entities related to n program can be associated. A state of the store

(or simply state) can be thought of as a mapping from the store to a

set of values. The set of all states will be denoted by S . For the language L , the only part of the store that is

dealt with explicitly is that part with which the identifiers

are associated. This part can be simply thought of as a list of the

identifiers that are in current use. Similarly, when dealing with

states, only the part of the mappings concerned with this part of the

store are discussed explicitly. The remainder of the store is perhaps

necessary to deal with such things as the so far unspecified a's, b's

and c's.

The motivation for restricting attention to the part of the

store associated with identifiers is that the programming-type expres-

sions which are concerned primarily with identifiers are just those 0

expressions which can be dealt with in a natural way using notions of

the A-calculus. It will be seen below that while S1 and S2 rely

upon this part of the store, S 3

uses the A-calculus in a manner that

makes an identifier list superfluous.

A statement is considered here as simply a request for a

change of state. When attention is restricted to the identifier list,

a statement, if it affects the list at all, can change the value of

one or more identifiers (an assignment) and/or add new identifiers along

with their initial values to the existing list (a declaration and sub-

sequent assignment).

Page 186: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

l7t.

An e x p r e s s i o n is though t o f a s p roduc ing a ' v a l u e ' which

depends upon t h e s t a t e and which i n p roduc ing t h i s v a l u e perhapsaltering

t h e i n i t i a l s t a t e g i v i n g a new s t a t e . So t h e meaning o f a n e x p r e s s i o n

is c o n s i d e r e d t o be a mapping from s t a t e s i n t o o r d e r e d p a i r s , t h e f i r s t

member o f which is a v a l u e and t h e second a s t a t e . The language L is

s e t up s o t h a t t h e e v a l u a t i o n of a n e x p r e s s i o n does n o t a l t e r t h e i d e n t i -

f i e r l i s t and t h u s i f any change of s t a t e is t o t a k e p l a c e i t w i l l t a k e

p l a c e i n t h e p a r t of t h e s ta te concerned w i t h t h e remainder o f t h e s t o r e .

Thus,ttae k s ir u n d e r s t a n d i n g (S1) o f t h e 0 e x p r e s s i o n s is

a s f o l l o w s . The meaning o f a n i d e n t i f i e r a t a g i v e n p o i n t i n a n evalua-

t i o n i s t h e v a l u e ( i f any) a s s o c i a t e d w i t h i t i n t h e i d e n t i f i e r l i s t .

The meanings o f t h e boolean e x p r e s s i o n s 'TRUE' and 'FALSE' a r e t r u e and

f a l s e , r e s p e c t i v e l y . It i s assumed t h a t no change of s t a t e t a k e s p l a c e

i n t h e e v a l u a t i o n o f t h e s e 0 e x p r e s s i o n s . A c o n d i t i o n a l e x p r e s s i o n ,

' I F b : a19a2

' , where 'a ' ' ' a r e e x p r e s s i o n s and ' b ' , i s a 1 ' a 2 '

boo lean e x p r e s s i o n , i s t a k e n t o mean whatever ' a ' means i f ' b ' 1

means t r u e and whatever ' a 2 ' means i f ' b ' means f a l s e , o t h e r w i s e

undef ined , a l o n g w i t h any change of s t a t e t h a t r e s u l t s from t h e eva lu -

a t i o n s i n v o l v e d . A p a r e n t h e t i c a l program, s t a t e m e n t o r e x p r e s s i o n is

t a k e n t o mean e x a c t l y t h e same t h i n g a s t h e 0 e x p r e s s i o n w i t h o u t

p a r e n t h e s e s ( i t is a g a i n assumed t h a t no change of s t a t e t a k e s p l a c e

i n removing p a r e n t h e s e s ) .

The s t a t e m e n t ' i : = a ' c a l l s f o r t h e e v a l u a t i o n of ' a '

and t h e s t o r a g e o f t h e r e s u l t ( i f any) i n t h e p l a c e on t h e i d e n t i f i e r

t . 1 l i s t a s s o c i a t e d w i t h 1 ( n o t e t h a t t h e e v a l u a t i o n of ' a ' may c a u s e

o t h e r changes a s w e l l i n t h e s t a t e ) . The s t a t e m e n t ' I F b : s1,s2' ,

Page 187: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

where ' b ' i s a boolean e x p r e s s i o n and ' s ' ' s ' 1 ' 2

a r e s t a t e m e n t s , is

t aken t o mean t h e same a s ' ' 1

i f ' b ' means t r u e and t h e same as

' ' i f ' b ' means f a l s e , e x c e p t f o r t h e f a c t t h a t a d d i t i o n a l changes 2

i n t h e s t a t e may have r e s u l t e d from t h e e v a l u a t i o n of b . The

9 t 1 s t a t e m e n t 'sl;s2 s imply means pe r fo rm s and then perform ' ' 1 S2 .

The 0 e x p r e s s i o n ' s ; ~ ' h a s a s i m i l a r meaning. The e x p r e s s i o n ' a ; p l ,

however, is t a k e n t o mean e v a l u a t e ' a ' and o u t p u t t h e r e s u l t ( i f any)

and t h e n perform p . The e x p r e s s i o n 'END' d e n o t e s t h e end of a

program and f o r t h e purposes h e r e w i l l be assumed t o o u t p u t t h e symbol

' * ' w i t h no a s s o c i a t e d changes of s t a t e t h a t a r e of i n t e r e s t .

The n e x t s e c t i o n i s concerned w i t h t h e p r e s e n t a t i o n of t h e

s e m a n t i c s S2 . It i s c l o s e l y r e l a t e d t o t h e work of McCarthy, Landin ,

S c o t t , and S t r a c h e y , from which some o f t h e c o n c e p t s and n o t a t i o n is

borrowed. An e f f o r t is made t o p i n p o i n t t h e main c o n t r i b u t i o n s by

r e f e r e n c e s .

B. The Semant ics S,

The s e m a n t i c s S2 = (E R D ) c o n s i s t s of a language 2' 2 ' 2 E2

whose e x p r e s s i o n s a r e r e l a t e d (by R ) t o e l e m e n t s of 2 D2 which a r e

t aken t o be f u n c t i o n s from s t a t e s t o s t a t e s . The language E2 i s

formed i n such a way t h a t i t s e x p r e s s i o n s a r e s u g g e s t i v e o f t h e func-

t i o n s (of D ) t h a t they d e n o t e , t h a t i s , i t i s i n t e n d e d t o be under- 2

s t a n d a b l e on i t s own, s o t h a t R2 and D2 can f o r t h e most p a r t be

c o n s i d e r e d t o b e i m p l i c i t l y g iven . I n view o f t h i s , where i t is no t

n e c e s s a r y t o be a b s o l u t e l y p r e c i s e t h e e x p r e s s i o n s of E2 a r e r e f e r r e d

t o d i r e c t l y a s f u n c t i o n s of D2 . The mapping v 2 , s imply c a l l e d v

Page 188: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

throughout this section, from 0 expressions of L (= El) into exprcs-

sious of E2 (a translation) can under these situations be considered

to map El directly into D2 . whereas if one is absolutely precise v

is a translation from El into a language that is already understood,

Following the notation of chapter 3, if S denotes the class

of all states then

is + S I (1)

is the class of all monotonic functions from S into s81. If V is

the class of values (that the expressions take) then

[ S -, [VxSII (2)

is the class of all monotonic functions from the class of states into

ordered pairs, the first term of which is a value and the second term

of which is a state.

The language E2 will then consist of expressions which de-

note functions built up from functions in these two classes. The map-

ping v will associate with statements of L expressions of 2

which

denote functions of the type (1) and with expressions of L expressions

of E 2 that denote functions of the type (2). In essence then v will

map expressions into functions of the type (2) and statements into the

type (1).

81 This notation is taken from Scott and Strachey [TMS] and Manna [MTC].

Page 189: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Notationally, if 't' is a text of the language I. ,

v('tl) or simply v't'

will denote an expression of E2 , or as discussed above a function on

S , and

(v('tl))(s) or simply v't's

the closure of that function for a given state s in S . Note that

parentheses will often be omitted in an association to the left fashion.

The one exceptional 0 expression of L is END which is

neither a statement nor an expression. The function v maps it into

the E2 expression ' * ' which denotes a constant function on the

class of states, always taking a special value denoted also by ' * ' . So v 'END' s c * s and * s = * .

Let ST, AX, and BX be the classes of statements, arithmetic

expressions and booleac expressions of L , respectively, then for these

classes the mapping v can be considered to be as follows:

v : ST -+ [S -+ S]

v : AX + (S -+ [VxS]]

v : BX + [S + [V'xS]]

where V' = {true, false,^} . Now considering the various clauses of the syntax for L ,

v is defined in terms of the defining axioms below.

The unspecified classes of (atomic) statements and expres-

sions are dealt with as follows:

v'c' + a given element of [S + S]

v'a' +- a given element of [S -* [VxS]]

v'b' + a given element of [S + [V'xS]] .

Page 190: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Now a s e x p r e s s i o n s a r e go ing t o be mapped i n t o f u n c t i o n s from

S i n t o [ V x S ] , t h e n o t a t i o n of E2 i n c l u d e s a method o f forming o r d e r e d

p a i r s , namely, t h e u s u a l method of e n c l o s i n g t h e two i t ems of t h e o r d e r e d

p a i r w i t h i n p a r e n t h e s e s and s e p a r a t i n g them w i t h a comma, e .g . ( a , b ) .

E2 a l s o i n c l u d e s t h e o p e r a t i o n s 1st and 2nd f o r s e l e c t i n g t h e respec-

t i v e members o f an o r d e r e d p a i r , s o 1st ( a , b ) = a and 2nd ( a , b ) = b . The boo lean e x p r e s s i o n s 'TRUE' and 'FALSE' a r e t aken t o mean t r u e and

f a l s e r e s p e c t i v e l y f o r any s t a t e , f u r t h e r t h e i r e v a l u a t i o n i s assumed

t o have no e f f e c t on t h e s t a t e . For t h e s e e x p r e s s i o n s and a g iven

s t a t e s t h e v is d e f i n e d by

v'TRUE'S + true,^)

v'FALSE'S + false,^) . Using A-nota t ion t h e s e can be r e p l a c e d by

v'TRUE' + A s . ( t r u e , s )

v'FXLSE' + X s . ( f a l s e , s ) . Express ions of t h e form ' I F b : a l , a 2 ' a r e somewhat more

compl ica ted . A s s k e t c h e d above, one e v a l u a t e s ' b ' i n t h e g i v e n s t a t e s

which p roduces a v a l u e and a new s t a t e s ' , now i f t h e v a l u e is t r u e

then a is e v a l u a t e d i n s' produc ing a v a l u e and a new s t a t e , b u t 1

i f t h e v a l u e o f b i s f a l s e then a i s e v a l u a t e d i n s' produc ing 2

a v a l u e and a new s t a t e . The f o l l o w i n g d e f i n i n g axiom g i v e s t h e

d e s i r e d r e s u l t f o r a g iven s :

v ' I F b : a l , a 2 ' s +

( i f 1st ( v ' b ' s ) t h e n v ' a ' e l s e v ' a ' ) ( 2 n d ( v ' b ' s ) ) . 1 2

Note t h a t v ' b ' s i s a n o r d e r e d p a i r t h e f i r s t t e rm o f which i s a v a l u e

and t h e second is a s t a t e . A-nota t ion makes i t p o s s i b l e t o s i m p l i f y

Page 191: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

this in such a way that the evaluation of b take place only once in

the following way:

(AX. (if 1st x then v 'a ' else v 'a '1 1 2

(2nd x))(v 'b's) . Finally abstracting with respect to the state one obtains

v 'IF b : al,a2' 4-

Xs.(Ax.(if 1st x then v 'a ' else v 'a2') 1

(2nd x))(v 'b's) . In order to deal with identifiers and assignments two state

manipulating operators, due to McCarthy ([TMS]), are useful. The first

is an operator C such that given an identifier x and a state s

C(x:s) is the value (if any) stored in the place corresponding to the

identifier i in the state s . The second is an operator A such

that given a value v , an identifier x , and a state s , A(v,x:s)

is the state that results from replacing whatever value x has in s

by v (and if x does not have a place in s then one is provided

and v is stored there). The letters C and A are mnemonic for

contents and assignment. These operations are defined in such a way

that the following hold for any value v , state s and identifiers

x and y :

(i) A (C(x:s) ,x:s) = s

(ii) C (x:A(v,x:s)) = v

(iii) C (y:A(v,x:s)) = C(y:s) if y $ x

(iv) A (v, x:A(w,x:s)) = A(v,x:s)

(v) A (v,x:A(w,y:s)) = A(w,y:A(v,x:s)) if x $ Y .

Page 192: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

18

The operation C is used to deal with identifiers as follow5

for any identifier 'x' :

V'X'S + (C(x:s),s)

and abstracting with respect to the state this becomes

V'X' +- hs.(C(x:s),s) . Note that the evaluation of an identifier is assumed to cause no change

of state.

The only remaining type of expression is a parenthetical ex-

pression, but since the meaning of the parentheses is the same for pro-

grams, statements, and expressions all three cases are dealt with here.

Let 't' be any 0 expression then

vl(t)' + v ' t ' . That is, parentheses are not significant with respect to meaning.

Statements of the form 's1;s2' are treated as follows:

v'sl;sZ1s + V'S '(v's 's), or + (V'S ' o v'sll)s, 2 1 2

where 0 denotes functional composition. Abstracting from s, one has

v1s1;s2' + AS.V'S '(v'B 's), or + V'S ' o V'S ' 2 1 2 1 '

The conditional statement is treated in a manner similar to

that of expressions giving

v 'IF b : s1,s2' s t

(if 1st (v'b's) then v's ' else v's ')(2nd(v1b's)) 1 2

or + (Xu. (if 1st u then v's ' else v's ' ) (2nd u)) (v'b's) 1 2

and abstracting from s one has

As.(if 1st (v'b's) then v's ' else v's ')(2nd(v1b's)) 1 2

or +- Xs.(Au.(if 1st u then vlsl' else v's )(2nd u))(v1b's) . 2

Page 193: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

The o p e r a t o r A is used t o d e s c r i b e t h e meaning of a s s i g n -

ments , t h a t i s , s t a t e m e n t s o f t h e form ' x : = a l , where 'x' is a n

i d e n t i f i e r and ' a ' i s a n e x p r e s s i o n . Such a s t a t e m e n t c a l l s f o r t h e

s t o r a g e of t h e v a l u e of ' a ' i n t h e p l a c e a s s o c i a t e d w i t h x i n t h e

i d e n t i f i e r l i s t , s o

v ' x : = a l s f A ( l s t ( v l a ' s ) , x : 2 n d ( v 1 a ' s ) )

o r f (Xu.A(ls t u, x : 2nd u ) ) ( v l a ' s ) . Note t h a t t h e v a l u e l s t ( v l a ' s ) is s t o r e d f o r x i n t h e s t a t e 2nd

( v ' a ' s ) i n s t e a d of t h e s t a t e s because t h e e v a l u a t i o n of ' a ' p r i o r

t o t h e ass ignment may change t h e o r i g i n a l s t a t e . Again a b s t r a c t i n g

w i t h r e s p e c t t o s one h a s

v ' x : = a l +- Xs.A( l s t ( v ' a ' s ) , x : 2 n d ( v ' a 1 s ) )

o r + As. (Xu.A(ls t u , x : 2nd u ) ) ( v 1 a ' s ) . Now f i n a l l y , programs of t h e form ' s ; p l a r e t r e a t e d i n t h e

same way a s s t a t e m e n t s of t h e form ' sl;s2' , t h a t i s ,

v 1 s ; p ' f v ' p l 0 V ' S ' . Programs of t h e form ' a ; p l a r e d e a l t w i t h a s f o l l o w s :

v ' a ; p l s + (1st(v'a's),v'p'(2nd(v1a'~)))

o r f (Xu.(lst u , v l p ' (2nd u ) ) ) ( v ' a ' s )

and a b s t r a c t i n g from s one h a s

v 1 a ; p ' f X s . ( l s t ( v ' a ' s ) , v ' p ' ( 2 n d ( v 1 a ' s ) ) )

o r +- As. (Au. ( 1 s t u , v l p ' (2nd u ) ) ) ( v ' a ' s ) . Thus t h e meaning of a program of L i n t e rms o f S2 is a f u n c t i o n

which maps t h e i n i t i a l s t a t e i n t o a n e x p r e s s i o n of t h e form

(v,, (v2 , . . (vn, *) ) ) ,

where vl , ..., v a r e t h e v a l u e s t h a t a r e o u t p u t i n t h e c o u r s e of t h e n

computat ion i n o r d e r .

Page 194: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

For reference the above definitions are grouped together here

l'

v'i:=al + Xs.A(lst(vla's),x : 2nd(v'a1s))

v1s1;s2' 4 vls ' 0 vls ' 2 1

V'IF b : S1,S2' f

Is.(if lst(vlb's) then v'sll else v's ')(2nd(v'b1s)) 2

in the order of occurrence in the productions I

( I v'i' + As. (C(i:s),s)

<

v'END' f * , where *s = * , f o r every state s

v1a;p' + As. (1st (~'a's),v~~'(~nd(v'a's)))

a,') (2nd(l

vls;p' + v'p' 0 vls'

v' (p)' + v'p' \

4 v'b's))

v'IF b : al,a2' +

As.(if lst(v'b's) then vtal' else v'

i v' ( a ) ' + v'a'

f

v'TRUE' + As.(true,s)

v'FALsE' + As. false,^)

v' IF b .b b ' +- 1' 2 ' 3

As. (if 1st (v1bl's) then v'b 2 ' else v'b ' ) (2nd(v1bl's)) 3

vr(b)' + v'b' 1

As an example consider the program p :

x:=l ; z:=x+l ; IF(x+z = 3):(y:=O),(y:=l) ; y+l ; END .

Page 195: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Using the above rules and assuming that

vlx+l's = (C(x:s)+l,s)

v'y+lls = (C(y:s)+l,s)

v1x+z=3's = if(C(x:s)t€(z:s)= 3) then true,^) else false,^)

the function (after a few simplifications) associated with p , v'p', is

(As.(lst(~(~:s)+l,s),*))o

(As. (Ax. (if 1st x then A(0,y:s) else A(1,y :s)) (2nd s))

(if C(x:s) + C(z:s) = 3 then true,^) else (false, s)))o

Given any state s , v'p's reduces to (I,*) , where the reduction

involves A-reductions and properties of o, Lst, 2nd, A , C, and the

* if--- then---else--- * function.

C. The Semantics S 3

The semantics S3 is similar to S2 in its relation to S1

The expressions of E3

will be basically A-expressions with which the

relat ion R3 will associate their usual interpretations as functions.

Being precise the mapping v (again simply called v throughout this 3

section) is a translation from El to E3 , but in practice since 3

and D are more or less implicit in 3 E3 , v can be thought of as a

mapping from El (that is, 0 expressions of L) into functions

(which are often 0-ary functions or constants).

The semantics 3

will not be concerned with an identifier

list at all and since that was the only part of the state dealt with

explicitly in S2 the concept of state will be omitted entirely. If

one wished to include such a concept, an approach similar to that of

Page 196: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

181 .

S for the remainder of the state could be built into S 2 3 - Since t h r r r

is no state the basic unspecified states cannot be treated in S 3 -

The rest of the programs, statements, and expressions of L are treated.

Programs of the form 'END', 'a:pl, and (p) are dealt with by

V'END' + *

vla;p' + (v'a',vlp')

vl(p)' 4- v'p' . Statements must be considered in the context of the program

unlike in S2 , thus one obtains the following:

v'x:=a;pl + (hx.v1p') (v'a')

V'IF b : ~ lPC2

' + if v'b' then v'c ;p' else v'c2;p1 1

Note that the second and third defining equations are essentially trans-

lations from 0 expressions to 0 expressions and that as far as out-

put goes (and even as far as the functions associated by S2

are

concerned) the original 0 expressions and their translations are

equivalent.

The arithmetic and boolean expressions are treated in an even

simpler manner giving the following:

v'a' +- some number or truth value,

where a is an unspecified arithmetic or boolean expression.

Page 197: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

j v'TRUE' -+ t r u e

v'FALsE' + f a l s e

v ' I F bl:b2,b3' t i f vlbl' t h e n v'b ' e l s e v ' b ' 2 3

Consider t h e example of t h e las t s e c t i o n ; program p ,

x : = l ; x:=x+l ; IF(x+z=3) : (y:=O),(y:=l) ; y+l ; END . Using t h e above r u l e s and assuming t h a t

v ' x + l l = x+l

v ' y + l l = y+l

t h e e x p r e s s i o n of E3 ( a f t e r a few s i m p l i f i c a t i o n s ) a s s o c i a t e d w i t h

p i s

(Ax. (Az. i f x+z=3 then (Xy. (y+l ,*))O e l s e (Xy. ( y + l , * ) ) l ) x + l ) l

which r e d u c e s a l s o t o ( I , * ) , where t h e r e d u c t i o n i n v o l v e s o n l y

A-reduct ions and a n e v a l u a t i o n o f t h e 'if---then---else--- e f u n c t i o n .

Now s i n c e t h e e x p r e s s i o n f o r S3

is much s i m p l e r than t h a t

f o r S2 , i t i s e a s i e r t o d e t e r m i n e a c l a s s of programs t h a t a r e equ i -

v a l e n t t o p a t l e a s t i n terms of o u t p u t . Cons ide r t h e f o l l o w i n g

e x p r e s s i o n s of 3

which a r e o b t a i n e d from v ' p ' by c o n t r a c t i n g

v a r i o u s a- redexes:

Page 198: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

(Xz. i f 1+z=3 then (Xy. (y+l ,*))O e l s e (Xy. ( y + l , * ) ) 1 ) 2

(Ax. i f x+(x+1)=3 then (Xy. (y+l ,*))O e l s e (Xy. ( y + l , * ) ) l ) l

(Xx.(Xz. i f x+z=3 then ( I , * ) e l s e (2 ,* ) )x+1)1 .

The e x p r e s s i o n s cor respond t o t h e programs

2:=2 ; IF( l+z=3) : (y:=O), ( y : = l ) ; y+l ; END

x : = l ; IF(x+(x+l )=3) : (y :=O) , (y := l ) ; y+l ; END

x := l ; z:=x+l ; IF(x+z=3) : 1, 2 ; END

r e s p e c t i v e l y , which s i n c e t h e i r c o r r e s p o n d i n g e x p r e s s i o n s i n E3 a r e

c o n v e r t i b l e must have t h e same o u t p u t because of t h e Church-Rosser

Theorem f o r t h e A-calculuses .

The f a c t t h a t t h e above programs a r e o u t p u t e q u i v a l e n t cou ld

have been deduced i n S2 , however, due t o t h e complexi ty of t h e asso-

c i a t e d e x p r e s s i o n s i t w o u l d h a v e b e e n much more d i f f i c u l t .

Now above t h e e q u i v a l e n c e o f t h e example programs w a s s a i d

t o be s o because of t h e Church-Rosser Theorem f o r t h e A-calculuses .

However t h e language E3

a s i t s t a n d s i s c e r t a i n l y n o t a A-calculus ,

i n p a r t i c u l a r , i t c o n t a i n s a h o s t of atoms and o p e r a t i o n s t h a t a r e

c e r t a i n l y n o t p a r t of t h e A-calculuses s e e n i n c h a p t e r 2 , f o r example:

numbers, numer ica l f u n c t i o n s and p r e d i c a t e s , t r u t h v a l u e s , t h e

' if---then---else--- ' f u n c t i o n , l s t , 2nd. and o r d e r e d p a i r s . I t can be

shown, however, t h a t a l l of t h e s e can be d e f i n e d i n terms o f t h e

A-calculus and t h u s can be c o n s i d e r e d t o be a b b r e v i a t i o n s f o r X-expres-

s i o n s a t which p o i n t t h e Church-Rosser Theorem h o l d s . A s most of t h i s

i s w e l l known and can b e found i n Church [CLC], Curry [CLg] and i n many

o t h e r p l a c e s , o n l y t h e t r e a t m e n t of t r u t h v a l u e s , l s t , 2nd, o r d e r e d

p a i r s , and t h e ' if---then---else--- ' f u n c t i o n w i l l be ske tched h e r e .

Page 199: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

R e c a l l i n g t h a t KXY 2. X and SKXY ' Y , l e t

t r u e f K ( o r Ax.Xy.x )

f a l s e SK ( o r hx.Ay.y )

Now i n o r d e r t o form a n o r d e r e d p a i r t h e o p e r a t o r D hx.hy.hz.zxy

due t o Church, is used , s o ,

(X,Y) r DXY (or Az.2 XY) . Noting t h a t DXYK r X and DXY(SK) ' Y t h e f u n c t i o n s 1st and 2nd

a r e d e f i n e d by

1st f Ax.xK ( o r SI(KK))

2nd E AX.X(SK) ( o r SI(K(SK))) . Then l s t ( X , Y ) 5 (Ax.xK)(DXY) 2 DXYK ' X and s i m i l a r l y f o r 2nd.

L e t t i n g (Z,X,Y) E DZ(DXY) and n o t i n g t h a t

(Ax.xz) (DXY) ' X , i f Z is t r u e (f K)

and - Y , i f Z is f a l s e ( Z SK)

one h a s

(Xx.x(lst(DZ(DXY))))(2nd(DZ(DXY))) 2 X , i f Z is t r u e

and 2 Y , i f Z is f a l s e . So t h e ' i f - - - then---else---' f u n c t i o n c a n be d e f i n e d by w r i t i n g

I f ( Z , X , Y ) E I f Z t h e n X e l s e Y

and s e t t i n g

I f 5 Xy. (Ax. ( 1 s t y ) ) (2nd y) .

D. Ex tens ions o f L

The l anguage L a s g i v e n above is n o t o f much i n t e r e s t a s a

p r a c t i c a l programming l anguage , as i t l a c k s many o f t h e f e a t u r e s

normal ly found i n a h i g h e r l e v e l l anguage . Some o f t h e most n o t a b l e

Page 200: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

omissions are go to's and labels, recursive statements, procedures,

and loops. A method of dealing with go to's and labels for S and 2

S is sketched below. These are chosen, in particular, because such 3

things as recursive statements, loops, etc. can be easily thought of

in terms of them. For other treatments of many related concepts, in

the context of A-expressions, see the work of Landin, McCarthy, Strachey,

and Scott and Strachey.

First, let the syntax of L be extended by adding the clause

go to [Il],in the production for [s], the clauses [R]:[s] and [%]:[a]

in the productions for Is] and [a], respectively, and the production

[Ill:: = 112131 ... . Now a program of L will have the form:

eo;!Ll:gl;el;R2:g2;eZ; ...; k! n n n :g ;e

where Ill, ..., L are productions and eo,el, ..., e are strings of n n

expressions and statements joined by ';' which have no labels and

gl' a - 4, are expressions or statements which have no labels. For

simplicity it will be assumed that 5 = 1 , k = 2 , etc. Further 2

if the last member of each of the strings e is not a 'go to' then i

it will be assumed that go to (i+l) is implicit.

Now, associated with each program is a function f of one

place defined by

f(0) + v'e ' 0

f(i) + v1g.;e' 1 i if i f 0

where v is either v or v depending upon whether one is working 2 3

in S2 or S 3 . To make this definition complete v has to be defined

Page 201: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

ments which have no l a b e l s , then

v 'go t o i ; e ' + f ( i ) . The d e f i n i t i o n o f f then l o o k s l i k e

f ( i ) + i f i = O then v ' e 0 '

i f i=l t h e n v ' g Pel

i f i = n t h e n v ' g . e ' . n' n

I f t h e r i g h t hand s i d e is c o n s i d e r e d t o be ( F ( f ) ) ( i ) then

The 'meaning' of t h e program is t h e n t a k e n t o be

YF(0) . Cons ide r t h e example:

4 : go t o 1;

5 : y ; END

where go t o ' s have been p l a c e d a t t h e end o f each s t a t e m e n t s a s was

82 where YF d e n o t e s t h e l e a s t f i x e d p o i n t of t h e f u n c t i o n a l F which e x i s t s by e i t h e r of t h e f i x e d p o i n t theorems of c h a p t e r t h r e e , s i n c e F is c o n t i n u o u s , b e i n g d e f i n e d by a composi t ion o f monotonic f u n c t i o n s .

Page 202: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

mentioned above . T h i s f u n c t i o n computes n! ( t h a t i s , n - ( n - 1 ) . ... - 2 . 1 ) .

Now f o r S o n e h a s a f t e r s i m p l i f i c a t i o n a f u n c t i o n f ( i ) o f t h e s t o r e 2

d e f i n e d by

f ( i ) + i f i = O t h e n (As.f(l)(A(l,y:A(n,x:s)))) else

i f i=1 t h e n (As. i f C(x:s)=O t h e n f ( 5 ) s e l s e f ( 2 ) s ) else

i f i = 2 t h e n (As.f(3)(A(C(x:s)-C(y:s),y:s))) e l s e

i f i = 3 t h e n (As.•’ ( 4 ) ( A ( C ( x : s ) - 1 , ~ : s ) ) ) e l se

i f i = 4 t h e n f ( 1 ) e lse

i f i = 5 t h e n ( A s . ( C ( y , s ) , * ) ) else w

So i n S 2 t h e meaning o f t h e program is g i v e n t o be t h e f u n c t i o n o f t h e

s t a t e

(W (0) ,

where ( F ( f ) ) ( i ) is t h e r i g h t hand s i d e o f t h e above d e f i n i t i o n , and

which f o r any s t a t e s g i v e s t h e f o l l o w i n g

(YF) (0) ( s ) ' n!

S i m i l a r l y f o r S 3 o n e o b t a i n s

f (i) + i f i = O t h e n (Ax. (Ay.f ( 1 ) ) l ) n e lse

i f i=l t h e n ( i f x=O t h e n f ( 5 ) e lse f ( 2 ) ) e l s e

i f i = 2 t h e n ( A y . f ( 3 ) ) ( x . y ) e lse

i f i = 3 t h e n (Xx.f ( 4 ) ) (x-1) e lse

i f i-4 t h e n f (1 ) e l s e

i f i = 5 t h e n (y,*) e l s e w . I f F is a f u n c t i o n a l which is s u c h t h a t ( F ( f ) ) ( i ) i s t h e r i g h t hand

s i d e o f t h e above d e f i n t i o n t h e n t h e e x p r e s s i o n a s s o c i a t e d w i t h t h e

program by Sg is t h e A-express ion

Page 203: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

which is such that

( Y F ) ( O ) 2 n! . (Note that F can be written

Xf .Xi. (----- 1,

where (----- ) is the right hand side of the definition and in that

form is more explicitly a A-expression.)

Page 204: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Conc l u s i o n .--

T h i s c o n c l u s i o n is n o t i n t e n d e d t o be complete a s t h e number

of p o i n t s made i n t h e t h e s i s is f a r t o o l a r g e t o pe rmi t t h e i r i n c l u -

s i o n h e r e . I n s t e a d a few c o n c l u d i n g remarks of a v e r y g e n e r a l n a t u r e

w i l l b e made c o n c e r n i n g t h e r e l a t i o n s h i p between t h e sys tems o f

combinatory l o g i c and A-conversion.

A number o f t h e a p p l i c a t i o n s o f t h e s e sys tems t o n o t i o n s of

computing s c i e n c e ' w e r e i n v e s t i g a t e d . Among t h e s e were t h e f o r m a l i z a -

t i o n of v a r i o u s c o n c e p t s c o n c e r n i n g t h e e v a l u a t i o n of r e c u r s i v e l y

d e f i n e d f u n c t i o n s . While i t was s e e n t h a t t h e sys tems p rov ided a

n a t u r a l i n t e r p r e t a t i o n o f c e r t a i n t y p e s o f programming language expres -

s i o n s , i t was e v i d e n t they would p robab ly n o t s u f f i c e f o r t h e t r e a t m e n t

o f many o t h e r t y p e s o f e x p r e s s i o n s w i t h o u t t h e i n t r o d u c t i o n o f o t h e r

n o t i o n s a l i e n t o t h e sys tems .

A s f o r t h e a p p l i c a t i o n s t o r e c u r s i v e d e f i n i t i o n s , t h e sys tems

p r o v i d e a v e r y s i m p l e c o n c i s e n o t a t i o n f o r working w i t h t h e s e d e f i n i -

t i o n s . Fur thermore , they p r o v i d e a method of f o r m a l i z i n g t h e concep t

of e v a l u a t i o n by b r i n g i n g i t w i t h i n t h e framework o f a sys tem i n which

fo rmal d e d u c t i o n s r e p l a c e t h e i n f o r m a l s t e p s of an e v a l u a t i o n , t h u s

one a b s t r a c t s from a number of i n t u i t i v e n o t i o n s a s s o c i a t e d w i t h e v a l u

a t i o n s . I t was a l s o s e e n , however, t h a t i n c e r t a i n c a s e s s p e c i a l

c o n s i d e r a t i o n s s t i l l had t o be made c o n c e r n i n g t h e c o u r s e of t h e

(now fo rmal ) e v a l u a t i o n s .

Page 205: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Annotated Bib l iography ---

The purpose of t h i s a n n o t a t e d b i b l i o g r a p h y is t o i n d i c a t e

t h e p o s i t i o n s , w i t h i n t h e t h e s i s , o f t h e r e f e r e n c e s i n t e rms of t h e i r

r e l e v a n c e t o t h e v a r i o u s t o p i c s i n t h e t h e s i s a s w e l l a s t h e i r p l a c e s

i n t h e more g e n e r a l c o n t e x t s o f mathemat ics and computing s c i e n c e .

While many o f t h e pr imary s o u r c e s have been r e f e r r e d t o w i t h i n t h e t e x t ,

t h e i r u s e w i l l b e reviewed h e r e . F u r t h e r , t h i s w i l l s e r v e t o p l a c e t h e

secondary s o u r c e s and t o p o i n t o u t u s e s of t h e p r imary s o u r c e s n o t

e x p l i c i t l y n o t e d w i t h i n t h e t e x t . Those r e f e r e n c e s which have had

a major i n f l u e n c e on t h e t h e s i s a r e i n d i c a t e d w i t h a n a s t e r i s k . T h i s

r ev iew w i l l b a s i c a l l y f o l l o w t h e o u t l i n e of t h e t h e s i s .

A s mentioned t h e r e , c h a p t e r 1 i s t a k e n p r i m a r i l y from v a r i o u s

works o f Curry . H i s [CFS] is concerned w i t h t h e t o p i c s o f $C and [PLF]

w i t h t h o s e of $ D w h i l e [CLg] I and TI? [APM], [ F M L ] ~ [LMF] d e a l w i t h

most of t h e t o p i c s i n c h a p t e r 1. Kleene [IMM], Rosenbloom [EML], and

Smullyan [TFS] a r e of i n t e r e s t w i t h r e s p e c t t o t h e c o n c e p t s o f fo rmal

sys tems and f o r m a l i z a t i o n .

Chap te r 2 a g a i n was based mainly on C u r r y ' s work ([CLg] I

and T I ) , however t h e t r e a t m e n t of c e r t a i n s p e c i f i c t o p i c s were i n -

s p i r e d by o t h e r s . I n p a r t i c u l a r t h e r e s u l t s c o n c e r n i n g t h e XI

c a l c u l u s e s come from Church [CLC] and c e r t a i n of t h e r e s u l t s concern-

i n g e x t e n s i o n a l i t y were from Hind ley , L e r c h e r , and S e l d i n [ICL]. For

someone i n t e r e s t e d i n X-conversion o r combinatory l o g i c , i n t r o d u c t o r y

t r e a t m e n t s of t h e s u b j e c t s c a n be found i n Hind ley , e t . a l . , [ ICL] ,

Rosenbloom [EML] and R o s s e r ' s o r i g i n a l paper [MLW]. Hindley i n [CPR],

Page 206: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

and [ AFC] d e a l s w i t h r e s u l t s c o n c e r n i n g t h e Church-Rosser Theorem, and

i n [SPC] w i t h t h e Normal Form Theorem. ohm combines n o t i o n s o f both

combinatory l o g i c and A-conversion t o form a language he c a l l s t h e CUCH

( a f t e r Curry-CHurch) i n [CFD] and [ICC]. He a l s o c o n s i d e r s some

p r o p e r t i e s of Brpnormal forms f o r t h e A-calculus i n [SPB]. I n o t h e r

d i r e c t i o n s Welch [CSI] i s concerned w i t h t h e e f f i c i e n c y of combinatory

and A-calculus r e d u c t i o n s , and Aho, S e t h i and Ullman [COF] and S e t h i

[TCR] c o n s i d e r a s p e c i a l i z a t i o n o f t h e Church-Rosser p r o p e r t y .

S e c t i o n A of c h a p t e r 3 is concerned l a r g e l y w i t h r e s u l t s t h a t

have grown o u t of S c o t t ' s i n i t i a l work c o n c e r n i n g t h e s e m a n t i c s of

programming l anguages . One of h i s o r i g i n a l p a p e r s i s [OMT]. The

n o t i o n s c o n t a i n e d t h e r e have been r e f i n e d a g r e a t d e a l by a number

of peop le and have been r e l a t e d t o many much earlier results , f o r

i n s t a n c e , K l e e n e 1 s f i r s t r e c u r s i o n theorem ( i n Kleene [IMM]). The

second s e c t i o n , B, b e g i n s w i t h a s u b s e c t i o n based p r i m a r i l y on C u r r y ' s

t h e o r y o f d e f i n i t i o n s ( i n [FML]) and on Kleene [IMM]. The e x t e n s i o n

t o call-by-name p a r a m e t e r s i n $ l b i n v o l v e s a number of peop le whose

work a l s o i n f l u e n c e d o t h e r p a r t s of $$1-4. DeBakker and and [ L F P ] ~

S c o t t [OMT], [LTP], [LFD], S c o t t and S t r a c h e y influ influenced much

of $$Blb ,c and $ $ ~ 3 , 4 w h i l e Manna [MTC]; [MTP], Manna and McCarthy

[PPP] , Landin [ M E E ] ~ and McCarthy [ ~ F s ] * a r e concerned more e x p l i c i t l y

w i t h S B ~ .

The o r i g i n a l m o t i v a t i o n f o r much o f t h e work i n c h a p t e r 3

was t h e development of sys tems t h a t made t h e p r o o f s o f v a r i o u s proper-

t i e s o f programs e a s y . The main i n f l u e n c e s o f $ ~ 4 were McCarthy

[ B M T ] ~ [TMs]? McCarthy and P a i n t e r [CCA] , M o r r i s [ARI], [CPU] , Manna

Page 207: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

19-1.

and McCartliy [PPP] , Manna [M'I'C], [MTP], Manna, Ness and Vui l lemin I LMP],

* Manna and Vui l lemin [FAT], Park [ F I P ] , Kosen [TMs], and S c o t t [I.TP].

The f o l l o w i n g a r e a l s o concerned w i t h such t h i n g s a s program c o r r e c t -

n e s s , t e r m i n a t i o n , e t c . , and have undoubtedly i n f l u e n c e d o r been

i n f l u e n c e d by many of t h e above. Floyd [AMP] was one of t h e f i r s t t o

a p p l y r e s u l t s of modern l o g i c t o t h e q u e s t i o n s of p r o v i n g p r o p e r t i e s

of programs, o t h e r s more l a t e l y o r i n d i r e c t l y concerned w i t h t h e

q u e s t i o n s a r e : B u r s t a l l and Landin [PTP], Cooper [PSE] and [PSP],

Ershov [TPs], Landin [MEE], [CBA] p a r t s 1 and 2 , [LCA], [FOA], McCarthy

[RFS], McCarthy and P a i n t e r [CCA] , McGowan [ IPT] , Milner [PsR], S c o t t

[OMT], [TMS], [LFD], and Wang [MMI].

Much of $C i s t aken from t h e r e f e r e n c e s g iven above t o c h a p t e r

2 , i n p a r t i c u l a r , Curry [CLgJI and Hindley [CRP], [AFC]. Other i m -

* p o r t a n t s o u r c e s a r e Rosen [TMS], Bra ine rd [TGR], and S e t h i [TCR]. Aho,

S e t h i , and Ullman [COF] is r e l a t e d i n t h a t i t d e a l s w i t h methods of

t e s t i n g f o r a s p e c i a l i z a t i o n of t h e Church-Rosser p r o p e r t y .

Chap te r 4 , which d e a l s w i t h t h e s y n t a x and s e m a n t i c s of pro-

gramming l a n g u a g e s , was i n f l u e n c e d by q u i t e a number of p e o p l e , however,

i t i s d i f f i c u l t t o d i v i d e them up w i t h r e s p e c t t o t h e s e c t i o n s of t h e

c h a p t e r . I n s t e a d , they a r e grouped h e r e rough ly i n t o t h e main t o p i c s

and c o n c e p t s covered by t h e c h a p t e r . A p a r t i c u l a r r e f e r e n c e is p l a c e d

i n t h e c a t e g o r y t h a t most c l o s e l y c o r r e s p o n d s t o what, w i t h r e s p e c t t o

t h e t h e s i s , i s i t s main p o i n t , and t h u s may i n v o l v e o t h e r t o p i c s n o t

s p e c i f i c a l l y i n d i c a t e d h e r e . Among t h e a u t h o r s t h a t provided t h e

o r i g i n a l d i r e c t i o n f o r much of t h i s work a r e McCarthy, Landin, S t r a c h e y ,

Page 208: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

lV8.

and Wegner and a s s u c h t h e i r works i n one way o r a n o t h e r c o v e r many of

t h e a s p e c t s o f c h a p t e r 4 and c h a p t e r 5 . The f o l l o w i n g p a p e r s c o n t a i n

material o f a n i n t r o d u c t o r y o r s u r v e y n a t u r e : Beth [OCC], Cheatham

[REP], D i j k s t r a [PCH], G i l l [CBP] , G i n s b e r g [SALI, Knuth [EFSI , S c o t t

[OMT], S c o t t and S t r a c h e y [TMS], s t a n d i s h [AEL] , and Schwar t z [sDM].

Those c o n c e r n e d p r i m a r i l y w i t h t h e q u e s t i o n o f f o r m a l i z a t i o n o f pro-

gramming l a n g u a g e s o r s y s t e m s , i n a more g e n e r a l c o n t e x t t h a n d e a l i n g

s p e c i f i c a l l y w i t h s y n t a x o r s e m a n t i c s , are: D i F o r i n o [CFL] , [LPP] ,

E l g o t [ATP], Knuth [EFS] , Lucas [FDP], and S t e e l [FsP]. The f o l l o w i n g

a r e c o n c e r n e d p r i m a r i l y w i t h t h e p r e s e n t a t i o n o f a f o r m a l i s m o f o n e

t y p e o r a n o t h e r , which i s d e s i g n e d w i t h t h e g o a l o f b e i n g a c c e p t a b l e

f o r u s e i n t h e i n t e r p r e t a t i o n o f h i g h e r l e v e l l a n g u a g e s : ohm [CFD],

[SPB], ohm and J a c o p i n i [FDT], G i lmore [ACL], [LGC], Landin [LCA],

[MEE], McCarthy [RFS] and S c o t t [LTD] and [LED]. Q u e s t i o n s c o n c e r n i n g

p r i m a r i l y s t r u c t u r e and s y n t a x a r e s u b j e c t s o f : B u r s t a l l [FDP],

E n g e l e r [sME], S t e a r n s [DTD], and VanWijngaarden [RDS]. S e m a n t i c s and

t h e f o r m a l i z a t i o n o f s e m a n t i c s are d i s c u s s e d i n : E l g o t [ROA], [ATP],

* * E n g e l e r [SME], F loyd [AMP], I g a r a s h i [SAL], Lucas [SPL] , S c o t t [OMT],

S t e e l [FSP] , Vanwi jngaarden [RDS], and Woodger [SLP]. Those conce rned

more s p e c i f i c a l l y w i t h a p a r t i c u l a r method o f f o r m a l l y s p e c i f y i n g

s e m a n t i c s a r e : B a l l a r d and T s i c h r i t z i s [TP] , BekiE and Walk [FSP] ,

* * Garwick [DPL], Needham [SPM], S c o t t [LTD], [LFD], S c o t t and S t r a c h e y

* [TMS], and Wi lne r [FSD] . F i n a l l y , t h e f o l l o w i n g p a p e r s are conce rned

w i t h v a r i o u s c o n t r i b u t i o n s t o f o u n d a t i o n s o f t h e s c i e n c e o r t h e o r y o f

* * * * * c o m p u t a t i o n : Landin [LCA], [MEE], McCarthy [TMS], [BMT], [PTCI, Manna

* * * * * [MTC], S c o t t [OMT], [LTD], [LFD], S c o t t and S t r a c h e y [TMs], and Wegner

[PLI ] and [ P S I ] .

Page 209: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

A s c h a p t e r f i v e is an i l l u s t r a t i o n of t h e f o r m a l i z a t i o n of

v a r i o u s p a r t s o f t h e s e m a n t i c s of a s i m p l e programming language made

up f o r t h a t purpose i t is hard t o p o i n t o u t any d i r e c t i n f l u e n c e s .

* The major i n f l u e n c e s i n t h e fo rmat ion o f S2 a r e McCarthy [TMS],

* * * [BMT], S c o t t [OMT], and S c o t t and S t r a c h e y [TMS]. A s f o r

S 3 , * *

Landin [MEE], [CBA] p a r t s I and 11, and [LCA] a r e p robab ly t h e most

c l o s e l y r e l a t e d .

The f o l l o w i n g p a p e r s a r e i n c l u d e d h e r e because t h e y a r e

invo lved more o r l e s s w i t h t h e same t a s k a s c h a p t e r 5. Those concerned

w i t h t h e f o r m a l i z a t i o n o r d i s c u s s i o n of a c e r t a i n c l a s s o f programming

t y p e e x p r e s s i o n s , s h o r t o f a n e n t i r e l anguage a r e : deBakker [ASS],

McCarthy [RFS], and Wulf [PwG]. Those concerned w i t h c e r t a i n c o n c e p t s

of t h e f o u n d a t i o n s o f computing s c i e n c e a r e : ohm and J a c o p i n i [FDT],

BekiZ and Walk [FSP], E lgo t [ATP], McCarthy [RFS], [TMS], [BMT], and

S c o t t [OMT]. The f o l l o w i n g a r e concerned w i t h t h e f o r m a l i z a t i o n of

t h e s e m a n t i c s o f a n e n t i r e programming language mainly f o r i l l u s t r a t i v e

purposes : Gilmore [ACL], [LGC], Knuth [EFS], Landin [CBAII and 11,

[FDA] and McCarthy [FDS]. F i n a l l y , Naur [RRA] is t h e r e v i s e d r e p o r t

on Algol 60 c o n t a i n i n g bo th t h e s y n t a x ( f o r m a l ) and s e m a n t i c s ( i n f o r m a l )

f o r t h a t l anguage , Nivat and Nol in [CDA] is concerned w i t h some ques-

t i o n s c o n c e r n i n g i t s s e m a n t i c s , and Knuth [RTS] i s a r e p o r t aimed a t

c l e a r i n g up a number of m i s t a k e s and a m b i g u i t i e s of Naur [RRA].

Page 210: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

BIBLIOGRAPHY

Journals are abbreviated according to the practice of Mathematical Reviews. A two or three letter abbreviation of the title of each entry enclosed by brackets precedes each title entry. In the thesis,citations to a particular work are made by the author's name and the abbreviated title in brackets. The titles are listed alphabetically under each author.

Two exceptions to the rule concerning citations are Curry, H.B., and Feys, R. [CLgII and Curry, H.B., Hindley, J., and Seldin, J. [CLgIlI, which are cited as Curry [CLgII and Curry [CLglII, respectively.

Aho, A.V., Sethi, R., and Ullman, J.D. [COF] Code optimization and finite Church-Rosser systems. Design and optimization of compilers. Prentice-Hall, N.J., 1972, pp. 89-106.

Ballard A., and Tsichritzis, D. [TP] Transformations of programs. .- Information Processing 71 vol. I, North-Holland Publishing Company, Amsterdam, 1971, pp. 414-418.

BekiZ, H., and Walk. K. [ FSP] Formdikt ion of storage properties. Symposium on semantics of algorithmic languages, Springer-Verlag, New York, 1971, pp. 28-61.

Beth, E. [OCC] Observations concerning computing, deductions, and heuristics. Computer programming and formal systems, North-Holland Publishing Company, Amsterdam, 1963, pp. 21-32.

~Ghrn, C. [CFD] The CUCH as a formal and description language. Formal language description languages, North-Holland Publishing Company, Amsterdam, 1966, pp. 179-197.

[SPB] Some properties of Bq-normal forms in XK-calculus. Transla- tion by C. Wadsworth of Alcune propried della forme B-q-normali del A-K-calcolo, Consiglio Nazionale della Ricerche, Roma, 1968.

ohm, C. , and Gross, W. [IC] ~ntroduction to the CUCH. - Proceedings of the international summer school on automata theory, Ravello, Rome, 1964.

Page 211: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

~ i i h r n , C. , and Jacopini , G. [FIYl] Flow diagrams, turing machines and languages with only two format ion rules. Comm. ACM, 9, No. 5, May 1966, pp. 366-371.

Brainerd, W.S. [TGR] Tree generating regular systems. Information - and -- - - - - Control, 14, 1969, pp. 217-231.

Burstall, R. [FDP] Formal description of program structure and semantics in first order logic. Machine Intelligence, 5, 1970, pp. 79-98.

Burstall, R., and Landin, P. [PTP] Programs and their proofs: an algebraic approach. Machine Intelligence, 4, 1969, pp. 17-44.

Cheatham, T. [REP] The recent evolution of programing languages. Information Processing 71 vol. I, North-Holland Publishing Company, Amsterdam, 1972, pp. 298-313.

Church, A. [CLC] The calculi of lambda-conversion. Ann. Math. Studies, no. 6, Princeton, N.J., 1941.

Cooper, D. [PSE] Program scheme equivalences and second order logic. Machine Intelligence, 4, 1969, pp. 3-16.

[PSP] Program schemes, programs and logic. Symposium on semantics of algorithmic languages, Springer-Verlag, New York, 1971, pp. 62- 70.

Curry, H.B. [APM] Some aspects of the problem of mathematical rigor. Bull. Amer. Math. Soc., 47, 1941, pp. 221-241.

[CFS] Calculuses and formal systems. Dialectica, 12, 1958, pp. 249-273.

[FML] - Foundations of mathematical~logic. McGraw-Hill Book Company, Inc., New York, 1963.

[LMF] Language, metalanguage, and formal system. Philos. Rev., 59, 1950, pp. 346-353.

[PLF] The purposes of logical formalization. Logique et Analyse, 11, 1968, pp. 357-366.

Page 212: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Curry, H.B., and Feys, K. [CLg] J Combinatory Logic. vol. I, North-Hol land Publishing Company, ~msterdam, 1958.

Curry, H.R., Hindley, J., and Seldin, J . [CLglII Combinatory Logic. vol. 11, North-Holland Publishing Company, Amsterdam, 1972.

DeBakker, J. [ASS] Axiom systems for simple assignment statements. Symposium on semantics of algorithmic languages, Springer-Verlag, New York, 1971, pp. 1-22.

[LFP] Least fixed points revisited. Proceedings of the symposium on A-calculus and computer science theory. Consiglio Nazionale delle Ricerche, Roma, 1975, pp. 1-35.

[PLC] A property of linear conditionals. Symposium on semantics of algorithmic languages, Springer-Verlag, New York, 1971, ppl 23-27.

[RP] Recursive procedures. Mathematical Centre Tracts, 24, Amsterdam, 1971.

DiForino, A.C. [CFL] On the concept of formal linguistic systems. Formal language description languages. North-Holland Publishing Company, Amsterdam, 1966, pp. 37-51.

[LPP] Linguistic problems in programming theory. Information Processing 65, North-Holland Publishing Company, Amsterdam, 1965.

Dijkstra, E.W. [PCH] Programming considered as a human activity. Information Processing 65, North-Holland Publishing Company, Amsterdam, 1965.

Elgot, C. [ROA] Remarks on one argument program schemes. Formal semantics of programming languages. Prentice-Hall, N.J., 1970.

[ATPI Algebraic theories and program schemes. Symposium on semantics of algorithmic languages, Springer-Verlag, New York, 1971, pp. 71-88.

Engeler. E. [SME] Structure and meaning of elementary programs. Symposium on semantics of algorithmic languages, Springer-Verlag, New York, 1971, pp. 89-101.

Page 213: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Floyd, R . [AMP] Assigning meanings to programs. Mathematical aspects -of computer science, - American Mathematical Society, R.I., 1967, pp. 19-32.

Garwick, J. [DPL] The definition of programming languages by their compilers. Formal language description languages. North-Holland Publishing Company, Amsterdam, 1966, pp. 139-147.

Gill, D. [CBP] Changing basis of programming. Information Processing 65, .North-Holland Publishing Company, Amsterdam, 1965.

Gilmore, P.C. [ACL] An abstract computer with a lisp-like machine language with- out a label operator. Computer programming and formal systems. North-Holland Publishing Company, Amsterdam, 1963, pp. 71-86.

[LGC] The lambda-gamma calculus: a language adequate for defining recursive functions. Information Sciences, 2, 1970, pp. 111-126.

Ginsberg, S. [SAL] Survey of Algol-like and context-free language theory. Formal language description languages. North-Holland Publishing Company, Amsterdam, 1966, pp. 86-99.

Hindley , J. R. [AFC] An abstract form of the Church-Rosser theorem. J. Symbolic Logic, 34, 1969, pp. 545-560.

[CRP] The Church-Rosser property and a result in combinatory lopic. Thesis, Newcastle upon Tyne, 1964.

Hindley, J.R., and Lercher, B. [SPC] A short proof of Curry's normal form theorem. Proc. Amer. Math. Soc., 24, 1970, pp. 808-810.

Hindley, J.R., Lercher, B., and Seldin, J. [ICL] Introduction to combinatory logic. Cambridge at the University Press, Cambridge, 1972.

Hoare, C. [PPA] Procedures and parameters: an axiomatic approach. Symposium on semantics of algorithmic languages, Springer-Verlag, New York, 1971, pp. 102-116.

Igarashi, S. [SAL] Semantics of Algol-like statements. Symposium on semantics of algorithmic languages, Springer-Verlag, New York, 1971, pp. 117-177.

Page 214: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

K l e c n c , S.C.

I IMM] Introduct-i~n- to metamathematics. North-Holland Pub1 ishing Company, Amsterdam, 1971.

Knuth, D. [EFS] Examples of formal semantics. Symposium on semantic_~~of algorithmic languages, Springer-Verlag, New York, 1971, pp. 212-235. -

[RTS] Remaining trouble spots in Algol 60. Comm. ACM, 10, No. 10, 1967, pp. 611-618.

Landin, P . J . [CBA]I,IT A correspondence between Algol 60 and Church's lambda- notation: parts T and IT. Comm. ACM, 8, Nos. 2 and 3, 1965, pp. 89-101, 158-165.

[FDA] Formal description of Algol 60. Formal language description languages. North-Holland Publishing Company, Amsterdam, 1966, pp. 266-294.

[LCA] A A-calculus approach. Advances in programming and non- numerical computation. Pergamon Press, New York, 1966.

[MEE] The mechanical evaluation of expressions. Computer J., 6, 1964, pp. 308-320

[PMS] A program machine symetric automata theory. Machine Intelligence, 5, 1970, pp. 99-120.

Lucas, P. [FDP] Formal definition of programming languages and systems. Information Processing 71, North-Holland Publishing Company, Amsterdam, 1971, pp. 291-297.

[SPL] On semantics of programming languages and software devices. Formal semantics of programming language?. Prentice-Hall, N.J., 1970.

McCarthy, J. [BMT] Basis of a mathematical theory of computation. Computer programmingandormal systems, North-Holland Publishing Company, Amsterdam, 1963, pp. 33-70.

[FDS] A formal description of a subset of Algol. Formal language description languages. North-Holland Publishin Company, Amsterdam, 1966, pp. 1-12.

[PTC] Problems in the theory of computation. Information Processing 6 5 , Nort h-Holland Publ ishing company, Amsterdam, 1965, pp. 219-222.

Page 215: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

[RFS] Recursive functions of symbolic expressions and their compu- tation by machines. Comm. ACM, 3, no. 4, 1960, pp. 184-195.

[TMS] Towards a mathematical science of computation. Information .- - - -

Processing 62, North-Holland Publishing Company, Amsterdam, 1962, pp. 21-28.

McCarthy, J., and Painter, J . [CCA] Correctness of a compiler for arithmetic expressions. Mathematical aspects of computer science. American Mathematical Society, R.I., 1967, pp. 33-48.

McGowan, C. [IPT] Inductive proof techniques of interpretational equivalence. Formal semantics of programming languages. Prentice-Hall, N. J . , 1970.

Manna, Z. [MTC] Mathematical theory of computation. McGraw-Hill, New York, 1974.

[MTP] Mathematical theory of partial correctness. Symposium on semantics of algorithmic language, Springer-Verlag, New York, 1971, pp. 252-269.

Manna, Z., and McCarthy, J. [PPP] Properties of programs and partial function logic. Machine Intelligence, 5, 1970, pp. 27-38.

Manna, Z., Ness, S., and Vuillemin, J . [IMP] Inductive methods for proving properties about programs. Corn. ACM, 16, 1973, pp. 491-502.

Manna, Z., and Vuillemin, J. [FAT] Fixed-point approach to the theory of computation. Comm. -- ACM, 15, 1972, pp. 528-536. -

Milner, R. [PSR] Program schemes and recursive function theory. Machine Intelligence, 5, 1970, pp. 39-58.

Morris, J. [ARI] Another recursion induction principal. Corn. ACM, 14, no. 5, 1971, pp. 351-354.

[CPU] A correctness proof using recursively defined functions. Formal semantics of programming languages, Prentice-Hall, N.J., 1970.

Page 216: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

Naur, P. [RM] (ed.) Revised report on the algorithmic language Algol 60. Corn. ACM, - 3, 1960, pp. 299-314.

Needham, R. [SPM] Semantic problems of machine translation. Information - Processing 65, North-Holland Publishing Company, Amsterdam, 1965.

Nivat, M., and Nolin, N. [CDA] Contribution to the definition of Algol semantics. Formal language description languages. North-Holland Publishing Company, Amsterdam, 1966, pp. 148-159.

Park, D. [FIP] Fixpoint induction and proofs of program properties. Machine Intelligence, 5, 1970, pp. 59-78.

Rosen, B. [TMS] Tree-manipulating systems and Church-Rosser theorems. J. Assoc. Comput. Mach., 20, no. 1, 1973, pp. 160-187.

Rosenbloom, P. [EML] The elements of mathematical logic. Dover Publications, New York, 1950.

Rosser, J.B. [MLW] A mathematical logic without variables. Ann. of Math., 36, no. 1, 1935, pp. 127-150.

Sanchis, L. E. [FDR] Functionals defined by recursion. Notre Dame Journal of Formal Logic, VTII, no. 3, 1967, pp. 161-174.

Schwartz, J.T. [SDM] Semantic definition methods and the evolution of programming languages. Formal semantics of programming languages. Prentice- Hall, N.J., 1970.

Scott, D. [LFD] The lattice of flow diagrams. Symposium on semantics of algorithmic languages, Springer-Verlag, New York, 1971, pp. 311-366.

[LTD] Lattice theory, data types and semantics. Formal semantics of programming languages. Prentice-Hall, N.J., 1970.

[OMT] Outline of a mathematical theory of computation. Proceedings of the 4th Princeton conference on information sciences and systems, Department of Electrical Engineering, Princeton University, N.J., 1970, pp. 169-176.

Page 217: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

scott, D., and Strachey, C. [TMS] Towards a mathematical semantics for computer languages. Proceedings of the symposium on computers and automata. Poly- technic Institute of Brooklyn, 1971, pp. 19-46.

Sethi, R. [TCK] Testing for the Church-Rosser property. J. Assoc. Comput. Mach., 21, no. 4, 1974, pp. 671-679.

Smallyan, R.M. [TFS] Theory of formal systems. Ann. Math. Studies, - no. 47, Princeton, N. J., 1961.

Standish, T.A. [AEL] After extensible languages - what next? Proceedings of - the 5th Princeton conference on informat ion sciences and systems, Department of Electrical Engineering, Princeton University, N.J., 1971, pp. 189-192.

Stearns, S. [DTD] Deterministic top-down passing. Proceedings of the 5th Princeton conference on information sciences and systems, Department of Electrical Engineering, Princeton University, N.J., 1971, pp. 171-188.

Steel, T.B. [FSP] A formalization of semantics for programming language description. Formal language description languages. North- Holland Publishing Company, Amsterdam, 1966, pp. 25-36.

Strachey, C. [TFS] Towards a formal semantics. Formal language description languages. North-Holland Publishing Company, Amsterdam, 1966, pp. 198-220.

VanWijngaarden, A. [RDS] Recursive definition of syntax and semantics. Formal language description languages. North-Holland Publishing Company, Amsterdam, 1966, pp. 13-24.

Wang, H. [MMI] Mechanical mathematics and inferential analysis. Computer programming and formal systems, North-Holland Publishing Company, Amsterdam, 1963, pp. 1-20.

Wegner, P. [PLI] Programming languages, information structures, and machine organization. McGraw-Hill, New York, 1968.

Page 218: On some applications of combinatory logic and lambda … · 2017-09-22 · combinatory logic and A-conversion is authoritative. Chapter 2 is an introduction to combinatory logic and

[PIS] Programming language semantics. - Formal - - semantics - -- . - oQro- - -- &ramming languages. Prentice-Hall, N . . J . , 1970.

[PSI] Program schemes and information structure models. Proceed- i= of the 5th Princeton conference on information sciences and systems, Department of Electrical Engineering, Princeton Univer- sity, N.J., 1971, pp. 171-176.

Welch, P.H. [CSI] Continuous semantics and inside-out reductions. Proceedings of the symposium on A-calculus and computer science theory. Consiglio Nazionale delle Ricerche, Roma, 1975, pp. 93-117.

Wilner, W. [FSD] Formal semantics definitions using synthesized and inherited attributes. Formal semantics of programming languages. Prentice- Hall, N.J., 1970.

Woodger, M. [SLP] On semantic levels in programming. Information Processing 71, vol. I, North-Holland Publishing Company, Amsterdam, 1972, - pp. 402-407.

Wulf, W. [PWG] Programming without the go-to. Information Processing 71, vol. I, North-Holland Publishing Company, Amsterdam, 1972, pp. 408-413.