ALMOST EVERY SIMPLY TYPED LAMBDA TERM HAS A LONG BETA-REDUCTION - - PowerPoint PPT Presentation

almost every simply typed lambda term has a long beta
SMART_READER_LITE
LIVE PREVIEW

ALMOST EVERY SIMPLY TYPED LAMBDA TERM HAS A LONG BETA-REDUCTION - - PowerPoint PPT Presentation

ALMOST EVERY SIMPLY TYPED LAMBDA TERM HAS A LONG BETA-REDUCTION SEQUENCE KAZUYUKI ASADA RYOMA SINYA TAKESHI TSUKADA NAOKI KOBAYASHI (THE UNIVERSITY OF TOKYO) MOTIVATION A simply-typed term can have a very long -reduction


slide-1
SLIDE 1

ALMOST EVERY SIMPLY TYPED LAMBDA TERM HAS A LONG BETA-REDUCTION SEQUENCE

RYOMA SIN’YA NAOKI KOBAYASHI KAZUYUKI ASADA TAKESHI TSUKADA

(THE UNIVERSITY OF TOKYO)

λ

slide-2
SLIDE 2

MOTIVATION

  • A simply-typed term can have a very long β-reduction

sequence.

  • k-EXP in the size of terms of order k [Beckmann 2001].

0-EXP(n) = n (m + 1)-EXP(n) = 2m-EXP(n)

  • How many terms have such long β-reduction

sequences?

slide-3
SLIDE 3

MOTIVATION

e.g.

  • A simply-typed term can have a very long β-reduction

sequence.

  • k-EXP in the size of terms of order k [Beckmann 2001].
  • How many terms have such long β-reduction

sequences?

where Twice = λf.λx.f(f x)

(Twice)n Twice · · · Twice | {z }

k−2 times

(λx.bxx)((λx.x)c)

slide-4
SLIDE 4
  • The work has been motivated by quantitative analysis
  • f the complexity of higher-order model checking

(HOMC).

SIDE REMARK

  • Input : tree automaton and λY-term t.


Output : YES if accepts the infinite tree
 represented by t, NO otherwise.
 Complexity: k-EXPTIME-complete for order-k λY-terms.

  • We want to (dis)prove: HOMC can be efficiently

solved for almost every input.

HIGHER-ORDER MODEL CHECKING

A A [Ong 2006]

slide-5
SLIDE 5

RELATED WORK

  • Quantitative analysis of untyped terms:
  • Almost every λ-term is strongly normalizing (SN), but

almost every SK-combinatory term is not SN 
 [David et al. 2009].

  • Almost every de Bruijn λ-term is not SN

[Bendkowski et al. 2015].

  • Empirical results: almost every λ-term is not β-normal,

untypable [Grygiel-Lescanne 2013].

slide-6
SLIDE 6

RELATED WORK

  • Quantitative analysis of untyped terms:
  • Almost every λ-term is strongly normalizing (SN), but

almost every SK-combinatory term is not SN 
 [David et al. 2009].

  • Almost every de Bruijn λ-term is not SN

[Bendkowski et al. 2015].

  • Empirical results: almost every λ-term is not β-normal,

untypable [Grygiel-Lescanne 2013].

  • Quantitative analysis of typed terms: little is known.
slide-7
SLIDE 7

OUTLINE

λ

  • Introduction
  • Our result
  • Proof of our result
  • Conclusion
slide-8
SLIDE 8

For and ,

k, ι, ξ ≥ 2

lim

n→∞

#{[t]α ∈ Λα

n(k, ι, ξ)} | β(t) ≥ (k − 2)-EXP(n)}

#Λα

n(k, ι, ξ)

= 1.

k ≤ ι

OUR RESULT

: the set of α-equivalence classes of size-n 
 terms such that:

(2) the number of arguments (internal arity) is at most .

ι

(3) the number of distinct variables is at most .

ξ

Λα

n(k, ι, ξ)

(1) the order is at most .

k

slide-9
SLIDE 9

For and ,

k, ι, ξ ≥ 2

lim

n→∞

#{[t]α ∈ Λα

n(k, ι, ξ)} | β(t) ≥ (k − 2)-EXP(n)}

#Λα

n(k, ι, ξ)

= 1.

k ≤ ι

OUR RESULT

: the set of α-equivalence classes of size-n 
 terms such that:

(2) the number of arguments (internal arity) is at most .

ι

(3) the number of distinct variables is at most .

ξ

Λα

n(k, ι, ξ)

(1) the order is at most .

k

the maximum length of
 β-reduction sequences of t.

slide-10
SLIDE 10

For and ,

k, ι, ξ ≥ 2

lim

n→∞

#{[t]α ∈ Λα

n(k, ι, ξ)} | β(t) ≥ (k − 2)-EXP(n)}

