A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree...

19
A system of lambda-calculus possessing facilities for typing and abbreviating Citation for published version (APA): Nederpelt, R. P. (1979). A system of lambda-calculus possessing facilities for typing and abbreviating: part 1 : informal introduction. (Eindhoven University of Technology : Dept of Mathematics : memorandum; Vol. 7902). Eindhoven: Technische Hogeschool Eindhoven. Document status and date: Published: 01/01/1979 Document Version: Publisher’s PDF, also known as Version of Record (includes final page, issue and volume numbers) Please check the document version of this publication: • A submitted manuscript is the version of the article upon submission and before peer-review. There can be important differences between the submitted version and the official published version of record. People interested in the research are advised to contact the author for the final version of the publication, or visit the DOI to the publisher's website. • The final author version and the galley proof are versions of the publication after peer review. • The final published version features the final layout of the paper including the volume, issue and page numbers. Link to publication General rights Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights. • Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain • You may freely distribute the URL identifying the publication in the public portal. If the publication is distributed under the terms of Article 25fa of the Dutch Copyright Act, indicated by the “Taverne” license above, please follow below link for the End User Agreement: www.tue.nl/taverne Take down policy If you believe that this document breaches copyright please contact us at: [email protected] providing details and we will investigate your claim. Download date: 21. Apr. 2020

Transcript of A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree...

Page 1: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

A system of lambda-calculus possessing facilities for typingand abbreviatingCitation for published version (APA):Nederpelt, R. P. (1979). A system of lambda-calculus possessing facilities for typing and abbreviating: part 1 :informal introduction. (Eindhoven University of Technology : Dept of Mathematics : memorandum; Vol. 7902).Eindhoven: Technische Hogeschool Eindhoven.

Document status and date:Published: 01/01/1979

Document Version:Publisher’s PDF, also known as Version of Record (includes final page, issue and volume numbers)

Please check the document version of this publication:

• A submitted manuscript is the version of the article upon submission and before peer-review. There can beimportant differences between the submitted version and the official published version of record. Peopleinterested in the research are advised to contact the author for the final version of the publication, or visit theDOI to the publisher's website.• The final author version and the galley proof are versions of the publication after peer review.• The final published version features the final layout of the paper including the volume, issue and pagenumbers.Link to publication

General rightsCopyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright ownersand it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights.

• Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain • You may freely distribute the URL identifying the publication in the public portal.

If the publication is distributed under the terms of Article 25fa of the Dutch Copyright Act, indicated by the “Taverne” license above, pleasefollow below link for the End User Agreement:www.tue.nl/taverne

Take down policyIf you believe that this document breaches copyright please contact us at:[email protected] details and we will investigate your claim.

Download date: 21. Apr. 2020

Page 2: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

EINDHOVEN UNIVERSITY OF TECHNOLOGY

Department of Mathematics

Memorandum 1979-02

March 1979

A system of lambda-calculus possessing facilities

for typing and abbreviating

Part I: Informal introduction

University of Technology

Department of Mathematics

PO Box 513, Eindhoven

The Nether lands

by

R.P. Nederpelt

Page 3: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

contents

- Abstract and acknowledgement

- Introduction into the basic principles of lambda-calculus

- Informal description of an unorthodox lambda-calculus system

a) terms

b) name-free notation

c) reference transforming mappings

d) segments, weights

e) types, norms

f) reductions

g) tree representation

- Re f erences

Abstr act and acknowledgement

This is part I of c. coherent series in which a system of lambda­

calculus will be described containing facilities for typing and

abbreviating. In this part we shall give an inf onmal explanation

of the system and its properties.

We begin by introducing the basic p rinciples of lambda calculus in

a h ighly informal fashion. After this we describe various aspects

of our system, in the first place those on a purely notational level.

We gradually develop a deviating style of writing lambda-calculus

f ormulae and give arguments justifying the change of notation. We

s hall also discuss a form of namefree notation for terms; the first

ide as in this direction originate from De Bruijn (see [5J).

In the second half of part I, starting in subsection d, we shall

discuss more substantial subjects. In subsection d we extend the

abbreviating facilities already present in systems of lambda-calculus.

By this means one may render, for example, a list of parameters, or

a sequence of functional arguments, by a single variable.

Matter s of theoretical importance essential to any system of lambda-calculus

will be discussed in subsections e and f.

Page 4: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

- 2 -

These deal with reduction and typing , andassociatedmatters concerning

functionality, interpretability and normal forms . We conclude part I

by sketching the relation between the l i nearly written representation

of terms in the system, and a tree representation.

The development of the system presented was founded on recent work

by De Bruijn, particularly [6J and [7J. The author feels greatly

indebted to him for his inspiring ideas. The present article would not

h ave been accomplished without De Bruijn's prior investigations.

Introduction into the basic principles of lambda-calculus

Lambda-calculus formalizes the common concepts of function and function

application, in a general setting. Objects in lambda-calculus are

called terms. These can be thought of as being functions, arguments

of functions, or a mixture of both. Reduation (sometimes called B-reduction)

is formally defined as a relation between terms; intuitively, one rather

considers reduction as a process, leading from one term to another. More

concr etely, one may conceive of reduction as being the formalization of

t he transformations connected with the application of a function to an

argument.

We shall show how the common manipu l a tions of functions and

arguments l ook when translated into the language of lambda-calculus.

Let T be some term, containing f r ee occurrences of the variable x. Then

the f unction f that sends x to T may be written as A [TJ in lambda-x

calculus language. This construction of the function A [TJ from the x

t erm T is called abstraation. Here A becomes binder of all free x's x in T.

On the other hand, one may provide a term U (possibly representing

some function) with an argument A; we then write {U}(A). The construction

of {U}(A) from U and A is calleq appZiaation. In the case that U has

the appearance of a fun ction, i.e. U = A [TJ, application yields a term x

of the form {AX[TJ} (A) • As one might expect, the confrontation of function

AX[ TJ and argument A starts a proces leading to s~ T, which term is the

Page 5: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

- 3 -

result of the substitution of A fo r x in T. This process is called

reduction; one writes {A [TJ}(A) > S~. x x

In an example we shall compare the language of lambda-calculus to the

or dinary notational treatment of functions and arguments. Take T to

be the ari thmetical expression x2 + 5 and let A be the number 2. Then 2 A [TJ represents the function f that sends x to x + 5. Moreover,

x {A [ TJ }(A) denotes f(2). The reduct ion { A [TJ} (A) > S~ then becomes

x 2 x x the identi ty f(2) = 2 + 5 . (This i s the first step of the calculation

that even t ually leads to f (2) = 9.)

Note that both processes, reduction and calculation, are directed from

left to right. So the (asymmetric) >-sign seems more appropriate than

the =-s i gn when reduction itself becomes one of the subjects of study,

as is the case in lambda-calculus. One may say that there is, in the

usual conception, only one function value for a given function and

a given argument, although this value may be written in different forms 2

(her~ as f(2) , 2 + 5 or 9); in lambda-calculus, however, one distinguishes

between the various "stages of calculation" and one investigates the

underlying process.

For a formal description of lambda-calculus: see [lJ.

Page 6: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

- 4 -

Informal description of an unorthodox lambda-calculus system

In this section we shall develop a system of lambda-calculus that

deviates in some respects from the usual systems. The deviations

originate from the following bas i c conceptions:

1) the coding of terms should be consistent, well-organized and

appropriate for formal manipulations,

2) terms should behave well with respect to reducti ons.

In presenting our system we shall p ay attention to these vaguely

f ormul ated wishes. The former gives rise to some notational deviations,

which we shall explain in the forthcoming subsections a-c. The latter

wi l l lead us to a form of typing that has i ts effect on reductions,

in particular with respect to "interpretability" and "normalizability"

(see subsections e and f) .

a. ter ms

Lambda- calculus is essentially a system of functional abstraction and

applicat ion. Hence we wish to have at our dispos al two basic facilities

for bui l ding new terms from a given term T: one for making the ab­

stract i on from T by means of a binding quantor AX; the other for the

appl ication of T to an argument A. These term-forming operations were

origina lly expressed by A [ TJand {T} (A), respectively ; cf . Church, [2J. x

Abs tract ion and application are inve rses as to the i r "meaning": on the

one hand , one may construct function A [TJ from value T, on the other x

hand val ue {T}(A) from function T. This duality is also reflected in

the mechanism of (S-)reduction , which causes a binding quantor A to x

"merge with" an argument Ai {A [T]} (A) > SAT. x x

In our notation we shall express that abstraction and application are

similar operations . For example, we wr i t e (A )T and (Ao)T, respectively; x

t he symbol 0 is used as a marker for an argument . Note that we invert

the usual order of function and argument by writing (Ao)T for {T}(A).

Page 7: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

- 5 -

We shall now briefly comment on this commutation.

In the usual notation, a string of successive abstractions and applications

may appear as in the following example :

One obtains this term from T by successively adding AX' Al

, A2 , Ayand

A3 as binding quantors or arguments . In our notation, however, the

above term is written as follows:

This appearance transparently reflects the process of term-formation

described just now. Moreover, the binding quantor A and the argument x

A1

, ready to be merged in a reduction, occur adj acently; the same holds

f or Ay and A3

(An analogously deviating notation is employed in the mathematical

l anguage Automath and similar systems; see for example [4J and [8J.)

b. name free notation

The use of letters ("names" ) for bound and binding variables in lambda­

cal culus is a continuous nuisance. The letter x , appearing as binding

variab l e in A [TJ, merely serves as a reference point for variables x

x that are free in T (so bound in A [TJ). Of course one wishes to x r e gar d A [TJ and A [sy T J as "equal", since it is only the bond x y x be tween binding and bound variables that matters. In order to make this

"rewri ting" possible, one has invented the mechanism of crreduction,

thus burdening lambda-calculus with an improper feature.

It is not forbidden in lambda-calculus to use the same name for

variables different in meaning. In prinCiple, there is no objection

t o terms like {A [A [yJJ}(y). In a natural interpretation there are y y

three different y's involved in this term, which may be seen by re-

wri ting it as {Ay ~y [Y2]]}(Y3)' It will be clear, however, that such

terms can easily §i v~ rise to mistakes .or mis-interpretations.

Page 8: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

- 6 -

In particular, the substitution of a term containing a free x in a term

containing a binding x (possibly a "different" var iable ! ) may cause

undes i r able effects. Such an event is sometime s cal led" clash of variables".

I t can easily occur in the process of S-reducti on, by which a term (and

its vari ables) may be multiplied i n di f f e rent p l aces. cumbersome pre­

cautions have to be taken in order to prevent these effects. This is

another annoying consequence of referencing by means of names.

The above-mentioned difficulties, arising from the use of names for

variabl es, lead us to prefer a name-free presentation of lambda-calculus.

Tha t is to say, in the technical description. In explanations we maintain

names, s ince names are more suitable for conveying comprehension. We

are aware, of course, that the choice between name-containing and name­

free forms has merely to do with presentation, being certainly of minor

importance for the system as such.

We s hall now explain a possible way of making terms name-free. Imitating

De Bruijn to some extent, we shall dispose of letters (names) for

variabl es , using natural numbers for describing the references. In each

ter m, we replace bound variables by referenee numbers. As reference points

we t ake "binding symbols" (for the time being these are only A's). The

reference number indicates the place in the term where the appropriate

r e ference point may be found: we merely count the number of "primitive

s ymbols" that separate bindi ng instance and bound i nstance in the term.

(For the time being, we take 6 ' s and A'S as primitive symbols.)

An examp le will make this clear. Conside r the fo l lowing term, written

in Church ' s notation:

A [{A [{y}(Z)]}(A [{z}(x)])] . Z y x

When us i ng our notation introduced in subsection (a) (still employing

names for variables), we obtain

(A ) ( (A ) (x 6) z6) (A ) (z 6) y • Z x y

Now the name- free version of the latter term will be:

(A) «A) «1) 6) (3) 6) (A) «5) 6) (2) •

(The name- f ree notation can easily be extended to terms containing free

variabl es, by adding imaginary binding quantors in front of the term, one

binding quantor for each free variable, and following the same procedure

Page 9: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

- 7 -

as above. Cf. De Bruijn, [7J.)

We might have restricted ourselves t o counting only A' S in the process

of finding the reference point of a certain bound variable. However, some

of t he r ules that we shall explain l ater, may be e xpressed more smoothly

if we agree upon a system of referencing in the above manner.

We final ly note that in both the name-containing and the name-free

version, terms have a plural ly nested structure as concerns the brackets.

For example , the part «A) «1)0) (3)0), appearing above, contains three

sub-nests: (A), « 1) 0) and (3).

c. re f erence transforming mappings

When man i pulating any name-free term, e . g . by applying reduction, one has to

reconsider the reference numbers, in order to maintain the right

bond between binding and bound variables. For this reason we shall intro­

duce a few reference transforming mappings. The most important one we

shall call ~k,~' a function (operator) with integer parameters k ~ 0 and ~ ~ O.

A reference transforming mapping like ~ may be inserted somewhere inside k,~

a term. Its action may be described as follows. From the place of insertion,

the operator has to be shifted to the right through the term,with two

effects: (1) ~k,~ changes into ~k+1 , ~ in passing a primitive symbol, (2) ~k,~

acts as a function when reference numbers are passed, namely: ~k~(n) := n + ~

if n > k, or e l se ~k,~(n) := n.

Sometimes we wish to restrict the range of action of such a ~k,~. For this

purpos e we may insert a symbol t in the term at an appropriate place. We

agree that the operator ~k,~ vanishes on encountering a symbol t; otherwise,

~k,~ vanishes at the end of the term.

The effect of the insertion of ~k,~ at a certain place in a term (let us

call that place P, for a moment) can be described in words as follows.

A re f e r ence number n occurring at the r i ght of P (and not separated from P

by any symbol t) changes into n + ~ , if and only if (1) the reference point

A of n occurs to the left of P and (2) there are at least k primitive

symbols between that A and P.

Page 10: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

- 8 -

d . segments, weigths

Each system of lambda-calculus embodies the facility of making abbreviations

(or definitions). For example , if one wishes to abbreviate, in a term T,

some subterm X by the "let~er" x (or define x as X), one may write (Xo) (A ) at x

a.'1 appropria'te place in T; the "meaning" X then may be assigned to each

occurrence of a variable x b01.::'1d by this A • For, the execution of the x

reduction (Xo) (A )U > SX U has the effect that all occurrences of x are x X

replaced by X.

In applying some system of lambda-calculus in a practical situation,

for e xample in using it for expressing some part of mathematics, one

hits upon the need for abbreviations in other cicumstances as well. For

example, a string of binding quantors(which represents some kind of

"context~1 e.g. a list of parameters) or a string of arguments (being a

"compound" argument for some function of several variables) may occur

so often, that an abbreviation is useful. De Bruijn calls such strings

segments.

We shall incorporate a possibility for the abbreviation of segments by

introducing a new primitive symbol a and extending the definition

of te rm-formation as follows. (We provide the description for the name­

f ree presentation.)

As we saw previously, a term in our notation is a plurally nested

s tructure , each nest being bounded by a pair of brackets. We call such

a nest a (term-)part. Parts of the form (A) and (AO) we call A-parts

and ~-parts, respectively. We now introduce a-parts having the form (Ba),

and re f-parts of the form (k, Q,); we agree that both may be embodied in

a t erm. (We note that the meta-lingual symbols A,B, ••• represent terms;

such a term may also be the "empty term".)

A ref-part (k,Q,) is a pair of numbers , k (~ 1) being a reference number

referri ng to some a appearing in a a-part (Ba) , and Q,(~ 0) representing

the wei ght of B. One may conceive of a ref-part as being a variable

abbreviating a segment. The we ight of a ref-part gives information about

t he number of primi tive symbols in that segment.

If k in (k,Q,) refers to a in (Ba), then (k,Q,) acts as an abbreviation

for B; we say that the a binds the ref-part (k,Q,). One may determine the

r eference point of some (k,Q,) , just as this was the case for a name-free

variable , by counting primitive symbols occurring to the left of (k,Q.)

in the term. There is, however, one complication in this process: the

Page 11: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

- 9 -

rtf wei ght w of some p-part (V ,ltl ) counts fo r w primitive symbols .

We a lso extend reduction in such a manner that (Ba)A reduces to A' ,

where A' results from A by substituting B for all those ref-parts

bound by the a mentioned.

For the sake of uniformity, we change our notation for reference

numbers representing variables; we shall write (n,O) instead of (n).

In the following example we shall show how the extension with a-parts

and r e f-p arts can be applied. Assume that some term contains many

s ubterms in which (various) functions playa role, all having three

variables. A typical example of such a situation may occur in the

lambda-calculus version of any mathematical text depending as a whole

on three "parameters"; each notion in such a text may be considered

t o be a function of these parameters. In such a case we can insert a segment

«A) (A) (A)a) in the head of the term, and replace all functions

(>") (A) (A)Ti

by (k,3)Ti

, k being a reference number referring to the

newl y introduced a, and 3 being the weight of the abbreviated segment

( >.. ) (A) (A). (Here the abbreviation hardly yields any advantage;

in more complicated situations, especially when types are incorporated

(see the next subsection), segment-abbreviation may be very profitable.)

Of course, we have to maintain the bonds between the A'S occurring in

such str ings (A) (A) (A) on one hand, and variables in T. that are bound ~

by one of these A'S, on the other. That is why we keep record of the

weight of the string,in the ref-part, and why we count it in our scan

for t he proper reference point. For example, consider a subterm of the

form (A) (A) (A) (2,0), where reference number 2 refers to the second-from­

right A in the string (A) (A) (A). In the abbreviated form, this subterm

become s (m , 3) (2,0) and reference number 2 refers to the second-from­

right p rimitive symbol now "impl i citly present" in (m,3).

In the above example we started f rom an "unabbreviated" term and we ex­

plained a manner of introducing a segment-abbreviating a. In practice

one will abbrevi ate immediately during the term-formation. It will be

of only t heoret ical interest that the unabbreviated term can arise as

a result of reduction.

Page 12: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

- 10 -

e . types, norms

There may be various reasons for wishing to extend lambda-calculus with

"types". One of these originates from the s ometimes unpleasant

circumstance that a sequence of reductions does not necessarily lead

to a final "outcome" in untyped lambda-calculus. By adding types and,

by the aid of these types, imposing a proper functional character to

terms, one can prevent these excrescences ; see , for example, the

"type theory" in [3J.

One may also wish to introduce types in a second setting, namely in

formal languages meant for expressing mathematical reasoning on the

basis of lambda-calculus. In these languages there is a natural desire

for types, in particular for accurately establishing the class of a

mathematical object. See for example [4J or [9J . The presence of types

in formal languages usually prevents the existence of infinite reduction

sequences.

Types in the latter case must obey other conditions than types in the

former case. Types in formal languages are generally more complex as

to structure than types in type theories. Hence one may say that types

in f ormal languages are more restrictive than types in type theories.

We shall enable types to be incorporated in our system of lambda-calculus.

We restrict ourselves to "types" that behave like terms, and do not

look different to terms. Yet we believe that type theories as well as

formal languages can be expressed in the system proposed - anyway, for

an impor tant part.

Types wi ll be inserted in the system by simply extending the rules of

term-format~on as follows: (AA) is a term part if A is a term. (Note

that (A) is still a term part, since A may be the empty term.) One

may conceive of such an A as being the type of each ref-part (variable)

that r efers to (is bound by) the A mentioned. In fact, we define the

t ype of a ref-part referring to a A-part (AA) or a a-part (Aa), to be A.

I n case A is the empty t erm , we may interpret A as being a kind of

"univer s al" type.

Page 13: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

- 11 -

The type of any arbitrary term ending in a ref -part may be obtained by

r epl acing that ref-part in the term by its type. He nce, terms and types

l ook alike, and in the formal system we make no di stinction between

t erms and types. At an interpretationa l level , only , we shall some­

times s tress t he "type-character" of a te~'1ll.

In the system now obtained one can make advanta geous use of the types,

the p r es ence of types enabling us to i nvestigate whether a particular

ter m obeys s ome weak condition of "functionality". A natural paraphrase

of functi onality is: all "argumen t s " act only as arguments of "functions".

Ther e are different ways of translating this vaguely formulated concept

into a formal system. We shall choose a weak form of functionality that

only demands superficial correspondence between the "argument" and the

"domain " of a function.

For this we introduce a sub-class of terms, called norms, and a mapping

p sending terms to norms. One may conceive of the norm p(T) as being a

"pr i mitive frame" for term T. These norms have a striking similarity to

t he types in type theories. The calculation of the norm corresponding

to a gi ven term is based on three actions. Each of these actions may be

appl ied to any T' on the condition that there is no subterm in T' to which

any of these actions can be applied. So, in a manner of speaking, one

has to evaluate norms from the inside outwards.

The thre e pos sible actions a r e :

(1 ) the rep lacement of any subterm by its type;

( 2 ) the cancellation of any pair (AO) (BA) cccurring adjacently in

a sub term , provided that A is equal to B;

(3 ) the cancellation of any a-part (Aa) occurring in a subterm.

One has t o terminate the calculation if one comes across a pair

(AO) (B A) that does not obey the condition worded in (2).

In that case, the terffi under consideration has no norm. In general,

however, we may say that "well-behavi ng terms", like those coming

from a type theory or a forma l language, do have norms. The condition

i n (2) is direct ly connected to functionality, so the existence of a

norm ensures, i n a certain sense, the functional character of a term.

Page 14: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

- 12 -

For, in a pair (Ae) (BA) ready for cance llat ion, A and B already must

be norms (otherwise there would be a subterm to which one of the three

actions could be applied). Then A is the norm of some argument A I

occurring in the original term. And B is the norm of some domain BI of

a "function" (BI A) • •• i n the origina l term. Hence argument and

domain must match as to norm.

In an example we shall show how the norm is ca lculated. Take the term

TO defined as

(A ) «(p)A )ak

) «k)C(p)Ab)a n ) «£) «ap ) (b)e) «£) «aP ) Cp)A. ) • p a '" x y ~mp

(This t erm may be conceived of as being a definition of implication,

but this is irrelevant at this moment.) We use the name-containing

fo rm for better understanding; the weights of ref-parts are omitted.

In order to find the norm of (k) ( (p) A ), we first have to evaluate the b

norms of its parts. We start with part (k). Its type is (Cp)A ). a

