in Lambda Calculus with letrec (Work In Progress) Jan Rochel and - - PowerPoint PPT Presentation

in lambda calculus with letrec
SMART_READER_LITE
LIVE PREVIEW

in Lambda Calculus with letrec (Work In Progress) Jan Rochel and - - PowerPoint PPT Presentation

Avoiding Repetitive Reduction Patterns in letrec Rochel, Grabmayer 1 Avoiding Repetitive Reduction Patterns in Lambda Calculus with letrec (Work In Progress) Jan Rochel and Clemens Grabmayer Dept. of Computer Science, and Dept. of


slide-1
SLIDE 1

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 1

Avoiding Repetitive Reduction Patterns in Lambda Calculus with letrec

(Work In Progress)

Jan Rochel and Clemens Grabmayer

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

NWO-project Realising Optimal Sharing Utrecht University

TERMGRAPH 2011 Saarbrücken, April 2nd

slide-2
SLIDE 2

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 2

In this talk

We report on:

◮ an optimising transformation for λ-calculus with letrec ◮ by which i.p. the cyclic passing on of unchanged arguments during

evaluation can often be prevented

slide-3
SLIDE 3

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 3

In this talk

We report on:

◮ an optimising transformation for λ-calculus with letrec ◮ by which i.p. the cyclic passing on of unchanged arguments during

evaluation can often be prevented Examples:

◮ Haskell functions repeat, replicate, ++, map, until ◮ a specification of the Thue–Morse sequence

slide-4
SLIDE 4

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 4

In this talk

We report on:

◮ an optimising transformation for λ-calculus with letrec ◮ by which i.p. the cyclic passing on of unchanged arguments during

evaluation can often be prevented Examples:

◮ Haskell functions repeat, replicate, ++, map, until ◮ a specification of the Thue–Morse sequence

Concepts used:

◮ visible/concealed redexes ◮ generalised β-reduction ◮ domination in digraphs ◮ static analysis of cyclically reappearing redexes

slide-5
SLIDE 5

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 5

λ-Terms and λ-Trees

T

::=

V

(variable) |

T T

(application) | λV.T (abstraction)

slide-6
SLIDE 6

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 6

λ-Terms and λ-Trees

T

::=

V

(variable) |

T T

(application) | λV.T (abstraction) (λx.g (f x)) 3

@ λx @ g @ f x 3

slide-7
SLIDE 7

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 7

β-Reduction

(λx.M) N →β

M[x := N]

(λx.g (f x)) 3 →β

g (f 3)

@ λx @ g @ f x 3

→β

@ g @ f 3

slide-8
SLIDE 8

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 8

letrec-Terms and λ-Graphs

T

::=

V

(variable) |

T T

(application) | λV.T (abstraction) |

f(T,...,T)

(primitive functions) |

let Defs in T

(letrec)

Defs

::=

v1 = T ... vn = T

(equations) (v1,...,vn distinct variables)

let repeat = λx.x:repeat x in repeat

slide-9
SLIDE 9

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 9

letrec-Terms and λ-Graphs

T

::=

V

(variable) |

T T

(application) | λV.T (abstraction) |

f(T,...,T)

(primitive functions) |

let Defs in T

(letrec)

Defs

::=

v1 = T ... vn = T

(equations) (v1,...,vn distinct variables)

let repeat = λx.x:repeat x in repeat

λx : x @ x

slide-10
SLIDE 10

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 10

repeat

let repeat = λx.x:repeat x in repeat

λx : x @ x

slide-11
SLIDE 11

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 11

repeat

let repeat = λx.x:repeat x in repeat

λx : x @ x

→▽

λx : x @ x λx : x @ x

slide-12
SLIDE 12

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 12

repeat

let repeat = λx.x:repeat x in repeat

λx : x @ x

։▽

λx : x @ x λx : x @ x λx : x @ x

slide-13
SLIDE 13

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 13

repeat

let repeat = λx.x:repeat x in repeat

λx : x @ x

։ ։▽