#Λα

n(k, ι, ξ)

= 1.

k ≤ ι

OUR RESULT

: the set of α-equivalence classes of size-n 
 terms such that:

(2) the number of arguments (internal arity) is at most .

ι

(3) the number of distinct variables is at most .

ξ

Λα

n(k, ι, ξ)

(1) the order is at most .

k

the maximum length of
 β-reduction sequences of t.

slide-11
SLIDE 11

For and ,

k, ι, ξ ≥ 2

lim

n→∞

#{[t]α ∈ Λα

n(k, ι, ξ)} | β(t) ≥ (k − 2)-EXP(n)}

#Λα

n(k, ι, ξ)

= 1.

k ≤ ι

OUR RESULT

: the set of α-equivalence classes of size-n 
 terms such that:

(2) the number of arguments (internal arity) is at most .

ι

(3) the number of distinct variables is at most .

ξ Almost every term of size n and order at most k has a β-reduction sequence of length (k-2)-EXP(n).

Λα

n(k, ι, ξ)

(1) the order is at most .

k

the maximum length of
 β-reduction sequences of t.

slide-12
SLIDE 12

OUR RESULT

(2) the number of arguments (internal arity) is at most .

ι

(3) the number of distinct variables is at most .

ξ

For and ,

k, ι, ξ ≥ 2

lim

n→∞

#{[t]α ∈ Λα

n(k, ι, ξ)} | β(t) ≥ (k − 2)-EXP(n)}

#Λα

n(k, ι, ξ)

= 1.

(1) the order is at most .

k

k ≤ ι

: the set of α-equivalence classes of size-n 
 terms such that:

Λα

n(k, ι, ξ)

slide-13
SLIDE 13

NUMBER OF DISTINCT VARIABLES

#V(t)

  • : the # of variables in t excluding unused

variables.

#Vα([t]α) , min{#V(t0) | t0 ∈ [t]α}

  • For an α-equivalence class ,

[t]α

slide-14
SLIDE 14

NUMBER OF DISTINCT VARIABLES

  • For an α-equivalence class ,

[t]α Example

#Vα([t]α) , min{#V(t0) | t0 ∈ [t]α} #Vα([(λz.z)λy.x]α) = ?

#V(t)

  • : the # of variables in t excluding unused

variables.

slide-15
SLIDE 15

NUMBER OF DISTINCT VARIABLES

  • For an α-equivalence class ,

[t]α Example

#Vα([t]α) , min{#V(t0) | t0 ∈ [t]α} #Vα([(λz.z)λy.x]α) = ?

#V(t)

  • : the # of variables in t excluding unused

variables.

#V((λz.z)λy.x) = #{x, z} = 2

slide-16
SLIDE 16

NUMBER OF DISTINCT VARIABLES

  • For an α-equivalence class ,

[t]α Example

#Vα([t]α) , min{#V(t0) | t0 ∈ [t]α} #Vα([(λz.z)λy.x]α) = ?

#V(t)

  • : the # of variables in t excluding unused

variables.

#V((λz.z)λy.x) = #{x, z} = 2

slide-17
SLIDE 17

NUMBER OF DISTINCT VARIABLES

  • For an α-equivalence class ,

[t]α Example

#Vα([t]α) , min{#V(t0) | t0 ∈ [t]α} #Vα([(λz.z)λy.x]α) = ?

#V(t)

  • : the # of variables in t excluding unused

variables.

#V((λz.z)λy.x) = #{x, z} = 2 #V((λx.x)λy.x) = #{x} = 1

slide-18
SLIDE 18

NUMBER OF DISTINCT VARIABLES

  • For an α-equivalence class ,

[t]α Example

#Vα([t]α) , min{#V(t0) | t0 ∈ [t]α} #Vα([(λz.z)λy.x]α) = 1

#V(t)

  • : the # of variables in t excluding unused

variables.

#V((λz.z)λy.x) = #{x, z} = 2 #V((λx.x)λy.x) = #{x} = 1

slide-19
SLIDE 19

OUR RESULT

(2) the number of arguments (internal arity) is at most .

ι

(3) the number of distinct variables is at most .

ξ

(1) the order is at most .

k For and ,

k, ι, ξ ≥ 2

lim

n→∞

#{[t]α ∈ Λα

n(k, ι, ξ)} | β(t) ≥ (k − 2)-EXP(n)}

#Λα

n(k, ι, ξ)

= 1.

k ≤ ι

[t]α ∈ Λα

n(k, ι, ξ)

#Vα([t]α) ≤ ξ for every : the set of α-equivalence classes of size-n 
 terms such that:

Λα

n(k, ι, ξ)

slide-20
SLIDE 20

OUTLINE

λ

  • Introduction
  • Our result
  • Proof of our result
  • Conclusion
slide-21
SLIDE 21

OVERVIEW OF OUR PROOF

  • Almost every term contains a certain “context”

that has a very long β-reduction sequence.

slide-22
SLIDE 22

OVERVIEW OF OUR PROOF

  • Almost every term contains a certain “context”

that has a very long β-reduction sequence.

slide-23
SLIDE 23

OVERVIEW OF OUR PROOF

  • Almost every term contains a certain “context”

that has a very long β-reduction sequence.

  • Inspired by Infinite Monkey Theorem: for any word x,

almost every word contains x as a subword.

slide-24
SLIDE 24

OUTLINE

λ

  • Introduction
  • Our result
  • Proof of our result


  • Conclusion
  • Idea
  • Infinite Monkey Theorem
  • Decomposition of terms
  • Sketch of the proof
slide-25
SLIDE 25

PROOF IDEA

  • 1. Parameterizing Infinite Monkey Theorem.
  • 2. Extending (1) to λ-terms.
  • 3. Constructing “explosive context” that generates

a long β-reduction sequence.

slide-26
SLIDE 26

INFINITE MONKEY THEOREM

For any word over an alphabet A, u, v ∈ A∗. for some words

x v w , w = uxv

lim

n→∞

#{w 2 An | x v w} #An = 1.

x

slide-27
SLIDE 27

INFINITE MONKEY THEOREM

For any word over an alphabet A, u, v ∈ A∗. for some words

x v w , w = uxv

lim

n→∞

#{w 2 An | x v w} #An = 1.

x

slide-28
SLIDE 28

IDEA1: PARAMETERIZING INFINITE MONKEY THEOREM

For any family of words over A such that

(xn)n

lim

n→∞

#{w 2 An | xn v w} #An = 1.

log(2)(n) = log(log(n))

|xn| = dlog(2)(n)e,

slide-29
SLIDE 29

IDEA2: EXTENDING IDEA1 TO TERMS

For any family of contexts such that

(Cn)n

if .

|Cn| = dlog(2)(n)e, C t ⇔

for some context and term .

C0 t = C0[C[t0]] t0

lim

n→∞

#{[t]α 2 Λα

n(k, ι, ξ)} | Cn t}

#Λα

n(k, ι, ξ)

= 1.

k, ι, ξ ≥ 2

slide-30
SLIDE 30

IDEA3: CONSTRUCTING “EXPLOSIVE” CONTEXT

  • For parameters n and k, we define the explosive

context of order-k as:

λx.

  • (Twice)n Twice · · · Twice

| {z }

k−2 times

Dup(Id [ ])

  • where Twice = λf.λx.f(f x)

Dup = λx.(λy.λz.y)xx and Id = λx.x

n

k

slide-31
SLIDE 31

IDEA3: CONSTRUCTING “EXPLOSIVE” CONTEXT

  • For parameters n and k, we define the explosive

context of order-k as:

n

k

β ⇣ ⌘ ≥ k-EXP(n)

  • It has the following “explosive property”:

λx.

  • (Twice)n Twice · · · Twice

| {z }

k−2 times

Dup(Id [ ])

  • where Twice = λf.λx.f(f x)

Dup = λx.(λy.λz.y)xx and Id = λx.x

n

k

slide-32
SLIDE 32

IDEA3: CONSTRUCTING “EXPLOSIVE” CONTEXT

t ) k-EXP(n)  β(t).

n

k

  • It has the following “explosive property”:
  • For parameters n and k, we define the explosive

context of order-k as:

λx.

  • (Twice)n Twice · · · Twice

| {z }

k−2 times

Dup(Id [ ])

  • where Twice = λf.λx.f(f x)

Dup = λx.(λy.λz.y)xx and Id = λx.x

n

k

slide-33
SLIDE 33

HARVEST

For and ,

k, ι, ξ ≥ 2

k

dlog(2)(n)e

lim

n→∞

#{[t]α 2 Λα

n(k, ι, ξ)} |

t} #Λα

n(k, ι, ξ)

= 1.

k ≤ ι

slide-34
SLIDE 34

HARVEST

A direct corollary of the explosive property:

t ) (k 2)-EXP(n)  β(t).

Almost every term of size n and order at most k has a β-reduction sequence of length (k-2)-EXP(n).

k

dlog(2)(n)e

For and ,

k, ι, ξ ≥ 2

k

dlog(2)(n)e

lim

n→∞

#{[t]α 2 Λα

n(k, ι, ξ)} |

t} #Λα

n(k, ι, ξ)

= 1.

k ≤ ι

slide-35
SLIDE 35

PROOF IDEA

  • 1. Parameterizing Infinite Monkey Theorem.
  • 2. Extending (1) to λ-terms.
  • 3. Constructing “explosive context” that generates

a long β-reduction sequence.

slide-36
SLIDE 36

PROOF IDEA

  • 1. Parameterizing Infinite Monkey Theorem.
  • 2. Extending (1) to λ-terms.
  • 3. Constructing “explosive context” that generates

a long β-reduction sequence. Most technical part

slide-37
SLIDE 37

PROOF IDEA

  • 1. Parameterizing Infinite Monkey Theorem.
  • 2. Extending (1) to λ-terms.
  • 3. Constructing “explosive context” that generates

a long β-reduction sequence. Most technical part We first give a proof of (1), because it clarify the overall structure of the proof of (2).

slide-38
SLIDE 38

λ

http://en.wikipedia.org/wiki/ Infinite_monkey_theorem

OUTLINE

  • Introduction
  • Our result
  • Proof of our result


  • Conclusion
  • Idea
  • Infinite Monkey Theorem
  • Decomposition of terms
  • Sketch of the proof
slide-39
SLIDE 39

For any word over an alphabet A,

x

lim

n→∞

#{w 2 An | x v w} #An = 1.

*

It suffice to show that:

#{w 2 An | x 6v w} #An

→ 0 (n → ∞)

PROOF OF MONKEY THEOREM FOR WORDS

slide-40
SLIDE 40

PROOF OF MONKEY THEOREM FOR WORDS

*

?

→ 0 (n → ∞)

#{w 2 An | x 6v w} #An

slide-41
SLIDE 41

PROOF OF MONKEY THEOREM FOR WORDS

*

?

→ 0 (n → ∞)

Let ` = |x|, w ∈ An.

#{w 2 An | x 6v w} #An

slide-42
SLIDE 42

PROOF OF MONKEY THEOREM FOR WORDS

*

?

→ 0 (n → ∞)

w = w1 w2 · · · wbn/`c w0

Let ` = |x|, w ∈ An.

#{w 2 An | x 6v w} #An

slide-43
SLIDE 43

PROOF OF MONKEY THEOREM FOR WORDS

*

|{z}

`

?

→ 0 (n → ∞)

w = w1 w2 · · · wbn/`c w0

Let ` = |x|, w ∈ An.

#{w 2 An | x 6v w} #An

slide-44
SLIDE 44

PROOF OF MONKEY THEOREM FOR WORDS

*

|{z}

`

?

→ 0 (n → ∞)

w = w1 w2 · · · wbn/`c w0

Let ` = |x|, w ∈ An.

|{z}

`

#{w 2 An | x 6v w} #An

slide-45
SLIDE 45

PROOF OF MONKEY THEOREM FOR WORDS

*

|{z}

`

?

→ 0 (n → ∞)

w = w1 w2 · · · wbn/`c w0

Let ` = |x|, w ∈ An.

|{z}

`

|{z}

`

#{w 2 An | x 6v w} #An

slide-46
SLIDE 46

PROOF OF MONKEY THEOREM FOR WORDS

*

|{z}

`

(n mod `)<`

z}|{

?

→ 0 (n → ∞)

w = w1 w2 · · · wbn/`c w0

Let ` = |x|, w ∈ An.

|{z}

`

|{z}

`

#{w 2 An | x 6v w} #An

slide-47
SLIDE 47

PROOF OF MONKEY THEOREM FOR WORDS

*

|{z}

`

(n mod `)<`

z}|{

w = w1 w2 · · · wbn/`c w0

Let ` = |x|, w ∈ An.

|{z}

`

|{z}

`

#{w 2 An | x 6v w} #An

 #{w 2 An | wi 6= x for all i  bn/`c} #An

slide-48
SLIDE 48

PROOF OF MONKEY THEOREM FOR WORDS

*

= ✓ 1 − 1 #A` ◆bn/`c

|{z}

`

(n mod `)<`

z}|{

w = w1 w2 · · · wbn/`c w0

Let ` = |x|, w ∈ An.

|{z}

`

|{z}

`

#{w 2 An | x 6v w} #An

 #{w 2 An | wi 6= x for all i  bn/`c} #An

slide-49
SLIDE 49

PROOF OF MONKEY THEOREM FOR WORDS

*

= ✓ 1 − 1 #A` ◆bn/`c

|{z}

`

(n mod `)<`

z}|{

w = w1 w2 · · · wbn/`c w0

Let ` = |x|, w ∈ An.

|{z}

`

|{z}

`

#{w 2 An | x 6v w} #An

→ 0 (n → ∞)

*

 #{w 2 An | wi 6= x for all i  bn/`c} #An

slide-50
SLIDE 50
  • Previous proof is based on a “good” decomposition of words.
  • This good decomposition is induced by the following

coproduct-product form:

|{z}

`

(n mod `)<`

z}|{

w = w1 w2 · · · wbn/`c w0

|{z}

`

|{z}

`

An 3

cf.

DECOMPOSITION OF WORDS

An ∼ = a

w02A(n mod `)

Y

ibn/`c

A`

  • This point of view forms the basis of the later extensions.
slide-51
SLIDE 51

DECOMPOSITION OF WORDS

An ∼ = a

w02A(n mod `)

Y

ibn/`c

A`

w

w0

&

(w1, w2, · · · , wbn/`c)

∈ ∈

|{z}

`

(n mod `)<`

z}|{

w = w1 w2 · · · wbn/`c w0

|{z}

`

|{z}

`

An 3

cf.

slide-52
SLIDE 52

DECOMPOSITION OF WORDS

An ∼ = a

w02A(n mod `)

Y

ibn/`c

A`

w

w0

&

(w1, w2, · · · , wbn/`c)

∈ ∈

Residual part (coproduct part)

|{z}

`

(n mod `)<`

z}|{

w = w1 w2 · · · wbn/`c w0

|{z}

`

|{z}

`

An 3

cf.

slide-53
SLIDE 53

DECOMPOSITION OF WORDS

An ∼ = a

w02A(n mod `)

Y

ibn/`c

A`

w

w0

&

(w1, w2, · · · , wbn/`c)

∈ ∈

Decomposed parts (product parts)

Residual part (coproduct part)

|{z}

`

(n mod `)<`

z}|{

w = w1 w2 · · · wbn/`c w0

|{z}

`

|{z}

`

An 3

cf.

slide-54
SLIDE 54

*

An ∼ = a

w02A(n mod `)

Y

ibn/`c

A`

cf.

(residual part) (decomposed parts)

Let ` = |x|.

#{w 2 An | x 6v w} #An

PROOF OF INFINITE MONKEY THEOREM (REVISED)

slide-55
SLIDE 55

*

An ∼ = a

w02A(n mod `)

Y

ibn/`c

A`

cf.

(residual part) (decomposed parts)

Let ` = |x|.

#{w 2 An | x 6v w} #An

= # a

w02A(n mod `)

Y

ibn/`c

A` #An

PROOF OF INFINITE MONKEY THEOREM (REVISED)

slide-56
SLIDE 56

*

An ∼ = a

w02A(n mod `)

Y

ibn/`c

A`

cf.

(residual part) (decomposed parts)

Let ` = |x|.

#{w 2 An | x 6v w} #An

= # a

w02A(n mod `)

Y

ibn/`c

A` #An

≤ # a

w02A(n mod `)

Y

ibn/`c

  • A` \ {x}
  • #An

PROOF OF INFINITE MONKEY THEOREM (REVISED)

slide-57
SLIDE 57

PROOF OF INFINITE MONKEY THEOREM (REVISED)

* Let ` = |x|.

#{w 2 An | x 6v w} #An

= # a

w02A(n mod `)

Y

ibn/`c

A` #An

≤ # a

w02A(n mod `)

Y

ibn/`c

  • A` \ {x}
  • #An
slide-58
SLIDE 58

PROOF OF INFINITE MONKEY THEOREM (REVISED)

* Let ` = |x|.

#{w 2 An | x 6v w} #An

= # a

w02A(n mod `)

Y

ibn/`c

A` #An

≤ # a

w02A(n mod `)

Y

ibn/`c

  • A` \ {x}
  • #An

= ✓ 1 − 1 #A` ◆bn/`c

slide-59
SLIDE 59

PROOF OF INFINITE MONKEY THEOREM (REVISED)

* Let ` = |x|.

#{w 2 An | x 6v w} #An

= # a

w02A(n mod `)

Y

ibn/`c

A` #An

≤ # a

w02A(n mod `)

Y

ibn/`c

  • A` \ {x}
  • #An

= ✓ 1 − 1 #A` ◆bn/`c

→ 0 (n → ∞)

*

slide-60
SLIDE 60

For any family of words over A such that

(xn)n

lim

n→∞

#{w 2 An | xn v w} #An = 1.

|xn| = dlog(2)(n)e,

PROOF OF PARAMETERIZED INFINITE MONKEY THEOREM FOR WORDS

cf.

(residual part) (decomposed parts)

An ∼ = a

w02A(n mod dlog(2)(n)e)

Y

ibn/dlog(2)(n)ec

Adlog(2)(n)e

* #{w 2 An | xn 6v w}

#An  #{w 2 An | every decomposed part 6= x} #An

slide-61
SLIDE 61

For any family of words over A such that

(xn)n

lim

n→∞

#{w 2 An | xn v w} #An = 1.

|xn| = dlog(2)(n)e,

PROOF OF PARAMETERIZED INFINITE MONKEY THEOREM FOR WORDS

* #{w 2 An | xn 6v w}

#An  #{w 2 An | every decomposed part 6= x} #An

→ 0 (n → ∞)

*

= ✓ 1 − 1 Adlog(2)(n)e ◆bn/dlog(2)(n)ec

slide-62
SLIDE 62

CHALLENGE IN PROVING PARAMETERISED MONKEY THEOREM FOR TERMS

  • How to obtain such a “good” decomposition for the

set of λ-terms ?

  • Non-trivial since terms have various shapes:

Λα

n(k, ι, ξ)

slide-63
SLIDE 63

OUTLINE

λ

  • Introduction
  • Our result
  • Proof of our result


  • Conclusion
  • Idea
  • Infinite Monkey Theorem
  • Decomposition of terms
  • Sketch of the proof
slide-64
SLIDE 64

DECOMPOSITION OF TERMS

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

slide-65
SLIDE 65

DECOMPOSITION OF TERMS

λx.(λy.(λz.λx.z)(λx.(λx.y)λz.z))x

z y

x @

@

@

z

λz

λx

λy λz

λx λx λx Example

slide-66
SLIDE 66

DECOMPOSITION OF TERMS

λx.(λy.(λz.λx.z)(λx.(λx.y)λz.z))x

decomposition size m = 3

z y

x @

@

@

z

λz

λx

λy λz

λx λx λx Example

slide-67
SLIDE 67

DECOMPOSITION OF TERMS

λx.(λy.(λz.λx.z)(λx.(λx.y)λz.z))x

decomposition size m = 3

z y

x @

@

@

z

λz

λx

λy λz

λx λx λx

7 !

Φ3

@

J K J K J K λx λx

(λy.[ ])x

λz.λx.z

(λx.y)λz.z

Example

slide-68
SLIDE 68

DECOMPOSITION OF TERMS

λx.(λy.(λz.λx.z)(λx.(λx.y)λz.z))x

decomposition size m = 3

z y

x @

@

@

z

λz

λx

λy λz

λx λx λx

7 !

Φ3

@

J K J K J K λx λx

(λy.[ ])x

λz.λx.z

(λx.y)λz.z

Example

slide-69
SLIDE 69

DECOMPOSITION OF TERMS

λx.(λy.(λz.λx.z)(λx.(λx.y)λz.z))x

decomposition size m = 3

z y

x @

@

@

z

λz

λx

λy λz

λx λx λx

7 !

Φ3

@

J K J K J K λx λx

(λy.[ ])x

λz.λx.z

(λx.y)λz.z

Example

slide-70
SLIDE 70

DECOMPOSITION OF TERMS

λx.(λy.(λz.λx.z)(λx.(λx.y)λz.z))x

decomposition size m = 3

z y

x @

@

@

z

λz

λx

λy λz

λx λx λx

7 !

Φ3

@

J K J K J K λx λx

(λy.[ ])x

λz.λx.z

(λx.y)λz.z

Example

slide-71
SLIDE 71

DECOMPOSITION OF TERMS

λx.(λy.(λz.λx.z)(λx.(λx.y)λz.z))x

decomposition size m = 3

z y

x @

@

@

z

λz

λx

λy λz

λx λx λx

7 !

Φ3

@

J K J K J K λx λx

(λy.[ ])x

λz.λx.z

(λx.y)λz.z

Residual part (second-order context)

Example

slide-72
SLIDE 72

ANALOGY BETWEEN THE DECOMPOSITION OF TERMS AND WORDS

z

y x

@ @

@

z λz

λx

λy λz

λx λx λx

7 !

Φ3

@

J K

J K J K λx λx

(λy.[ ])x

λz.λx.z

(λx.y)λz.z

abracadabra

* Decomposed part * Residual part

7 ! abr aca dab ra

decompose

slide-73
SLIDE 73

cf.

DECOMPOSITION LEMMA

For and ,

n ≥ m ≥ 2

Λα

n(k, ι, ξ) ∼

= a

E∈Bn

m

Y

i≤shn(E)

U m

E.i

k, ι, ξ ≥ 0

An ∼ = a

w2A(n mod m)

Y

ib n

m c

Am

slide-74
SLIDE 74

cf.

DECOMPOSITION LEMMA

For and ,

n ≥ m ≥ 2

Λα

n(k, ι, ξ) ∼

= a

E∈Bn

m

Y

i≤shn(E)

U m

E.i

k, ι, ξ ≥ 0

some set of second-order contexts

An ∼ = a

w2A(n mod m)

Y

ib n

m c

Am

slide-75
SLIDE 75

cf.

DECOMPOSITION LEMMA

For and ,

n ≥ m ≥ 2

Λα

n(k, ι, ξ) ∼

= a

E∈Bn

m

Y

i≤shn(E)

U m

E.i

k, ι, ξ ≥ 0

some set of second-order contexts the number of holes in E

J K

An ∼ = a

w2A(n mod m)

Y

ib n

m c

Am

slide-76
SLIDE 76

cf.

DECOMPOSITION LEMMA

For and ,

n ≥ m ≥ 2

Λα

n(k, ι, ξ) ∼

= a

E∈Bn

m

Y

i≤shn(E)

U m

E.i

k, ι, ξ ≥ 0

some set of second-order contexts the set of “good” contexts that can be filled in the i-th hole of E. the number of holes in E

J K

An ∼ = a

w2A(n mod m)

Y

ib n

m c

Am

slide-77
SLIDE 77

For and ,

Each decomposed part does NOT depend on the residual part w

Am

cf.

DECOMPOSITION LEMMA

n ≥ m ≥ 2

Λα

n(k, ι, ξ) ∼

= a

E∈Bn

m

Y

i≤shn(E)

U m

E.i

k, ι, ξ ≥ 0

An ∼ = a

w2A(n mod m)

Y

ib n

m c

Am

Each decomposed part DOES depend on the residual part E

(and also on the index i) U m

E.i

slide-78
SLIDE 78

OUTLINE

λ

  • Introduction
  • Our result
  • Proof of our result


  • Conclusion
  • Idea
  • Infinite Monkey Theorem
  • Decomposition of terms
  • Sketch of the proof
slide-79
SLIDE 79

For any family of contexts of such that

(Cn)n

if .

|Cn| = dlog(2)(n)e,

lim

n→∞

#{[t]α 2 Λα

n(k, ι, ξ)} | Cn t}

#Λα

n(k, ι, ξ)

= 1.

k, ι, ξ ≥ 2

PROOF OF PARAMETERISED INFINITE MONKEY THOREM FOR TERMS Λα

n(k, ι, ξ)

*

#{[t]α 2 Λα

n(k, ι, ξ) | Cn 6 t}

#Λα

n(k, ι, ξ)

! 0 (n ! 1)

It is suffice to show that

slide-80
SLIDE 80

PROOF OF PARAMETERISED INFINITE MONKEY THOREM FOR TERMS

*

#{[t]α 2 Λα

n(k, ι, ξ) | Cn 6 t}

#Λα

n(k, ι, ξ)

! 0 (n ! 1)

?

cf.

∈ [t]α

Λα

n(k, ι, ξ) ∼

= a

E∈Blog(2)(n)

n

Y

i≤shn(E)

U log(2)(n)

E.i

Φlog(2)(n)

7

  • ! E &

(u1, u2, · · ·, ushn(E))

slide-81
SLIDE 81

PROOF OF PARAMETERISED INFINITE MONKEY THOREM FOR TERMS

*

#{[t]α 2 Λα

n(k, ι, ξ) | Cn 6 t}

#Λα

n(k, ι, ξ)

! 0 (n ! 1)

?

cf.

∈ [t]α

Λα

n(k, ι, ξ) ∼

= a

E∈Blog(2)(n)

n

Y

i≤shn(E)

U log(2)(n)

E.i

Φlog(2)(n)

7

  • ! E &

(u1, u2, · · ·, ushn(E))

 #{[t]α 2 Λα

n(k, ι, ξ) | Cn 6 ui for every i}

#Λα

n(k, ι, ξ)

slide-82
SLIDE 82

= # a

E2Bdlog(2)(n)e

n

Y

ishn(E)

n ui 2 U dlog(2)(n)e

E.i

| Cn 6 ui

  • #Λα

n(k, ι, ξ)

PROOF OF PARAMETERISED INFINITE MONKEY THOREM FOR TERMS

#{[t]α 2 Λα

n(k, ι, ξ) | Cn 6 t}

#Λα

n(k, ι, ξ)

! 0 (n ! 1)

?

 #{[t]α 2 Λα

n(k, ι, ξ) | Cn 6 ui for every i}

#Λα

n(k, ι, ξ)

*

slide-83
SLIDE 83

= # a

E2Bdlog(2)(n)e

n

Y

ishn(E)

n ui 2 U dlog(2)(n)e

E.i

| Cn 6 ui

  • #Λα

n(k, ι, ξ)

PROOF OF PARAMETERISED INFINITE MONKEY THOREM FOR TERMS

#{[t]α 2 Λα

n(k, ι, ξ) | Cn 6 t}

#Λα

n(k, ι, ξ)

! 0 (n ! 1)

?

 #{[t]α 2 Λα

n(k, ι, ξ) | Cn 6 ui for every i}

#Λα

n(k, ι, ξ)

*

≤ ⇣ 1 − 1/cγ2dlog(2)(n)e⌘n/4dlog(2)(n)e

slide-84
SLIDE 84

= # a

E2Bdlog(2)(n)e

n

Y

ishn(E)

n ui 2 U dlog(2)(n)e

E.i

| Cn 6 ui

  • #Λα

n(k, ι, ξ)

PROOF OF PARAMETERISED INFINITE MONKEY THOREM FOR TERMS

#{[t]α 2 Λα

n(k, ι, ξ) | Cn 6 t}

#Λα

n(k, ι, ξ)

! 0 (n ! 1)

?

 #{[t]α 2 Λα

n(k, ι, ξ) | Cn 6 ui for every i}

#Λα

n(k, ι, ξ)

*

≤ ⇣ 1 − 1/cγ2dlog(2)(n)e⌘n/4dlog(2)(n)e

shn(E) n/4dlog(2)(n)e for any E 2 Bdlog(2)(n)e

n

Lemma

slide-85
SLIDE 85

= # a

E2Bdlog(2)(n)e

n

Y

ishn(E)

n ui 2 U dlog(2)(n)e

E.i

| Cn 6 ui

  • #Λα

n(k, ι, ξ)

PROOF OF PARAMETERISED INFINITE MONKEY THOREM FOR TERMS

#{[t]α 2 Λα

n(k, ι, ξ) | Cn 6 t}

#Λα

n(k, ι, ξ)

! 0 (n ! 1)

?

 #{[t]α 2 Λα

n(k, ι, ξ) | Cn 6 ui for every i}

#Λα

n(k, ι, ξ)

*

≤ ⇣ 1 − 1/cγ2dlog(2)(n)e⌘n/4dlog(2)(n)e

shn(E) n/4dlog(2)(n)e for any E 2 Bdlog(2)(n)e

n

Lemma #U dlog(2)(n)e

E.i

= O(cγ2dlog(2)(n)e) for some constants c and γ Lemma

slide-86
SLIDE 86

= # a

E2Bdlog(2)(n)e

n

Y

ishn(E)

n ui 2 U dlog(2)(n)e

E.i

| Cn 6 ui

  • #Λα

n(k, ι, ξ)

PROOF OF PARAMETERISED INFINITE MONKEY THOREM FOR TERMS

#{[t]α 2 Λα

n(k, ι, ξ) | Cn 6 t}

#Λα

n(k, ι, ξ)

! 0 (n ! 1)

?

 #{[t]α 2 Λα

n(k, ι, ξ) | Cn 6 ui for every i}

#Λα

n(k, ι, ξ)

*

≤ ⇣ 1 − 1/cγ2dlog(2)(n)e⌘n/4dlog(2)(n)e

slide-87
SLIDE 87

= # a

E2Bdlog(2)(n)e

n

Y

ishn(E)

n ui 2 U dlog(2)(n)e

E.i

| Cn 6 ui

  • #Λα

n(k, ι, ξ)

PROOF OF PARAMETERISED INFINITE MONKEY THOREM FOR TERMS

#{[t]α 2 Λα

n(k, ι, ξ) | Cn 6 t}

#Λα

n(k, ι, ξ)

! 0 (n ! 1)

?

 #{[t]α 2 Λα

n(k, ι, ξ) | Cn 6 ui for every i}

#Λα

n(k, ι, ξ)

*

≤ ⇣ 1 − 1/cγ2dlog(2)(n)e⌘n/4dlog(2)(n)e → 0 (n → ∞) *

slide-88
SLIDE 88

For any family of contexts of such that

(Cn)n

if .

|Cn| = dlog(2)(n)e,

lim

n→∞

#{[t]α 2 Λα

n(k, ι, ξ)} | Cn t}

#Λα

n(k, ι, ξ)

= 1.

k, ι, ξ ≥ 2

PROOF OF PARAMETERISED INFINITE MONKEY THOREM FOR TERMS Λα

n(k, ι, ξ)

* *

#{[t]α 2 Λα

n(k, ι, ξ) | Cn 6 t}

#Λα

n(k, ι, ξ)

! 0 (n ! 1)

slide-89
SLIDE 89

SUMMARY OF THE MAIN PROOF

the probability that a term has a β-reduction sequence of length (k-2)-EXP(n) the probability that holds

k

( Monkey Theorem)

*

( explosive property)

*

t

[t]α ∈ → 1 (n → ∞)

dlog(2)(n)e

Λα

n(k, ι, ξ)

slide-90
SLIDE 90

OUTLINE

λ

  • Introduction
  • Proof of our result
  • Conclusion
slide-91
SLIDE 91

FUTURE WORK

  • Quantitative analysis of simply typed λ-terms in

different settings:

  • with an unbounded number of variables.
  • with recursion.
  • Almost every terms of size n and order at most k has a


β-reduction sequence of length (k-2)-EXP(n).

  • The core of our proof is a non-trivial extension of

well-known Infinite Monkey Theorem.

CONCLUSION