calculus

© All Rights Reserved

1 views

calculus

© All Rights Reserved

- Leadership Theory
- Agri Informaticssafdfaad
- Agri Informatics (1)
- Time Table
- Leadership
- Cs Proj Grp14-15
- unit 1
- Kernel
- Sample Paper
- principle
- unit1-130131031436-phpapp01
- dc corba for mtech
- FAQ_PDF
- Blood Bank (Synopsis)
- Excel Basics (1)
- ch11
- Aaa
- First Mid Sem Software Engineering(NCS-602)
- reliabilitygrowthmodels-110412004225-phpapp01.pdf
- link.txt

You are on page 1of 6

Lesson2

Lambda Calculus Basics

1/10/02

Chapter 5.1, 5.2

Outline

Syntax of the lambda calculus

abstraction over variables

Operational semantics

beta reduction

substitution

representation tricks

1/10/02

Basic ideas

introduce variables ranging over values

define functions by (lambda-) abstracting

over variables

apply functions to values

x+1

lx. x + 1

(lx. x + 1) 2

1/10/02

Abstract syntax

Pure lambda calculus: start with nothing

but variables.

Lambda terms

t ::=

x

lx . t

tt

1/10/02

variable

abstraction

application

lx . t

body

binder

Occurences of x in the body t are bound.

Nonbound variable occurrences are called free.

(lx . ly. zx(yx))x

1/10/02

Beta reduction

Computation in the lambda calculus takes the form of betareduction:

(lx. t1) t2 [x ! t2]t1

where [x ! t2]t1 denotes the result of substituting t2 for all

free occurrences of x in t1.

A term of the form (lx. t1) t2 is called a beta-redex (or bredex).

A (beta) normal form is a term containing no beta-redexes.

1/10/02

(lx.ly.y x)(lz.u) ly.y(lz.u)

(lx. x x)(lz.u) (lz.u) (lz.u)

(ly.y a)((lx. x)(lz.(lu.u) z)) (ly.y a)(lz.(lu.u) z)

(ly.y a)((lx. x)(lz.(lu.u) z)) (ly.y a)((lx. x)(lz. z))

(ly.y a)((lx. x)(lz.(lu.u) z)) ((lx. x)(lz.(lu.u) z)) a

1/10/02

Evaluation strategies

Full beta-reduction

any beta-redex can be reduced

Normal order

reduce the leftmost-outermost redex

Call by name

reduce the leftmost-outermost redex, but not inside

abstractions

abstractions are normal forms

Call by value

reduce leftmost-outermost redex where argument is a value

no reduction inside abstractions (abstractions are values)

1/10/02

multiple parameters through currying

booleans

pairs

Church numerals and arithmetic

lists

recursion

call by name and call by value versions

1/10/02

(lx. t1) t2 [x ! t2]t1

where [x ! t2]t1 denotes the result of substituting t2 for all

free occurrences of x in t1.

A term of the form (lx. t1) t2 is called a beta-redex (or bredex).

A (beta) normal form is a term containing no beta-redexes.

1/10/02

10

Symbols

Symbols l b a !

1/10/02

11

- Leadership TheoryUploaded byAshish Singh Rathore
- Agri InformaticssafdfaadUploaded byAshish Singh Rathore
- Agri Informatics (1)Uploaded byAshish Singh Rathore
- Time TableUploaded byAshish Singh Rathore
- LeadershipUploaded byAshish Singh Rathore
- Cs Proj Grp14-15Uploaded byAshish Singh Rathore
- unit 1Uploaded byAshish Singh Rathore
- KernelUploaded byAshish Singh Rathore
- Sample PaperUploaded byAshish Singh Rathore
- principleUploaded byAshish Singh Rathore
- unit1-130131031436-phpapp01Uploaded byAshish Singh Rathore
- dc corba for mtechUploaded byAshish Singh Rathore
- FAQ_PDFUploaded byjeetendra_kumar2008
- Excel Basics (1)Uploaded byAshish Singh Rathore
- ch11Uploaded byMiljan Puzović
- First Mid Sem Software Engineering(NCS-602)Uploaded byAshish Singh Rathore
- Blood Bank (Synopsis)Uploaded byAshish Singh Rathore
- AaaUploaded byAshish Singh Rathore
- reliabilitygrowthmodels-110412004225-phpapp01.pdfUploaded byAshish Singh Rathore
- link.txtUploaded byAshish Singh Rathore
- C_DS_Lab_ManualUploaded byAshish Singh Rathore
- n&c newUploaded byAshish Singh Rathore
- hrmUploaded byAshish Singh Rathore

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.