Explicit Rewriting François-Régis 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 , . . . }
Ladies and gentlemen. . . ◮ take a TRS R = { l i → r i } i on Σ = { f , . . . } ◮ we define a new TRS (Σ ′ , R ′ ) :
Ladies and gentlemen. . . ◮ take a TRS R = { l i → r i } i on Σ = { f , . . . } ◮ we define a new TRS (Σ ′ , R ′ ) : ◮ Σ ′ = Σ ∪ {⇓ , ⇑}
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 )
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:
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
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 )
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 )
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 !
So what ? ◮ t always in normal form; start from ⇓ t
So what ? ◮ t always in normal form; start from ⇓ t ◮ always exactly one occurrence of ⇓ or ⇑
So what ? ◮ t always in normal form; start from ⇓ t ◮ always exactly one occurrence of ⇓ or ⇑ ◮ reduction always happens at this unique occurrence
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
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 ⇐
Multi-step reduction ◮ add the rule (restart) : ⇑ x � ⇓ x
Multi-step reduction ◮ add the rule (restart) : ⇑ x � ⇓ x ◮ prop. : t → ∗ u ⇐ ⇒ ⇑ t � ∗ ⇑ u
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)
Example 1: length of reductions ◮ R = { f ( a ) → b , a → c }
Example 1: length of reductions ◮ R = { f ( a ) → b , a → c } (one step) ◮ f ( a ) → b
Example 1: length of reductions ◮ R = { f ( a ) → b , a → c } (one step) ◮ f ( a ) → b ◮ ⇓ f ( a ) � ⇑ b
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 )
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 )
Example 2: confluence ? ◮ R = { f ( a ) → b } confluent
Example 2: confluence ? ◮ R = { f ( a ) → b } confluent ◮ f ( a ) → b only possible reduction
Example 2: confluence ? ◮ R = { f ( a ) → b } confluent ◮ f ( a ) → b only possible reduction ◮ ⇓ f ( a ) � ⇑ b
Example 2: confluence ? ◮ R = { f ( a ) → b } confluent ◮ f ( a ) → b only possible reduction ◮ ⇓ f ( a ) � ⇑ b ◮ but ⇓ f ( a ) � f ( ⇓ a ) � �
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 ?
Confluence ◮ def.[x-confluence] : if ⇑ t � ∗ ⇑ u and ⇑ t � ∗ ⇑ v , then there exists w such that ⇑ u � ∗ ⇑ w and ⇑ v � ∗ ⇑ w
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
Termination ◮ def.[x-terminating] : no infinite sequence ⇑ t 1 � ∗ ⇑ t 2 � ∗ . . . � ∗ ⇑ t n � ∗ . . .
Termination ◮ def.[x-terminating] : no infinite sequence ⇑ t 1 � ∗ ⇑ t 2 � ∗ . . . � ∗ ⇑ t n � ∗ . . . ◮ prop. : x-terminating ≡ terminating
Termination ◮ def.[x-terminating] : no infinite sequence ⇑ t 1 � ∗ ⇑ t 2 � ∗ . . . � ∗ ⇑ t n � ∗ . . . ◮ prop. : x-terminating ≡ terminating ◮ prop. : → terminating ⇐ ⇒ � terminating
Embedding strategies ◮ easy: just remove some rules
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 ;
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
Related work ◮ CPS transformations
Related work ◮ CPS transformations ◮ ρ -calculus
Related work ◮ CPS transformations ◮ ρ -calculus ◮ rewriting logic
Conclusion ◮ the reduction process is made explicit at the syntactic level
Conclusion ◮ the reduction process is made explicit at the syntactic level ◮ the explicit TRS is simpler and equivalent
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
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