Now (p) has an empty type, so we must replace C (p) A ) by (A ), being a a a nor m. Hence (k) has to be replaced by (A ), its norm. We next consider

a ( (p ) A

b) . Its norm is CAb) . We conclude that the norm of (k) ( Cp) Ab )

(r elative to term TO) is (Aa) (Ab).

Cal culating the norm of A := (£) «a) A ) (b), we find (A ) (Ab

) (A ). The x a x

norm of B := (£) «a) A ) (p) is (A ) (Ab

) (A ) . Since t hese norms are yay

equal (but for the names of variables), we may cancel the pair (Ae) (BA. ). ~mp

We may a l so cancel the two a-parts , so that the norm of TO is only (~).

In this example all norms had a simple appearance. In a more complex

situ~tion, one might obtain norms such as the following (in which we

dropped the names of variables):

« (A) «A) A» (CA) (A) A) (A) A) (A) «A) 0) (0) •

Terms that do have norms obey some kind of functionality. We call such

terms nOY'lTlabZe. If, moreover, a few conditions are fulfilled with respect

to the well-structuredness of a term, we call a term interpretabZe.

Now for interpre t able terms one may prove a number of interesting theorems,

which we shall express in words:

(i) reduction of interpretable terms yields interpretable terms;

(ii ) e ach pair of reducts of the same interpretable term has a common

