SLIDE 1
Explicit Rewriting Franois-Rgis Sinot LIX, cole Polytechnique, - - PowerPoint PPT Presentation
Explicit Rewriting Franois-Rgis Sinot LIX, cole Polytechnique, - - PowerPoint PPT Presentation
Explicit Rewriting Franois-Rgis Sinot LIX, cole Polytechnique, France Projet Logical: PCRI, CNRS, EP , INRIA, UPS Workshop on the -calculus, 2005 Ladies and gentlemen. . . take a TRS R = { l i r i } i on = { f , . . . }
SLIDE 2
SLIDE 3
Ladies and gentlemen. . .
◮ take a TRS R = {li → ri}i on Σ = {f, . . .} ◮ we define a new TRS (Σ′, R′):
SLIDE 4
Ladies and gentlemen. . .
◮ take a TRS R = {li → ri}i on Σ = {f, . . .} ◮ we define a new TRS (Σ′, R′): ◮ Σ′ = Σ ∪ {⇓, ⇑}
SLIDE 5
Ladies and gentlemen. . .
◮ take a TRS R = {li → ri}i on Σ = {f, . . .} ◮ we define a new TRS (Σ′, R′): ◮ Σ′ = Σ ∪ {⇓, ⇑} ◮ we write ⇓t instead of ⇓(t)
SLIDE 6
Ladies and gentlemen. . .
◮ take a TRS R = {li → ri}i on Σ = {f, . . .} ◮ we define a new TRS (Σ′, R′): ◮ Σ′ = Σ ∪ {⇓, ⇑} ◮ we write ⇓t instead of ⇓(t) ◮ R′ consists of:
SLIDE 7
Ladies and gentlemen. . .
◮ take a TRS R = {li → ri}i on Σ = {f, . . .} ◮ we define a new TRS (Σ′, R′): ◮ Σ′ = Σ ∪ {⇓, ⇑} ◮ we write ⇓t instead of ⇓(t) ◮ R′ consists of:
◮ ⇓li ⇑ri
SLIDE 8
Ladies and gentlemen. . .
◮ take a TRS R = {li → ri}i on Σ = {f, . . .} ◮ we define a new TRS (Σ′, R′): ◮ Σ′ = Σ ∪ {⇓, ⇑} ◮ we write ⇓t instead of ⇓(t) ◮ R′ consists of:
◮ ⇓li ⇑ri ◮ ⇓f(x1, . . . , xj, . . . , xn) f(x1, . . . , ⇓xj, . . . , xn)
SLIDE 9
Ladies and gentlemen. . .
◮ take a TRS R = {li → ri}i on Σ = {f, . . .} ◮ we define a new TRS (Σ′, R′): ◮ Σ′ = Σ ∪ {⇓, ⇑} ◮ we write ⇓t instead of ⇓(t) ◮ R′ consists of:
◮ ⇓li ⇑ri ◮ ⇓f(x1, . . . , xj, . . . , xn) f(x1, . . . , ⇓xj, . . . , xn) ◮ f(x1, . . . , ⇑xj, . . . , xn) ⇑f(x1, . . . , xj, . . . , xn)
SLIDE 10
Ladies and gentlemen. . .
◮ take a TRS R = {li → ri}i on Σ = {f, . . .} ◮ we define a new TRS (Σ′, R′): ◮ Σ′ = Σ ∪ {⇓, ⇑} ◮ we write ⇓t instead of ⇓(t) ◮ R′ consists of:
◮ ⇓li ⇑ri ◮ ⇓f(x1, . . . , xj, . . . , xn) f(x1, . . . , ⇓xj, . . . , xn) ◮ f(x1, . . . , ⇑xj, . . . , xn) ⇑f(x1, . . . , xj, . . . , xn)
◮ that’s it !
SLIDE 11
So what ?
◮ t always in normal form; start from ⇓t
SLIDE 12
So what ?
◮ t always in normal form; start from ⇓t ◮ always exactly one occurrence of ⇓ or ⇑
SLIDE 13
So what ?
◮ t always in normal form; start from ⇓t ◮ always exactly one occurrence of ⇓ or ⇑ ◮ reduction always happens at this unique occurrence
SLIDE 14
So what ?
◮ t always in normal form; start from ⇓t ◮ always exactly one occurrence of ⇓ or ⇑ ◮ reduction always happens at this unique occurrence ◮ so rewriting is simpler
SLIDE 15
So what ?
◮ t always in normal form; start from ⇓t ◮ always exactly one occurrence of ⇓ or ⇑ ◮ reduction always happens at this unique occurrence ◮ so rewriting is simpler ◮ it is also equivalent and more explicit:
prop.: t → u ⇐ ⇒ ⇓t ∗ ⇑u
SLIDE 16
Multi-step reduction
◮ add the rule (restart): ⇑x ⇓x
SLIDE 17
Multi-step reduction
◮ add the rule (restart): ⇑x ⇓x ◮ prop.: t →∗ u ⇐
⇒ ⇑t ∗ ⇑u
SLIDE 18
Multi-step reduction
◮ add the rule (restart): ⇑x ⇓x ◮ prop.: t →∗ u ⇐
⇒ ⇑t ∗ ⇑u
◮ more precisely:
prop.: t →n u ⇐ ⇒ ⇑t ∗ ⇑u using n times (restart)
SLIDE 19
Example 1: length of reductions
◮ R = {f(a) → b, a → c}
SLIDE 20
Example 1: length of reductions
◮ R = {f(a) → b, a → c} ◮ f(a) → b
(one step)
SLIDE 21
Example 1: length of reductions
◮ R = {f(a) → b, a → c} ◮ f(a) → b
(one step)
◮ ⇓f(a) ⇑b
SLIDE 22
Example 1: length of reductions
◮ R = {f(a) → b, a → c} ◮ f(a) → b
(one step)
◮ ⇓f(a) ⇑b ◮ f(a) → f(c)
(one step)
SLIDE 23
Example 1: length of reductions
◮ R = {f(a) → b, a → c} ◮ f(a) → b
(one step)
◮ ⇓f(a) ⇑b ◮ f(a) → f(c)
(one step)
◮ ⇓f(a) f(⇓a) f(⇑c) ⇑f(c)
SLIDE 24
Example 2: confluence ?
◮ R = {f(a) → b} confluent
SLIDE 25
Example 2: confluence ?
◮ R = {f(a) → b} confluent ◮ f(a) → b only possible reduction
SLIDE 26
Example 2: confluence ?
◮ R = {f(a) → b} confluent ◮ f(a) → b only possible reduction ◮ ⇓f(a) ⇑b
SLIDE 27
Example 2: confluence ?
◮ R = {f(a) → b} confluent ◮ f(a) → b only possible reduction ◮ ⇓f(a) ⇑b ◮ but ⇓f(a) f(⇓a)
SLIDE 28
Example 2: confluence ?
◮ R = {f(a) → b} confluent ◮ f(a) → b only possible reduction ◮ ⇓f(a) ⇑b ◮ but ⇓f(a) f(⇓a) ◮ preservation of confluence ?
SLIDE 29
Confluence
◮ def.[x-confluence]: if ⇑t ∗ ⇑u and ⇑t ∗ ⇑v, then there
exists w such that ⇑u ∗ ⇑w and ⇑v ∗ ⇑w
SLIDE 30
Confluence
◮ def.[x-confluence]: if ⇑t ∗ ⇑u and ⇑t ∗ ⇑v, then there
exists w such that ⇑u ∗ ⇑w and ⇑v ∗ ⇑w
◮ prop.: → confluent ⇐
⇒ x-confluent
SLIDE 31
Termination
◮ def.[x-terminating]: no infinite sequence
⇑t1 ∗ ⇑t2 ∗ . . . ∗ ⇑tn ∗ . . .
SLIDE 32
Termination
◮ def.[x-terminating]: no infinite sequence
⇑t1 ∗ ⇑t2 ∗ . . . ∗ ⇑tn ∗ . . .
◮ prop.: x-terminating ≡ terminating
SLIDE 33
Termination
◮ def.[x-terminating]: no infinite sequence
⇑t1 ∗ ⇑t2 ∗ . . . ∗ ⇑tn ∗ . . .
◮ prop.: x-terminating ≡ terminating ◮ prop.: → terminating ⇐
⇒ terminating
SLIDE 34
Embedding strategies
◮ easy: just remove some rules
SLIDE 35
Embedding strategies
◮ easy: just remove some rules ◮ example: “frozen operator”
Σ = {skip, done, ;} R = {skip → done, done;x → x} strategy: never reduce the right subterm of ;
SLIDE 36
Embedding strategies
◮ easy: just remove some rules ◮ example: “frozen operator”
Σ = {skip, done, ;} R = {skip → done, done;x → x} strategy: never reduce the right subterm of ;
◮ solution: remove rule ⇓(x;y) x;⇓y
SLIDE 37
Related work
◮ CPS transformations
SLIDE 38
Related work
◮ CPS transformations ◮ ρ-calculus
SLIDE 39
Related work
◮ CPS transformations ◮ ρ-calculus ◮ rewriting logic
SLIDE 40
Conclusion
◮ the reduction process is made explicit at the syntactic
level
SLIDE 41
Conclusion
◮ the reduction process is made explicit at the syntactic
level
◮ the explicit TRS is simpler and equivalent
SLIDE 42
Conclusion
◮ the reduction process is made explicit at the syntactic
level
◮ the explicit TRS is simpler and equivalent ◮ thus a compilation technique of TRSs into TRSs
SLIDE 43