Explicit Rewriting Franois-Rgis Sinot LIX, cole Polytechnique, - - PowerPoint PPT Presentation

explicit rewriting
SMART_READER_LITE
LIVE PREVIEW

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-1
SLIDE 1

Explicit Rewriting

François-Régis Sinot

LIX, École Polytechnique, France Projet Logical: PCRI, CNRS, EP , INRIA, UPS

Workshop on the ρ-calculus, 2005

slide-2
SLIDE 2

Ladies and gentlemen. . .

◮ take a TRS R = {li → ri}i on Σ = {f, . . .}

slide-3
SLIDE 3

Ladies and gentlemen. . .

◮ take a TRS R = {li → ri}i on Σ = {f, . . .} ◮ we define a new TRS (Σ′, R′):

slide-4
SLIDE 4

Ladies and gentlemen. . .

◮ take a TRS R = {li → ri}i on Σ = {f, . . .} ◮ we define a new TRS (Σ′, R′): ◮ Σ′ = Σ ∪ {⇓, ⇑}

slide-5
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
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
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
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
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
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
SLIDE 11

So what ?

◮ t always in normal form; start from ⇓t

slide-12
SLIDE 12

So what ?

◮ t always in normal form; start from ⇓t ◮ always exactly one occurrence of ⇓ or ⇑

slide-13
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
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
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
SLIDE 16

Multi-step reduction

◮ add the rule (restart): ⇑x ⇓x

slide-17
SLIDE 17

Multi-step reduction

◮ add the rule (restart): ⇑x ⇓x ◮ prop.: t →∗ u ⇐

⇒ ⇑t ∗ ⇑u

slide-18
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
SLIDE 19

Example 1: length of reductions

◮ R = {f(a) → b, a → c}

slide-20
SLIDE 20

Example 1: length of reductions

◮ R = {f(a) → b, a → c} ◮ f(a) → b

(one step)

slide-21
SLIDE 21

Example 1: length of reductions

◮ R = {f(a) → b, a → c} ◮ f(a) → b

(one step)

◮ ⇓f(a) ⇑b

slide-22
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
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
SLIDE 24

Example 2: confluence ?

◮ R = {f(a) → b} confluent

slide-25
SLIDE 25

Example 2: confluence ?

◮ R = {f(a) → b} confluent ◮ f(a) → b only possible reduction

slide-26
SLIDE 26

Example 2: confluence ?

◮ R = {f(a) → b} confluent ◮ f(a) → b only possible reduction ◮ ⇓f(a) ⇑b

slide-27
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
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
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
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
SLIDE 31

Termination

◮ def.[x-terminating]: no infinite sequence

⇑t1 ∗ ⇑t2 ∗ . . . ∗ ⇑tn ∗ . . .

slide-32
SLIDE 32

Termination

◮ def.[x-terminating]: no infinite sequence

⇑t1 ∗ ⇑t2 ∗ . . . ∗ ⇑tn ∗ . . .

◮ prop.: x-terminating ≡ terminating

slide-33
SLIDE 33

Termination

◮ def.[x-terminating]: no infinite sequence

⇑t1 ∗ ⇑t2 ∗ . . . ∗ ⇑tn ∗ . . .

◮ prop.: x-terminating ≡ terminating ◮ prop.: → terminating ⇐

⇒ terminating

slide-34
SLIDE 34

Embedding strategies

◮ easy: just remove some rules

slide-35
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
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
SLIDE 37

Related work

◮ CPS transformations

slide-38
SLIDE 38

Related work

◮ CPS transformations ◮ ρ-calculus

slide-39
SLIDE 39

Related work

◮ CPS transformations ◮ ρ-calculus ◮ rewriting logic

slide-40
SLIDE 40

Conclusion

◮ the reduction process is made explicit at the syntactic

level

slide-41
SLIDE 41

Conclusion

◮ the reduction process is made explicit at the syntactic

level

◮ the explicit TRS is simpler and equivalent

slide-42
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
SLIDE 43

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 ◮ wide spectrum of application of the idea of explicit token