reduct;

(iii) each interpretable term has a normal form (i . e. a reduct that

Page 15: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

- 13 -

cannot be reduced any further );

(iv) each reduction sequence, starting f r om an i nterpretable term,

terminates.

f . reduction

The reduction called S-reduction is the formalization of the mathematical

action "application of a function to an argument". One usually describes this

reduction by t he aid of substitution : {A [TJ}(A) > S~ (see the intro-x x

ducti on ). Clearly, the mechanism of substitution itself can be dealt with at

an intuitive level: replace all occurrences of x in T by A, in one sweep,

and t hat suffices. A more formal approach is to describe substitution as

a process by itself (see e.g. Curry and Feys [3J).

We p refer to incorporate substitution into our system, treating it as a

fundamental component of S-reduction . For this purpose we introduce a new

kind of parts (called S-parts) that may occur in terms. Such a S-part, of

the form (AS) , should be thought of as being a "substitution instruction".

The S occurring in (AS) will have a binding character; it binds all

variables that have to be replaced by A.

Our rules for S-reduction will allow us to "shift", step by step, the

part (AS) to the right in the formula. If (AS) passes a variable bound

by the S mentioned , this variable must be replaced by A. (Of course,

reference numbers have to be adapted during this process of shifting.)

Finall y , after a number of steps , all appropriate replacements have taken

place, and the result is the substitution des i red. The part (AS) vanishes

on arriving at the end of the formula .

In this manner we can dispense with a global substi tution operator like A

S • We still have to explain how a S-part (AS) can arise in a formula. x

As one may imagine, there are two possibilities for the introduction of

such a substitution instruction i n an (interpretable) term. First, a

"matching" pair of (B8) followed by (C,,) may be replaced by a substitution

instruction (BS). (This is the beginning of a S-reduction.) Here A and B

play the role s of binding quantor and corresponding argument, as explained

in subsection a. Secondly, abbreviations expressed in segments (Do) may

be cancelled by replacing (Do) by (OS) and shifting this S-part to the

Page 16: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

- 14 -

right as described above.

We make a few r emarks about the replacement by (BS) of matching (Bo)

and (CA). As a matter of fact, we do more than we said just now:

not only do we replace (Bo ) by (BS), but we replace (CA) by (CS),

as well . We shal l explain this by inspecting the bonds between

binding and bound variables. All variables bound by A before the

r ep l acement, will subsequently be bound by the S of (BS), as might be

expected: these are the variables that have to be replaced by B. So

t he reference point of these variables is shifted to the left; in the

name-containing version: (Bo) (CA ) becomes (BS ) (CS ). x x y

On the other hand, the S of (CS) does not bind any variable at all, so

the s hift of (CS) through the formula will not cause any replacement.

Ye t we maintain this "dummy" substitution instruction, since it may

be pos s ible in our system that a binding variable inside C binds a

variable to the right of (CS) and, of course, we do not wish to break

this bond. (Restrictions in some of our definitions for reductions are

made for the same reason.)

As to the condition that (BO) and (CA) should be "matching", we take a

l iberal point of view. If (BO) and (CA) match as to norm, but are

sep arated by a part string with empty norm, then one may easily convince

oneself that (BO ) and (CA) are nevertheless ready for reduction, i.e.

f or replacement by (BS) and (CS). Example: consider the following part

string, which we assume to originate from an interpretable (hence

normable) term:

Here the a-parts act only as abbreviation, so they play no role in

the p rocess of matching. Moreover, (A3

0) matches with (A4 A) and may

be replaced by two substitution instructions: (A3S) and (A4

S); the

same holds for (A6

0) and (A7

A). Then (A10) and (ABA) are only separated

by S-parts and a-parts, being negligible as to matching; so (A1

0) and

(AB A) match, and so do (BO) and (CA). (Note that the above reasoning

runs parallel to the evaluation of the norm of (A10) ••• (AgO), which norm

is empty.)

Page 17: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

- 15 -

Finally we mention that one has ~o reconsider reference numbers in a

few of the rules for a-reduction.

9 . tree represenLation

Each structure internally framed with nested brackets has an appropriate

tree representation. For our terms, having such a structure, it is

not hard to find a convenient representation in tree-form. For example,

we construct the tree fo r (AA)B by composing the trees for A and B. We

shall not describe in detail the rules for constructing the tree

representation of a term. We hope that the rules will become clear from

the following example.

We take the name-free version of the term TO considered in subsection e

(the weights deleted) :

(A) «(l)A)cr) «1) «3)A)cr) «1) «4)A) (3)8) «3) «6)A) (B)A) •

The t ree form of this term becomes:

We make some remarks concerning t his tree representation. The tree obtained

is a rooted tree, the root being the left-most vertex in the diagram. The

tree has vertices with valency 1 (indicated as the point of an arrow),

with valency 2 (marked with some reference number) and with valency 3

(marked with cr, A, 8 or 8 in the axil). (The root has valency 2.)

The brackets written in the tree are dispensable. However, if one inserts

the brackets as above, and if the reference numbers are located "above"

the appropriate vertex (as i n the diagram), it is easy to reconstruct

the linearly written term from the term in tree form. It suffices to

follow a path around the tree (starting at the root and keeping the

Page 18: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

- 16 -

edges of the tree at the r i gh t hand side) and writing down all symbols

t hat one comes a cross, in l inear order.

By following the path in the opposi te di rection , starting from a given

re f erence number n , one can track down the appr opriate reference point:

it i s t he n-th primitive symbol me t (Of course , one may not pass the

root during this search fo r the reference point .)

At this p l ace we make the fol l owing remark . There is a more commonly

used notation f or structures of nested brackets , especially when binary

oper ati ons are i nvolved. In our case this would amount to writing (AAB)

instead of (AA) B, etc. The differences in use between these two notational

systems are trifling. We prefe r ~he deviating form, mainly because we