λx : x @ λx : x @ . . . x x

slide-14
SLIDE 14

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 14

Visible and concealed redexes

@ λx @ g @ @ λy y x 3

Common practice in existing compilers:

◮ Exhaustive reduction of visible redexes

slide-15
SLIDE 15

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 15

Visible and concealed redexes

@ λx @ g @ @ λy y x 3

→β

@ λx @ g @ x 3

Common practice in existing compilers:

◮ Exhaustive reduction of visible redexes

slide-16
SLIDE 16

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 16

Visible and concealed redexes

@ λx @ g @ @ λy y x 3

→β

@ g x 3

Common practice in existing compilers:

◮ Exhaustive reduction of visible redexes ◮ This is in general not possible for concealed redexes

slide-17
SLIDE 17

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 17

repeat 3

λx : x @ x @ 3

let repeat = λx.x:repeat x in repeat 3

slide-18
SLIDE 18

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 18

→▽

: x @ x λx : x @ x @ λx 3

let repeat = λx.x:repeat x in (λx.x:repeat x) 3

slide-19
SLIDE 19

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 19

: x @ x λx : x @ x @ λx 3

let repeat = λx.x:repeat x in (λx.x:repeat x) 3

slide-20
SLIDE 20

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 20

→β

: 3 @ 3 λx : x @ x

let repeat = λx.x:repeat x in 3:repeat 3

slide-21
SLIDE 21

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 21

→▽

: 3 @ 3 : x @ x λx : x @ x λx

let repeat = λx.x:repeat x in 3:(λx.x:repeat x) 3

slide-22
SLIDE 22

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 22

: 3 @ 3 : x @ x λx : x @ x λx

let repeat = λx.x:repeat x in 3:(λx.x:repeat x) 3

slide-23
SLIDE 23

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 23

→β

λx : x @ x : 3 : 3 @ 3

let repeat = λx.x:repeat x in 3:3:repeat 3

slide-24
SLIDE 24

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 24

։ ։▽,β

: 3 : 3 : 3 . . .

3:3:...

slide-25
SLIDE 25

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 25

և և▽

: 3

let rec = 3:rec in rec

slide-26
SLIDE 26

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 26

→▽

: 3 : 3

let rec = 3:rec in 3:rec

slide-27
SLIDE 27

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 27

→▽

: 3 : 3 : 3

let rec = 3:rec in 3:3:rec

slide-28
SLIDE 28

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 28

repeat 3

λx : x @ x @ 3

slide-29
SLIDE 29

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 29

repeat 3

λx : x @ x @ 3

։ ։▽

@ λx : x @ λx : x @ . . . x x 3

slide-30
SLIDE 30

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 30

repeat 3

λx : x @ x @ 3

։ ։▽

@ λx : x @ λx : x @ . . . x x 3

։ ։β

: 3 : 3 : 3 . . .

slide-31
SLIDE 31

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 31

repeat 3

λx : x @ x @ 3

։ ։▽

@ λx : x @ λx : x @ . . . x x 3

։ ։β

: 3 : 3 : 3 . . .

և և▽

: 3

slide-32
SLIDE 32

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 32

repeat

λx : x @ x

slide-33
SLIDE 33

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 33

repeat

λx : x @ x

։ ։▽

λx : x @ λx : x @ . . . x x

slide-34
SLIDE 34

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 34

repeat

λx : x @ x

։ ։▽

λx : x @ λx : x @ . . . x x

։ ։β

λx : x : x . . .

slide-35
SLIDE 35

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 35

repeat

λx : x @ x

։ ։▽

λx : x @ λx : x @ . . . x x

։ ։β

λx : x : x . . .

և և▽

λx : x

slide-36
SLIDE 36

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 36

Optimising repeat

let repeat = λx.x:repeat x in repeat

λx : x @ x

=∞

▽,β

λx : x

let repeat = λx.let xs = x:xs in xs in repeat

slide-37
SLIDE 37

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 37

Operational equivalence I

Used here:

=∞

