Expressibility in the Lambda Calculus with letrec Clemens Grabmayer - - PowerPoint PPT Presentation

expressibility in the lambda calculus with letrec
SMART_READER_LITE
LIVE PREVIEW

Expressibility in the Lambda Calculus with letrec Clemens Grabmayer - - PowerPoint PPT Presentation

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 1 Expressibility in the Lambda Calculus with letrec Clemens Grabmayer and Jan Rochel Dept. of Philosophy, and Dept. of Computer Science NWO-project Realising Optimal Sharing


slide-1
SLIDE 1

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 1

Expressibility in the Lambda Calculus with letrec

Clemens Grabmayer and Jan Rochel

  • Dept. of Philosophy, and Dept. of Computer Science

NWO-project Realising Optimal Sharing Utrecht University

TeReSe-Meeting RWTH Aachen, 28 March 2012

slide-2
SLIDE 2

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 2

Which infinite λ-terms are expressible finitely in λletrec?

Example

letrec f = λxy.f y x in f

։ ։▽ λxy.λxy.(λxy.(...y x)y x)y x

slide-3
SLIDE 3

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 3

Which infinite λ-terms are expressible finitely in λletrec?

Example

letrec f = λxy.f y x in f

։ ։▽ λxy.λxy.(λxy.(...y x)y x)y x λx λy @ @ y x ։ ։▽ λx λy @ @ λx λy @ @ . . . y x y x

slide-4
SLIDE 4

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 4

Which infinite λ-terms are expressible finitely in λletrec?

Example

letrec f = λxy.f y x in f

։ ։▽ λxy.λxy.(λxy.(...y x)y x)y x λx λy @ @ y x ։ ։▽ λx λy @ @ λx λy @ @ . . . y x y x ։ ։β λa λb @ λc @ λd @ . . . c b a

slide-5
SLIDE 5

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 5

Which infinite λ-terms are expressible finitely in λletrec?

Example

letrec f = λxy.f y x in f

։ ։▽ λxy.λxy.(λxy.(...y x)y x)y x λx λy @ @ y x ։ ։▽ λx λy @ @ λx λy @ @ . . . y x y x ։ ։β λa λb @ λc @ λd @ . . . c b a ։ ։β λa λb λc λd . . .

slide-6
SLIDE 6

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 6

Which infinite λ-terms are expressible finitely in λletrec?

Example

letrec f = λxy.f y x in f

։ ։▽ λxy.λxy.(λxy.(...y x)y x)y x λx λy @ @ y x ։ ։▽ λx λy @ @ λx λy @ @ . . . y x y x ։ ։β λa λb @ λc @ λd @ . . . c b a ։ ։β λa λb λc λd . . . և և▽ λx

letrec f = λx.f in f

slide-7
SLIDE 7

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 7

What makes a λ-terms inexpressible in λletrec?

Example

λa λb @ λc @ λd @ . . . c b a

slide-8
SLIDE 8

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 8

What makes a λ-terms inexpressible in λletrec?

λa λb @ λc @ λd @ . . . c b a

slide-9
SLIDE 9

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 9

What makes a λ-terms inexpressible in λletrec?

λa λb @ λc @ λd @ . . . c b a λ λ @ λ @ λ @ . . .

slide-10
SLIDE 10

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 10

What makes a λ-terms inexpressible in λletrec?

λa λb @ λc @ λd @ . . . c b a λ λ @ λ @ λ @ . . . λa λb @ λc @ λd @ . . . c b a

scope

slide-11
SLIDE 11

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 11

What makes a λ-terms inexpressible in λletrec?

λa λb @ λc @ λd @ . . . c b a λ λ @ λ @ λ @ . . . λa λb @ λc @ λd @ . . . c b a λa λb @ λc @ λd @ . . . c b a

scope scope+

slide-12
SLIDE 12

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 12

What makes a λ-terms inexpressible in λletrec?

λx λy @ @ λx λy @ @ . . . y x y x

slide-13
SLIDE 13

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 13

What makes a λ-terms inexpressible in λletrec?

λx λy @ @ λx λy @ @ . . . y x y x λ λ @ @ λ λ @ @ . . .