are pleased with the formal description by means of A-parts (AA), etc.

Page 19: A system of lambda-calculus possessing facilities for ... · e) types, norms f) reductions g) tree representation - References Abstr act and acknowledgement This is part I of c. coherent

- 17 -

References

[ 1J BARENDREGT, H.P. The type f ree lambda calculus. In : Handbook

[2 J CHURCH, A.

o f Math ematical Logic, ed . J. Barwise. Amsterdam­

New York - Oxford, 197 7 .

An unsolvable problem of elementary number

theory . Amer . J. Math., 58 (1933) , 839-864.

[3J CURRY, H.B. and R. FEYS, Combinat ory Logic . Vol. I. Amsterdam,

[ 4J DE BRUIJN , N.G.

5J DE BRUIJN, N.G.

[6J DE BRUIJN , N.G.

[ 7J DE BRUIJN, N. G.

[8J NEDERPELT, R.P.

[9J NEDERPELT , R.P.

1958.

Automath, a l anguage for mathematics. Seminaire

de Mathemat i ques Superieures , ete 1971.

t.1ontreal , 1973. (Lecture notes prepared by

B. Fawcett . )

Lambda calculus notation with nameless dummies,

a tool for automatic formula manipulation, with

application to the Church-Rosser theorem. Indag.

Math. 34 (1972), 381-392.

Lambda calculus with namefree formulas involving

symbols that represent reference transforming

mappings. Indag. Math. 40 (1978), 348-356.

A namefree lambda calculus with f acilities for

i nternal definition of expressions and segments.

T.H. Repor~ Eindhoven, 1978.

Strong normalization in a typed lambda calculus

wit h l ruobda s t ructured types . Thesis. Eindhoven,

1973 .

Present ation of natural deduction. Recueil des

Travaux de l' I ns t itut Mathematique, Nouvelle

s eri e, tome 2 (10), Beograd (1977), 115-126.