▽,β = (և

և▽ ∪ և ևβ ∪ ։ ։β ∪ ։ ։▽)∗

as notion of operational equivalence.

slide-38
SLIDE 38

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 38

replicate

replicate 0 x = [ ] replicate n x = x:replicate (n−1) x replicate n x = let rec 0 = [ ] rec n = x:rec (n−1) in rec n

slide-39
SLIDE 39

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 39

replicate – generalised β-reduction

λn λx : x @ @ − n 1 x

slide-40
SLIDE 40

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 40

replicate – generalised β-reduction

λn λx : x @ @ − n 1 x

։ ։▽

λn λx : x @ @ λn λx : x @ @ . . . − n 1 x − n 1 x

slide-41
SLIDE 41

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 41

Generalised β-Reduction

@ @ λx @ λy λz @ z y x s r

slide-42
SLIDE 42

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 42

Generalised β-Reduction

@ @ λx @ λy λz @ z y x s r

slide-43
SLIDE 43

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 43

Generalised β-Reduction

@ @ λx @ λy λz @ z y x s r

→β

@ @ λy λz @ z y s r

slide-44
SLIDE 44

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 44

Generalised β-Reduction

@ @ λx @ λy λz @ z y x s r

→β

@ @ λy λz @ z y s r

slide-45
SLIDE 45

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 45

Generalised β-Reduction

@ @ λx @ λy λz @ z y x s r

→β

@ @ λy λz @ z y s r

→β

@ λz @ z s r

slide-46
SLIDE 46

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 46

Generalised β-Reduction

@ @ λx @ λy λz @ z y x s r

→β

@ @ λy λz @ z y s r

→β

@ λz @ z s r

→β

@ r s

slide-47
SLIDE 47

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 47

Generalised β-Reduction

@ @ λx @ λy λz @ z y x s r

։β

@ r s

slide-48
SLIDE 48

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 48

Generalised β-Reduction

@ @ λx @ λy λz @ z y x s r

։β

@ r s

←β

@ λy @ r y s

slide-49
SLIDE 49

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 49

Generalised β-Reduction

@ @ λx @ λy λz @ z y x s r

։β

@ r s

←β

@ λy @ r y s

←β

@ λx @ λy @ r y x s

slide-50
SLIDE 50

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 50

Generalised β-Reduction

@ @ λx @ λy λz @ z y x s r

→gβ

@ λx @ λy @ r y x s

→gβ ⊆ ։β . →β . ևβ ⊆ ↔∗

β

slide-51
SLIDE 51

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 51

replicate – duplication of the function body

λn λx : x @ @ − n 1 x

։ ։▽

λn λx : x @ @ λn λx : x @ @ . . . − n 1 x − n 1 x

slide-52
SLIDE 52

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 52

replicate – duplication of the function body

λn λx : x @ @ − n 1 x

։ ։▽

λn λx : x @ @ λn λx : x @ @ . . . − n 1 x − n 1 x

։ ։gβ

λn λx : x @ λn : x @ λn : x @ . . . − n 1 − n 1 − n 1

slide-53
SLIDE 53

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 53

replicate – duplication of the function body

λn λx : x @ @ − n 1 x

։ ։▽

λn λx : x @ @ λn λx : x @ @ . . . − n 1 x − n 1 x

։ ։gβ

λn λx : x @ λn : x @ λn : x @ . . . − n 1 − n 1 − n 1 և

և▽

λn λx : x @ λn : x @ − n 1 − n 1

slide-54
SLIDE 54

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 54

replicate – header trick

λn λx : x @ @ λn λx : x @ @ . . . − n 1 x − n 1 x

slide-55
SLIDE 55

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 55

replicate – header trick

λn λx : x @ @ λn λx : x @ @ . . . − n 1 x − n 1 x

ևη ևβ

λn λx @ @ λn λx : x @ @ λn λx . . . − n 1 x n x

slide-56
SLIDE 56

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 56

replicate – header trick

λn λx : x @ @ λn λx : x @ @ . . . − n 1 x − n 1 x