slide-14
SLIDE 14

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 14

What makes a λ-terms inexpressible in λletrec?

λx λy @ @ λx λy @ @ . . . y x y x λ λ @ @ λ λ @ @ . . . λx λy @ @ λx λy @ @ . . . y x y x

scope

slide-15
SLIDE 15

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 15

What makes a λ-terms inexpressible in λletrec?

λx λy @ @ λx λy @ @ . . . y x y x λ λ @ @ λ λ @ @ . . . λx λy @ @ λx λy @ @ . . . y x y x λx λy @ @ λx λy @ @ . . . y x y x

scope scope+

slide-16
SLIDE 16

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 16

A CRS for observing infinite λ-terms: Reg+

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous)

slide-17
SLIDE 17

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 17

A CRS for observing infinite λ-terms: Reg+

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous) (ρ@i) :

pren([x1 ...xn]app(Z0(

  • x),Z1(
  • x))) → pren([x1 ...xn]Zi(
  • x))

(i ∈ {0,1}) (ρλ) :

pren([x1 ...xn]abs([xn+1]Z(

  • x))) → pren([x1 ...xn+1]Z(
  • x))

(ρS) :

pren+1([x1 ...xn+1]Z(x1,...,xn)) → pren([x1 ...xn]Z(x1,...,xn))

slide-18
SLIDE 18

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 18

A CRS for observing infinite λ-terms: Reg+

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous)

Example (λx.λy.x x y)

()λx.λy.x x y

slide-19
SLIDE 19

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 19

A CRS for observing infinite λ-terms: Reg+

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous)

Example (λx.λy.x x y)

()λx.λy.x x y →λ (λx)λy.x x y

slide-20
SLIDE 20

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 20

A CRS for observing infinite λ-terms: Reg+

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous)

Example (λx.λy.x x y)

()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y

slide-21
SLIDE 21

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 21

A CRS for observing infinite λ-terms: Reg+

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous)

Example (λx.λy.x x y)

()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@1 (λxy)y

slide-22
SLIDE 22

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 22

A CRS for observing infinite λ-terms: Reg+

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous)

Example (λx.λy.x x y)

()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@1 (λxy)y ()λx.λy.x x y

slide-23
SLIDE 23

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 23

A CRS for observing infinite λ-terms: Reg+

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous)

Example (λx.λy.x x y)

()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@1 (λxy)y ()λx.λy.x x y →λ (λx)λy.x x y

slide-24
SLIDE 24

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 24

A CRS for observing infinite λ-terms: Reg+

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous)

Example (λx.λy.x x y)

()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@1 (λxy)y ()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y

slide-25
SLIDE 25

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 25

A CRS for observing infinite λ-terms: Reg+

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous)

Example (λx.λy.x x y)

()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@1 (λxy)y ()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@0 (λxy)x x

slide-26
SLIDE 26

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 26

A CRS for observing infinite λ-terms: Reg+

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous)

Example (λx.λy.x x y)

()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@1 (λxy)y ()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@0 (λxy)x x →@1 (λxy)x

slide-27
SLIDE 27

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 27

A CRS for observing infinite λ-terms: Reg+

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous)

Example (λx.λy.x x y)

()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@1 (λxy)y ()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@0 (λxy)x x →@1 (λxy)x →S (λx)x

slide-28
SLIDE 28

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 28

A CRS for observing infinite λ-terms: Reg+

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous)

Example (λx.λy.x x y)

()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@1 (λxy)y ()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@0 (λxy)x x →@1 (λxy)x →S (λx)x ()λx.λy.x x y

slide-29
SLIDE 29

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 29

A CRS for observing infinite λ-terms: Reg+

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous)

Example (λx.λy.x x y)

()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@1 (λxy)y ()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@0 (λxy)x x →@1 (λxy)x →S (λx)x ()λx.λy.x x y →λ (λx)λy.x x y

slide-30
SLIDE 30

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 30

A CRS for observing infinite λ-terms: Reg+

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous)

Example (λx.λy.x x y)

()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@1 (λxy)y ()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@0 (λxy)x x →@1 (λxy)x →S (λx)x ()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y

