explicit rewriting
play

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 , . . . }


  1. Explicit Rewriting François-Régis Sinot LIX, École Polytechnique, France Projet Logical: PCRI, CNRS, EP , INRIA, UPS Workshop on the ρ -calculus, 2005

  2. Ladies and gentlemen. . . ◮ take a TRS R = { l i → r i } i on Σ = { f , . . . }

  3. Ladies and gentlemen. . . ◮ take a TRS R = { l i → r i } i on Σ = { f , . . . } ◮ we define a new TRS (Σ ′ , R ′ ) :

  4. Ladies and gentlemen. . . ◮ take a TRS R = { l i → r i } i on Σ = { f , . . . } ◮ we define a new TRS (Σ ′ , R ′ ) : ◮ Σ ′ = Σ ∪ {⇓ , ⇑}

  5. Ladies and gentlemen. . . ◮ take a TRS R = { l i → r i } i on Σ = { f , . . . } ◮ we define a new TRS (Σ ′ , R ′ ) : ◮ Σ ′ = Σ ∪ {⇓ , ⇑} ◮ we write ⇓ t instead of ⇓ ( t )

  6. Ladies and gentlemen. . . ◮ take a TRS R = { l i → r i } i on Σ = { f , . . . } ◮ we define a new TRS (Σ ′ , R ′ ) : ◮ Σ ′ = Σ ∪ {⇓ , ⇑} ◮ we write ⇓ t instead of ⇓ ( t ) ◮ R ′ consists of:

  7. Ladies and gentlemen. . . ◮ take a TRS R = { l i → r i } i on Σ = { f , . . . } ◮ we define a new TRS (Σ ′ , R ′ ) : ◮ Σ ′ = Σ ∪ {⇓ , ⇑} ◮ we write ⇓ t instead of ⇓ ( t ) ◮ R ′ consists of: ◮ ⇓ l i � ⇑ r i

  8. Ladies and gentlemen. . . ◮ take a TRS R = { l i → r i } i on Σ = { f , . . . } ◮ we define a new TRS (Σ ′ , R ′ ) : ◮ Σ ′ = Σ ∪ {⇓ , ⇑} ◮ we write ⇓ t instead of ⇓ ( t ) ◮ R ′ consists of: ◮ ⇓ l i � ⇑ r i ◮ ⇓ f ( x 1 , . . . , x j , . . . , x n ) � f ( x 1 , . . . , ⇓ x j , . . . , x n )

  9. Ladies and gentlemen. . . ◮ take a TRS R = { l i → r i } i on Σ = { f , . . . } ◮ we define a new TRS (Σ ′ , R ′ ) : ◮ Σ ′ = Σ ∪ {⇓ , ⇑} ◮ we write ⇓ t instead of ⇓ ( t ) ◮ R ′ consists of: ◮ ⇓ l i � ⇑ r i ◮ ⇓ f ( x 1 , . . . , x j , . . . , x n ) � f ( x 1 , . . . , ⇓ x j , . . . , x n ) ◮ f ( x 1 , . . . , ⇑ x j , . . . , x n ) � ⇑ f ( x 1 , . . . , x j , . . . , x n )

  10. Ladies and gentlemen. . . ◮ take a TRS R = { l i → r i } i on Σ = { f , . . . } ◮ we define a new TRS (Σ ′ , R ′ ) : ◮ Σ ′ = Σ ∪ {⇓ , ⇑} ◮ we write ⇓ t instead of ⇓ ( t ) ◮ R ′ consists of: ◮ ⇓ l i � ⇑ r i ◮ ⇓ f ( x 1 , . . . , x j , . . . , x n ) � f ( x 1 , . . . , ⇓ x j , . . . , x n ) ◮ f ( x 1 , . . . , ⇑ x j , . . . , x n ) � ⇑ f ( x 1 , . . . , x j , . . . , x n ) ◮ that’s it !

  11. So what ? ◮ t always in normal form; start from ⇓ t

  12. So what ? ◮ t always in normal form; start from ⇓ t ◮ always exactly one occurrence of ⇓ or ⇑

  13. So what ? ◮ t always in normal form; start from ⇓ t ◮ always exactly one occurrence of ⇓ or ⇑ ◮ reduction always happens at this unique occurrence

  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

  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 : ⇒ ⇓ t � ∗ ⇑ u prop. : t → u ⇐

  16. Multi-step reduction ◮ add the rule (restart) : ⇑ x � ⇓ x

  17. Multi-step reduction ◮ add the rule (restart) : ⇑ x � ⇓ x ◮ prop. : t → ∗ u ⇐ ⇒ ⇑ t � ∗ ⇑ u

  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)

  19. Example 1: length of reductions ◮ R = { f ( a ) → b , a → c }

  20. Example 1: length of reductions ◮ R = { f ( a ) → b , a → c } (one step) ◮ f ( a ) → b

  21. Example 1: length of reductions ◮ R = { f ( a ) → b , a → c } (one step) ◮ f ( a ) → b ◮ ⇓ f ( a ) � ⇑ b

  22. Example 1: length of reductions ◮ R = { f ( a ) → b , a → c } (one step) ◮ f ( a ) → b ◮ ⇓ f ( a ) � ⇑ b (one step) ◮ f ( a ) → f ( c )

  23. Example 1: length of reductions ◮ R = { f ( a ) → b , a → c } (one step) ◮ f ( a ) → b ◮ ⇓ f ( a ) � ⇑ b (one step) ◮ f ( a ) → f ( c ) ◮ ⇓ f ( a ) � f ( ⇓ a ) � f ( ⇑ c ) � ⇑ f ( c )

  24. Example 2: confluence ? ◮ R = { f ( a ) → b } confluent

  25. Example 2: confluence ? ◮ R = { f ( a ) → b } confluent ◮ f ( a ) → b only possible reduction

  26. Example 2: confluence ? ◮ R = { f ( a ) → b } confluent ◮ f ( a ) → b only possible reduction ◮ ⇓ f ( a ) � ⇑ b

  27. Example 2: confluence ? ◮ R = { f ( a ) → b } confluent ◮ f ( a ) → b only possible reduction ◮ ⇓ f ( a ) � ⇑ b ◮ but ⇓ f ( a ) � f ( ⇓ a ) � �

  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 ?

  29. Confluence ◮ def.[x-confluence] : if ⇑ t � ∗ ⇑ u and ⇑ t � ∗ ⇑ v , then there exists w such that ⇑ u � ∗ ⇑ w and ⇑ v � ∗ ⇑ w

  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

  31. Termination ◮ def.[x-terminating] : no infinite sequence ⇑ t 1 � ∗ ⇑ t 2 � ∗ . . . � ∗ ⇑ t n � ∗ . . .

  32. Termination ◮ def.[x-terminating] : no infinite sequence ⇑ t 1 � ∗ ⇑ t 2 � ∗ . . . � ∗ ⇑ t n � ∗ . . . ◮ prop. : x-terminating ≡ terminating

  33. Termination ◮ def.[x-terminating] : no infinite sequence ⇑ t 1 � ∗ ⇑ t 2 � ∗ . . . � ∗ ⇑ t n � ∗ . . . ◮ prop. : x-terminating ≡ terminating ◮ prop. : → terminating ⇐ ⇒ � terminating

  34. Embedding strategies ◮ easy: just remove some rules

  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 ;

  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

  37. Related work ◮ CPS transformations

  38. Related work ◮ CPS transformations ◮ ρ -calculus

  39. Related work ◮ CPS transformations ◮ ρ -calculus ◮ rewriting logic

  40. Conclusion ◮ the reduction process is made explicit at the syntactic level

  41. Conclusion ◮ the reduction process is made explicit at the syntactic level ◮ the explicit TRS is simpler and equivalent

  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

  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

Recommend


More recommend