ևη ևβ

λn λx @ @ λn λx : x @ @ λn λx . . . − n 1 x n x

։ ։gβ

λn λx @ λn : x @ λn : x @ λn . . . − n 1 − n 1 n

slide-57
SLIDE 57

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 57

replicate – header trick

λn λx : x @ @ λn λx : x @ @ . . . − n 1 x − n 1 x

ևη ևβ

λn λx @ @ λn λx : x @ @ λn λx . . . − n 1 x n x

։ ։gβ

λn λx @ λn : x @ λn : x @ λn . . . − n 1 − n 1 n

և և▽

λn λx @ λn : x @ − n 1 n

slide-58
SLIDE 58

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 58

Operational equivalence II

◮ gβ-Convertibility:

=∞

▽,gβ

:= (և և▽ ∪ և ևgβ ∪ ։ ։gβ ∪ ։ ։▽)∗

slide-59
SLIDE 59

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 59

Rewrite Rule Formulation

f = λx1....λxn.λy.C [f t1 ...tn y]

f = λx1....λxn.λy. let f ′ = λx1....λxn.C [f ′ t1 ...tn] in f ′ x1 ...xn

slide-60
SLIDE 60

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 60

Rewriting repeat

let repeat = λx.x:repeat x in repeat

let repeat = λx.let xs = x:xs in xs in repeat

slide-61
SLIDE 61

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 61

Rewriting replicate

replicate 0 x = [ ] replicate n x = x:replicate (n−1) x

replicate n x = let rec 0 = [ ] rec n = x:rec (n−1) in rec n

slide-62
SLIDE 62

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 62

Rewriting append

(+ +) [ ] ys = ys (+ +) (x:xs) ys = x:xs+ +ys

(+ +) xs ys = let rec [ ] = ys rec (x:xs) = x:rec xs in rec xs

slide-63
SLIDE 63

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 63

Rewriting map

map [ ] = [ ] map f (x:xs) = f x:map f xs

map f = let rec [ ] = [ ] rec (x:xs) = f x:rec xs in rec

slide-64
SLIDE 64

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 64

Rewriting until

until p f x = if p x then x else until p f (f x)

until p f x = let rec x = if p x then x else rec (f x) in rec x

slide-65
SLIDE 65

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 65

Rewriting the Thue-Morse Sequence

let x a b = b:zip (x a b) (y a b) y s t = s :zip (y s t) (x s t) zip (x:xs) (y:ys) = x:y:zip xs ys in x 0 1

let x a b = let x′ = b:zip x′ (y a b) in x′ y s t = let y′ = s :zip y′ (x s t) in y′ zip (x:xs) (y:ys) = x:y:zip xs ys in x 0 1

slide-66
SLIDE 66

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 66

Binding-Graph Method

let x a b = b:zip (x a b) (y a b) y s t = s :zip (y s t) (x s t) zip (x:xs) (y:ys) = x:y:zip xs ys in x 0 1

Binding relation:

❜ ⊆

S × S

a b 1 s t

slide-67
SLIDE 67

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 67

Binding-Graph Method

let x a b = b:zip (x a b) (y a b) y s t = s :zip (y s t) (x s t) zip (x:xs) (y:ys) = x:y:zip xs ys in x 0 1

Binding relation:

❜ ⊆

S × S

a b 1 s t

slide-68
SLIDE 68

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 68

Binding-Graph Method

let x a b = b:zip (x a b) (y a b) y s t = s :zip (y s t) (x s t) zip (x:xs) (y:ys) = x:y:zip xs ys in x 0 1

Binding relation:

❜ ⊆

S × S

a b 1 s t

slide-69
SLIDE 69

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 69

Binding-Graph Method

let x a b = b:zip (x a b) (y a b) y s t = s :zip (y s t) (x s t) zip (x:xs) (y:ys) = x:y:zip xs ys in x 0 1

Binding relation:

❜ ⊆

S × S

a b 1 s t

slide-70
SLIDE 70

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 70

Binding-Graph Method

let x a b = b:zip (x a b) (y a b) y s t = s :zip (y s t) (x s t) zip (x:xs) (y:ys) = x:y:zip xs ys in x 0 1

Binding relation:

❜ ⊆

S × S

a b 1 s t

slide-71
SLIDE 71

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 71

Binding-Graph Method

let x a b = b:zip (x a b) (y a b) y s t = s :zip (y s t) (x s t) zip (x:xs) (y:ys) = x:y:zip xs ys in x 0 1

Binding relation:

❜ ⊆

S × S

a b 1 s t

slide-72
SLIDE 72

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 72

Binding-Graph Method

let x a b = b:zip (x a b) (y a b) y s t = s :zip (y s t) (x s t) zip (x:xs) (y:ys) = x:y:zip xs ys in x 0 1

Binding relation:

❜ ⊆

S × S

a b 1 s t

slide-73
SLIDE 73

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 73

Binding-Graph Method

let x a b = b:zip (x a b) (y a b) y s t = s :zip (y s t) (x s t) zip (x:xs) (y:ys) = x:y:zip xs ys in x 0 1

Binding relation:

❜ ⊆

S × S

a b 1 s t

slide-74
SLIDE 74

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 74

Binding-Graph Method

let x a b = b:zip (x a b) (y a b) y s t = s :zip (y s t) (x s t) zip (x:xs) (y:ys) = x:y:zip xs ys in x 0 1

Binding relation:

❜ ⊆

S × S

a b 1 s t

slide-75
SLIDE 75

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 75

Binding-Graph Method

let x a b = b:zip (x a b) (y a b) y s t = s :zip (y s t) (x s t) zip (x:xs) (y:ys) = x:y:zip xs ys in x 0 1

Binding relation:

❜ ⊆

S × S

a b 1 s t

slide-76
SLIDE 76

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 76

Binding-Graph Method

let x a b = b:zip (x a b) (y a b) y s t = s :zip (y s t) (x s t) zip (x:xs) (y:ys) = x:y:zip xs ys in x 0 1

Binding relation:

❜ ⊆

S × S

a b 1 s t

slide-77
SLIDE 77

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 77

Strong domination

Strong domination: sdomG(d,w) :=

∀p0 ֌ ... ֌ pn = v

n ≥ 0

a b 1 s t

slide-78
SLIDE 78

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 78

Strong domination

Strong domination: sdomG(d,w) :=

∀p0 ֌ ... ֌ pn = v : d ∈ {p0,...,pn}

n ≥ 0

a b 1 s t

slide-79
SLIDE 79

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 79

Strong domination

Strong domination: sdomG(d,w) :=

∀p0 ֌ ... ֌ pn = v : d ∈ {p0,...,pn}∨ d֌+p0 ∧ p0֌+d

n ≥ 0

a b 1 s t

slide-80
SLIDE 80

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 80

Optimising the Thue-Morse Sequence

let x a b = b:zip (x a b) (y a b) y s t = s :zip (y s t) (x s t) zip (x:xs) (y:ys) = x:y:zip xs ys in x 0 1 a b 1 s t

slide-81
SLIDE 81

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 81

Optimising the Thue-Morse Sequence

let x = 1:zip x y y = 0:zip y x zip (x:xs) (y:ys) = x:y:zip xs ys in x a b 1 s t

slide-82
SLIDE 82

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 82

Current Plans

◮ practical aspects

◮ implementation ◮ repetitive reduction patters in the wild: population census ◮ benchmarks ◮ analysis of effects for different run-time systems

◮ theoretical aspects

◮ HRS formulation ◮ domination after unfolding ◮ efficiency measure for comparing different results of optimisation ◮ interactions between optimisation of different parameter cycles ◮ correctness proof

◮ full paper

slide-83
SLIDE 83

Rochel, Grabmayer Avoiding Repetitive Reduction Patterns in λletrec 83

Thanks for your attention!

and for inspiration, and many discussions, to:

◮ Doaitse Swierstra ◮ Vincent van Oostrom