slide-31
SLIDE 31

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 31

A CRS for observing infinite λ-terms: Reg+

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous)

Example (λx.λy.x x y)

()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@1 (λxy)y ()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@0 (λxy)x x →@1 (λxy)x →S (λx)x ()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@0 (λxy)x x

slide-32
SLIDE 32

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 32

A CRS for observing infinite λ-terms: Reg+

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous)

Example (λx.λy.x x y)

()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@1 (λxy)y ()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@0 (λxy)x x →@1 (λxy)x →S (λx)x ()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@0 (λxy)x x →S (λx)x x

slide-33
SLIDE 33

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 33

A CRS for observing infinite λ-terms: Reg+

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous)

Example (λx.λy.x x y)

()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@1 (λxy)y ()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@0 (λxy)x x →@1 (λxy)x →S (λx)x ()λx.λy.x x y →λ (λx)λy.x x y →λ (λxy)x x y →@0 (λxy)x x →S (λx)x x →@1 (λx)x

slide-34
SLIDE 34

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 34

scope+-delimiting strategies for Reg+

Example (λx.λy.x x y)

x λ xy λ xy @0 x S @0@1 xy @0 x S @1 xy @1

(λxy)y ()λx.λy.x x y (λx)λy.x x y (λxy)x x y (λxy)x (λxy)x x (λx)x x (λx)x

slide-35
SLIDE 35

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 35

scope+-delimiting strategies for Reg+

Example (λx.λy.x x y)

x λ xy λ xy @0 x S @0@1 xy @0 x S @1 xy @1

slide-36
SLIDE 36

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 36

scope+-delimiting strategies for Reg+

Example (λx.λy.x x y)

x λ xy λ xy @0 x S @0@1 xy @0 x S @1 xy @1 x λ xy λ xy @0 x S xy @1 @0 @1 x x λ xy λ xy @0 x @1 xy @1 @0 @1 xy S

Reg+

Seag Slazy

slide-37
SLIDE 37

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 37

scope+-delimiting strategies for Reg+

Example (λx.λy.x x y)

x λ xy λ xy @0 x S @0@1 xy @0 x S @1 xy @1 λx λy @ @ x x y x λ xy λ xy @0 x S xy @1 @0 @1 x x λ xy λ xy @0 x @1 xy @1 @0 @1 xy S

Reg+

Seag Slazy

slide-38
SLIDE 38

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 38

Connection to the de-Bruijn notation

Example (λx.λy.x x y)

x λ xy λ xy @0 x @1 xy @1 @0 @1 xy S x λ xy λ xy @0 x S xy @1 @0 @1 x Slazy Seag

slide-39
SLIDE 39

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 39

Connection to the de-Bruijn notation

Example (λx.λy.x x y)

λ λ @ @ 1 1 x λ xy λ xy @0 x @1 xy @1 @0 @1 xy S x λ xy λ xy @0 x S xy @1 @0 @1 x Slazy Seag

slide-40
SLIDE 40

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 40

Connection to the de-Bruijn notation

Example (λx.λy.x x y)

λ λ @ @ S S x λ xy λ xy @0 x @1 xy @1 @0 @1 xy S x λ xy λ xy @0 x S xy @1 @0 @1 x Slazy Seag

slide-41
SLIDE 41

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 41

Connection to the de-Bruijn notation

Example (λx.λy.x x y)

λ λ @ @ S S x λ xy λ xy @0 x @1 xy @1 @0 @1 xy S x λ xy λ xy @0 x S xy @1 @0 @1 x λ λ @ S @ Slazy Seag

slide-42
SLIDE 42

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 42

Strong regularity

Definition (S-regularity)

An infinite λ-term M is S-regular the set of ։S-reducts of M is finite.

slide-43
SLIDE 43

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 43

Strong regularity

Definition (S-regularity)

An infinite λ-term M is S-regular the set of ։S-reducts of M is finite.

Definition (strongly regular infinite λ-terms)

An infinite λ-term M is strongly regular if there exists a scope+-delimiting strategy S+ for Reg+ such that M is S+-regular.

slide-44
SLIDE 44

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 44

λletrec-expressibility

Definition

A λletrec-term L expresses an infinite λ-term M if L →ω

▽ M.

Definition

M is λletrec-expressible if there is a λletrec-term which expresses M.

slide-45
SLIDE 45

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 45

λletrec-expressibility

Definition

A λletrec-term L expresses an infinite λ-term M if L →ω

▽ M.

Definition

M is λletrec-expressible if there is a λletrec-term which expresses M.

(ρ@

▽) :

letrec B in L0 L1

→ (letrec B in L0)(letrec B in L1) (ρλ

▽) :

letrec B in λx.L0

→ λx.letrec B in L0 (ρletrec

) :

letrec B0 in letrec B1 in L

letrec B0,B1 in L

(ρrec

▽ ) :

letrec B in fi

letrec B in Li (if B is f1 = L1 ...fn = Ln)

(ρred

▽ ) :

letrec f1 = L1 ...fn = Ln in L

letrec fj1 = Lj1 ...fjn′ = Ljn′ in L (if fj1,...,fjn′ are the recursion variables reachable from L)

(ρnil

▽) :

letrec in L

L

slide-46
SLIDE 46

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 46

Strong regularity and λletrec-expressibility

Theorem

An infinite λ-term is λletrec-expressible if and only if it is strongly regular.

slide-47
SLIDE 47

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 47

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M

slide-48
SLIDE 48

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 48

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M = ()λxy.M y x

slide-49
SLIDE 49

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 49

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M = ()λxy.M y x →λ (λx)λy.M y x

slide-50
SLIDE 50

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 50

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x

slide-51
SLIDE 51

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 51

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y

slide-52
SLIDE 52

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 52

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y →@0 (λxy)M

slide-53
SLIDE 53

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 53

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y →@0 (λxy)M = (λxy)λx′y′.M y′ x′

slide-54
SLIDE 54

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 54

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y →@0 (λxy)M = (λxy)λx′y′.M y′ x′ →λ (λxyx′)λy′.M y′ x′

slide-55
SLIDE 55

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 55

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y →@0 (λxy)M = (λxy)λx′y′.M y′ x′ →λ (λxyx′)λy′.M y′ x′ →λ (λxyx′y′)M y′ x′

slide-56
SLIDE 56

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 56

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y →@0 (λxy)M = (λxy)λx′y′.M y′ x′ →λ (λxyx′)λy′.M y′ x′ →λ (λxyx′y′)M y′ x′ →@0 (λxyx′y′)M y′

slide-57
SLIDE 57

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 57

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y →@0 (λxy)M = (λxy)λx′y′.M y′ x′ →λ (λxyx′)λy′.M y′ x′ →λ (λxyx′y′)M y′ x′ →@0 (λxyx′y′)M y′ →@0 (λxyx′y′)M ...

slide-58
SLIDE 58

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 58

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y →@0 (λxy)M = (λxy)λx′y′.M y′ x′ →λ (λxyx′)λy′.M y′ x′ →λ (λxyx′y′)M y′ x′ →@0 (λxyx′y′)M y′ →@0 (λxyx′y′)M ... S+

eag

()M

slide-59
SLIDE 59

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 59

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y →@0 (λxy)M = (λxy)λx′y′.M y′ x′ →λ (λxyx′)λy′.M y′ x′ →λ (λxyx′y′)M y′ x′ →@0 (λxyx′y′)M y′ →@0 (λxyx′y′)M ... S+

eag

()M = ()λxy.M y x

slide-60
SLIDE 60

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 60

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y →@0 (λxy)M = (λxy)λx′y′.M y′ x′ →λ (λxyx′)λy′.M y′ x′ →λ (λxyx′y′)M y′ x′ →@0 (λxyx′y′)M y′ →@0 (λxyx′y′)M ... S+

eag

()M = ()λxy.M y x →λ (λx)λy.M y x

slide-61
SLIDE 61

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 61

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y →@0 (λxy)M = (λxy)λx′y′.M y′ x′ →λ (λxyx′)λy′.M y′ x′ →λ (λxyx′y′)M y′ x′ →@0 (λxyx′y′)M y′ →@0 (λxyx′y′)M ... S+

eag

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x

slide-62
SLIDE 62

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 62

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y →@0 (λxy)M = (λxy)λx′y′.M y′ x′ →λ (λxyx′)λy′.M y′ x′ →λ (λxyx′y′)M y′ x′ →@0 (λxyx′y′)M y′ →@0 (λxyx′y′)M ... S+

eag

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y

slide-63
SLIDE 63

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 63

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y →@0 (λxy)M = (λxy)λx′y′.M y′ x′ →λ (λxyx′)λy′.M y′ x′ →λ (λxyx′y′)M y′ x′ →@0 (λxyx′y′)M y′ →@0 (λxyx′y′)M ... S+

eag

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y →@0 (λxy)M

slide-64
SLIDE 64

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 64

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y →@0 (λxy)M = (λxy)λx′y′.M y′ x′ →λ (λxyx′)λy′.M y′ x′ →λ (λxyx′y′)M y′ x′ →@0 (λxyx′y′)M y′ →@0 (λxyx′y′)M ... S+

eag

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y →@0 (λxy)M →S (λx)M

slide-65
SLIDE 65

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 65

Strong regularity

Example (M = λxy.M y x)

S+

lazy

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y →@0 (λxy)M = (λxy)λx′y′.M y′ x′ →λ (λxyx′)λy′.M y′ x′ →λ (λxyx′y′)M y′ x′ →@0 (λxyx′y′)M y′ →@0 (λxyx′y′)M ... S+

eag

()M = ()λxy.M y x →λ (λx)λy.M y x →λ (λxy)M y x →@0 (λxy)M y →@0 (λxy)M →S (λx)M →S ()M ...

slide-66
SLIDE 66

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 66

Strong regularity and S+

eag

Proposition

M is strongly regular if and only if M is S+

eag-regular.

Proof.

⇐: by definition. ⇒: follows from ։S+

eag ⊆ ։S+ · ։S

slide-67
SLIDE 67

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 67

Strong regularity and S+

eag

Proposition

M is strongly regular if and only if M is S+

eag-regular.

Proof.

⇐: by definition. ⇒: follows from ։S+

eag ⊆ ։S+ · ։S

S+ λ λ @0 @1 S λ

b b b

λ λ @0 S @1 λ

b b b

S S S+

eag

slide-68
SLIDE 68

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 68

Strong regularity and S+

eag λa λb @ λc @ λd @ . . . c b a ()λa.λb.... →λ (λa)λb.λc....a

slide-69
SLIDE 69

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 69

Strong regularity and S+

eag λa λb @ λc @ λd @ . . . c b a ()λa.λb.... →λ (λa)λb.λc....a →λ (λab)λc....a

slide-70
SLIDE 70

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 70

Strong regularity and S+

eag λa λb @ λc @ λd @ . . . c b a ()λa.λb.... →λ (λa)λb.λc....a →λ (λab)λc....a →@0 (λab)λc.λd....b

slide-71
SLIDE 71

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 71

Strong regularity and S+

eag λa λb @ λc @ λd @ . . . c b a ()λa.λb.... →λ (λa)λb.λc....a →λ (λab)λc....a →@0 (λab)λc.λd....b →λ (λabc)λd....b

slide-72
SLIDE 72

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 72

Strong regularity and S+

eag λa λb @ λc @ λd @ . . . c b a ()λa.λb.... →λ (λa)λb.λc....a →λ (λab)λc....a →@0 (λab)λc.λd....b →λ (λabc)λd....b →@0 (λabc)λd.λe....c

slide-73
SLIDE 73

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 73

Strong regularity and S+

eag λa λb @ λc @ λd @ . . . c b a ()λa.λb.... →λ (λa)λb.λc....a →λ (λab)λc....a →@0 (λab)λc.λd....b →λ (λabc)λd....b →@0 (λabc)λd.λe....c →λ (λabcd)λe....c

slide-74
SLIDE 74

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 74

Strong regularity and S+

eag λa λb @ λc @ λd @ . . . c b a ()λa.λb.... →λ (λa)λb.λc....a →λ (λab)λc....a →@0 (λab)λc.λd....b →λ (λabc)λd....b →@0 (λabc)λd.λe....c →λ (λabcd)λe....c →@0 (λabcd)λe.λf....d

slide-75
SLIDE 75

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 75

Strong regularity and S+

eag λa λb @ λc @ λd @ . . . c b a ()λa.λb.... →λ (λa)λb.λc....a →λ (λab)λc....a →@0 (λab)λc.λd....b →λ (λabc)λd....b →@0 (λabc)λd.λe....c →λ (λabcd)λe....c →@0 (λabcd)λe.λf....d →λ (λabcde)λf....d ...

slide-76
SLIDE 76

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 76

Proof system Reg+ for strong regularity

  • xy)y

  • xy)M0

λ (λ

  • x)λy.M0

  • x)M0

  • x)M1 @

  • x)M0 M1

(λx1 ...xn−1)M

S

(if the binding

λxn is vacuous)

(λx1 ...xn)M [(λ

  • x)M]u

D0

  • x)M

FIX,u

(if |D0| ≥ 1)

  • x)M
slide-77
SLIDE 77

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 77

Proof system Reg+ for strong regularity

  • xy)y

  • xy)M0

λ (λ

  • x)λy.M0

  • x)M0

  • x)M1 @

  • x)M0 M1

(λx1 ...xn−1)M

S

(if the binding

λxn is vacuous)

(λx1 ...xn)M [(λ

  • x)M]u

D0

  • x)M

FIX,u

(if |D0| ≥ 1)

  • x)M

(ρ@i) : (λx1 ...xn)M0 M1 → (λx1 ...xn)Mi (i ∈ {0,1}) (ρλ) : (λx1 ...xn)λxn+1.M0 → (λx1 ...xn+1)M0 (ρS) : (λx1 ...xn+1)M0 → (λx1 ...xn)M0 (if λxn+1 is vacuous)

slide-78
SLIDE 78

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 78

Proof system Reg+ for strong regularity

Example (M = λxy.M x y)

(()M)u

S

(λx)M (λx)x @ (λx)M x

S

(λxy)M x (λxy)y @ (λxy)M x y λ (λx)λy.M x y λ ()M

FIX, u

()M

slide-79
SLIDE 79

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 79

Proof system Reg+ for strong regularity

Example (M = λxy.M x y)

(()M)u

S

(λx)M (λx)x @ (λx)M x

S

(λxy)M x (λxy)y @ (λxy)M x y λ (λx)λy.M x y λ ()M

FIX, u

()M x λ xy λ xy @0 xy @0 x S xy @1 xy @1 x S S

slide-80
SLIDE 80

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 80

Proof system Reg+ for strong regularity

Example (M = λxy.M x y)

(()M)u

S

(λx)M (λx)x @ (λx)M x

S

(λxy)M x (λxy)y @ (λxy)M x y λ (λx)λy.M x y λ ()M

FIX, u

()M x λ xy λ xy @0 xy @0 x S xy @1 xy @1 x S S

slide-81
SLIDE 81

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 81

Proof system Reg+ for strong regularity

  • xy)y

  • xy)M0

λ (λ

  • x)λy.M0

  • x)M0

  • x)M1 @

  • x)M0 M1

(λx1 ...xn−1)M

S (if the binding λxn is vacuous)

(λx1 ...xn)M [(λ

  • x)M]u

D0

  • x)M

FIX,u

(if |D0| ≥ 1)

  • x)M
slide-82
SLIDE 82

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 82

Proof system Reg+

0 for strong regularity (λ

  • xy)y

  • xy)M0

λ (λ

  • x)λy.M0

  • x)M0

  • x)M1 @

  • x)M0 M1

(λx1 ...xn−1)M

S (if the binding λxn is vacuous)

(λx1 ...xn)M [(λ

  • x)M]u

D0

  • x)M

FIX,u

(if |D0| ≥ 1, and, on threads in D0 down from assumptions ((λ

  • x)M)u, prefix-lengths are ≥ |
  • x|)

  • x)M
slide-83
SLIDE 83

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 83

Proof system ann-Reg+

0 for λletrec-expressibility (λ

  • xy) y : y

  • xy) L : M

λ (λ

  • x) λy.L : λy.M

  • x) L0 : M0

  • x) L1 : M1 @

  • x) L0 L1 : M0 M1

(λx1 ...xn−1) L : M

S (if the binding λxn is vacuous)

(λx1 ...xn) L : M [(λ

  • x) cu : M]u

D0

  • x) L[u := cu] : M

FIX,u

(if |D0| ≥ 1, and, on threads in D0 down from assumptions ((λ

  • x)M)u,

prefix-lengths are ≥ |

  • x|)

  • x) (letrec u = L in u) : M
slide-84
SLIDE 84

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 84

Proof system Reg+ for strong regularity

Example (M = λxy.M x y)

(()M)u

S

(λx)M (λx)x @ (λx)M x

S

(λxy)M x (λxy)y @ (λxy)M x y λ (λx)λy.M x y λ ()M

FIX, u

()M

slide-85
SLIDE 85

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 85

Proof system Reg+

0 for strong regularity

Example (M = λxy.M x y)

(()M)u

S

(λx)M (λx)x @ (λx)M x

S

(λxy)M x (λxy)y @ (λxy)M x y λ (λx)λy.M x y λ ()M

FIX, u

()M

slide-86
SLIDE 86

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 86

Proof system ann-Reg+

0 for λletrec-expressibility

Example

(() cu : M)u

S

(λx) cu : M (λx) x : x @ (λx) cu x : M x

S

(λxy) cu x : M x (λxy) y : y @ (λxy) cu x y : M x y λ (λx) λy.cu x y : M x y λ () λxy.cu x y : λxy.M x y

FIX, u

() (letrec u = λxy.u x y in u) : M

slide-87
SLIDE 87

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 87

Main Result

Theorem

An infinite λ-term is λletrec-expressible if and only if it is strongly regular.

slide-88
SLIDE 88

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 88

Main Result

Theorem

An infinite λ-term is λletrec-expressible if and only if it is strongly regular.

Proof.

⇐: For every infinite λ-term M:

M is strongly regular =

⇒ ⊢Reg+ ()M = ⇒ ⊢Reg+

0 ()M

= ⇒ ⊢ann-Reg+

0 () L : M

= ⇒ L →ω

▽ M

= ⇒ L expresses M

slide-89
SLIDE 89

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 89

Main Result

Theorem

An infinite λ-term is λletrec-expressible if and only if it is strongly regular.

Proof.

⇐: For every infinite λ-term M:

M is strongly regular =

⇒ ⊢Reg+ ()M = ⇒ ⊢Reg+

0 ()M

= ⇒ ⊢ann-Reg+

0 () L : M

= ⇒ L →ω

▽ M

= ⇒ L expresses M ⇒:

◮ define: Reg+-observations (& observ. graphs) for λletrec-terms ◮ show: for every λletrec-term L, the S+

eag-observ. graph of L is finite

◮ show: observation graph of λletrec-term L is finite

⇒ observation graph of the unfolding U(L) of L is finite.

slide-90
SLIDE 90

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 90

Main Result

Theorem

An infinite λ-term is λletrec-expressible if and only if it is strongly regular.

Proof.

⇐: For every infinite λ-term M:

M is strongly regular =

⇒ ⊢Reg+ ()M = ⇒ ⊢Reg+

0 ()M

= ⇒ ⊢ann-Reg+

0 () L : M

= ⇒ L →ω

▽ M

= ⇒ L expresses M ⇒:

◮ define: Reg+-observations (& observ. graphs) for λletrec-terms ◮ show: for every λletrec-term L, the S+

eag-observ. graph of L is finite

◮ show: observation graph of λletrec-term L is finite

⇒ observation graph of the unfolding U(L) of L is finite.

slide-91
SLIDE 91

Grabmayer, Rochel Expressibility in the Lambda Calculus with letrec 91

Main theorem (extended)

Theorem

For all infinite λ-terms the following are equivalent: (i) M is λletrec-expressible. (ii) M is strongly regular. (iii) M only contains finite binding–capturing chains.