0% found this document useful (0 votes)
157 views15 pages

Lambda - Calculus Simply Typed Lambda - Calculus: by Lasha Abzianidze

The document provides an overview of the simply typed lambda calculus. It defines the syntax and types in the lambda calculus, including atomic types, function types, environments, and typing judgements. It also gives examples of how types can be used to represent the semantics of natural language by assigning types to entities, truth values, and functions.

Uploaded by

kovvalsky
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
157 views15 pages

Lambda - Calculus Simply Typed Lambda - Calculus: by Lasha Abzianidze

The document provides an overview of the simply typed lambda calculus. It defines the syntax and types in the lambda calculus, including atomic types, function types, environments, and typing judgements. It also gives examples of how types can be used to represent the semantics of natural language by assigning types to entities, truth values, and functions.

Uploaded by

kovvalsky
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

 Reading Group - 2010

Lambda - Calculus
&
Simply Typed Lambda - Calculus

by Lasha Abzianidze


 Reading Group - 2010

Lambda - Calculus
The Lambda-Calculus was invented by Alonso Church (1936).

The system is about function definition, function


application and recursion.

All objects are functions and the only operation is the


composition of functions. Functions apply to other
functions and the resulting values are computed by a
mechanism of reduction.


 Reading Group - 2010

Lambda - Calculus: Syntax


The syntax of lambda-terms is defined recursively from an infinite set V
of variables and a set C of constants as follows:
a) All variables and constants are lambda-terms (called atoms).
b) If M and N are any lambda-terms, then (MN) is a lambda-term
(called an application).
c) If M is any lambda-term and if x is any variable, then (x.M) is a
lambda-term (called an abstraction)
If the set C of constants is empty, the calculus is called pure, otherwise
applied.
Simplification of notation :
 ((…(M1 M2 ) M3 ) …. Mp ) = M1 M2 M3 …. Mp
 x1 . x2 … xn . M = x1 x2…xn.M (currying)
 x1 x2…xn. (M1 M2 M3 …. Mp) = x1 x2…xn. M1 M2 M3 …. Mp

 Reading Group - 2010

Lambda - Calculus: Free & Bound Variables


an occurrence of a variable x in a term M is bound if it is in the body N of
a sub-term x.N of M; otherwise it is free.

If x has at least one free occurrence in M, it is called a free variable of M;

The set of free variables of M is denoted FV(M). If this set is empty, M is


called a closed term.
x . MNx
xy . xxyy
x . My
x . M (y . xy)
x . M y (y . xy)
x . M (x . x)
x x. M x


 Reading Group - 2010

Lambda - Calculus:  conversion


-conversion aims at expressing that the names of bound variables do
not matter : in the body of an abstraction, they only represent positions
which will be occupied by the argument to which the abstraction
applies.

The -conversion relation is an equivalence relation over lambda-terms


so that we can identify terms modulo this relation.

x ( y. x y) ( y. y) = = x ( z. x z) ( x. x)


x x. M x = x.  x. M x = x. ( x. M x) == x. ( y. M y) == x y. M y
but be careful !!!
x y . M(N x y z) <> z y . M(N z y z)


 Reading Group - 2010

Lambda - Calculus: -reduction


The reduction of a term represents its computation.

Any term of the form (x.M)N is called a -redex and the corresponding
term M[x:=N] is called its contractum.

-contraction: if a term M contains a sub-term which is a -redex and if


we replace that occurrence by its contractum, we obtain a term N and we
say that M -contracts to N, which is denoted : M  N.

-reduction: we say that a term M -reduces to a term N if N is obtained


by a finite (possibly empty) sequences of -contractions, which is
denoted : M * N

Eample: (f x. f (f x))(x.x)


 Reading Group - 2010

Lambda - Calculus: -equality


-normal form: A term which contains no -redex is called a term in
-normal form. If a term M -reduces to a term N in -normal form,
then N is called a -normal form of M.

Some terms have no -normal form: (x . xx)(x . xx)

If a term has a -normal form, this form is unique

-equality: A term M is -equal to a term N if N is obtained from M


by a finite (possibly empty) sequence of -contractions or reversed
-contractions.

-equality is an equivalence relation.


 Reading Group - 2010

Lambda - Calculus: ()-reduction


To fix some strange behaviour: f <> x.fx

Any term of the form (x.M x) such that x  FV(M) is called a -redex
and the corresponding term M is called its contractum.

-contraction: if a term M contains a sub-term which is a -redex and if


we replace that occurrence by its contractum, we obtain a term N and we
say that M -contracts to N, which is denoted : M   N.

 -reduction: we say that a term M  -reduces to a term N if N is


obtained by a finite (possibly empty) sequences of -contractions or -
contractions which is denoted : M * N.


 Reading Group - 2010

Lambda - Calculus: -equality


-normal form: A term which contains no -redex and no -redex is called
a term in -normal form. If a term M -reduces to a term N in -normal
form, then N is called a -normal form of M.

-equality: A term M is -equal to a term N if N is obtained from M by a


finite (possibly empty) sequence of the following operations: -contractions,
-contractions, reversed -contractions, reversed  -contractions.

  -equality is an equivalence relation.


 Reading Group - 2010

Simply Typed Lambda - Calculus


Motivation:

In the Lambda-Calculus, some terms apply to themselves, which entails


paradoxes and non terminating computations.

In the usual set theory, functions are defined with their domain and their
range. In the Lambda-Calculus, this is recovered by means of typing.

From a computational point of view, typing aims at controlling correctness


and termination of computations.


 Reading Group - 2010

S. T. Lambda - Calculus: definition


Assuming a set A of atomic types, the set TA of types built from A is defined
inductively as follows:

Every atomic type of A is an element of TA ;

If  and  are any elements of TA , then    is an element of TA

Convention: the type 1  (2  (…  n )…)) is written 1  2  …  n

An environment is a function that assigns types to a set of variables and


constants.

A judgement  |- M :  is the assumption that the term M has the type  in


the environment .


 Reading Group - 2010

S. T. Lambda - Calculus: toy example


Example: semantics of natural languages

 The set of atomic types A ={e (entities), t (truth-values)};

 An environment is a set of lexical entries :


1 = { John: e, Marry: e, Loves : e  e  t }
2 = { John e, To swim: e  t, Loves : (e  t ) e  t }

 A typing judgment represents the meaning of an expression composed


from the meaning of its words (application of the principle of
compositionality) :
1 |- John Loves Marry : t
2 |- John Loves To swim : t


 Reading Group - 2010

S. T. Lambda - Calculus: toy example


Example: semantics of natural languages

 The set of atomic types A ={e (entities), t (truth-values)};


 An environment is a set of lexical entries :

 1 = { John: e,
Marry: e,
love : e  e  t }


 Reading Group - 2010

S. T. Lambda - Calculus: toy example


Example: semantics of natural languages

1 = { John: e,
Marry: e,
love : e  e  t }


 Reading Group - 2010

S. T. Lambda - Calculus: toy example


Example: semantics of natural languages

1 = { cat: e  t,
eat: e  e  t,
every: (e  t)  t,
exists: (e t) t ,
:t t t,
&: t t t }

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy