convergence in infinitary term graph rewriting systems is
play

Convergence in Infinitary Term Graph Rewriting Systems is Simple - PowerPoint PPT Presentation

Convergence in Infinitary Term Graph Rewriting Systems is Simple Patrick Bahr paba@diku.dk University of Copenhagen Department of Computer Science 7th International Workshop on Computing with Terms and Graphs Rome, Italy, March 23rd, 2013


  1. Convergence in Infinitary Term Graph Rewriting Systems is Simple Patrick Bahr paba@diku.dk University of Copenhagen Department of Computer Science 7th International Workshop on Computing with Terms and Graphs Rome, Italy, March 23rd, 2013

  2. Term Graph Rewriting vs. Infinitary Rewriting Pick one to avoid the other. Pick term graph rewriting Pick infinitary rewriting finite representation of avoid dealing with term graphs infinite terms (via cycles) work on the unravelling instead finite representation of infinite rewrite sequences f g h f g b f g g b h h g b b b 2

  3. Infinitary Term Graph Rewriting – What is it for? A common formalism study correspondences between infinitary TRSs and finitary GRSs Lazy evaluation infinitary term rewriting only covers non-strictness however: lazy evaluation = non-strictness + sharing towards infinitary lambda calculi with letrec Ariola & Blom. Skew confluence and the lambda calculus with letrec. the calculus is non-confluent but there is a notion of infinite normal forms 3

  4. Our Previous Approach [RTA ’11] Profile weak convergence two modes of convergence: metric & partial order result: ◮ correspondence between metric & partial order convergence ◮ soundness w.r.t. infinitary term rewriting (sorta kinda) problem: complicated; difficult to analyse; lack of completeness Term graph rewriting with from ( x ) → x :: from ( s ( x )) :: :: :: from :: :: 0 0 from 0 ⊥ s s :: from ⊥ s ⊥ 4

  5. Our New Approach Less restrictive structures d R ( g , h ) ≥ d S ( g , h ) � coarser topology (i.e. more sequences converge) g ≤ R ⇒ g ≤ S ⊥ h = ⊥ h � sequences converge to term graphs “with fewer ⊥ ’s” Term graph rewriting with from ( x ) → x :: from ( s ( x )) :: :: :: from :: :: 0 0 from 0 ⊥ s s :: from ⊥ s ⊥ 5

  6. Outline Introduction 1 Goals A Different Approach Weak Convergence 2 Strong Convergence 3 6

  7. Metric Infinitary Term Graph Rewriting Complete metric on terms d ( g , h ) = 2 − sim ( g , h ) sim ( g , h ) = maximum depth d s.t. truncated at depth d , g and h are equal Example f f f f 1 level 2 levels e e e e e e e f a c a b b ) = 2 − 2 d ( g ) = 2 − 1 g ′ h ′ , , h d ( 7

  8. Partial Order Infinitary Term Rewriting Partial order on terms partial terms: terms with additional constant ⊥ (read as “undefined”) partial order ≤ ⊥ reads as: “is less defined than” ≤ ⊥ is a complete semilattice (= cpo + glbs of non-empty sets) Convergence formalised by the limit inferior: � � lim inf ι → α t ι = t ι β<α β ≤ ι<α intuition: eventual persistence of nodes of the terms 8

  9. A Partial Order on Term Graphs Specialise on terms Consider terms as term trees (i.e. term graphs with tree structure) How to define the partial order ≤ ⊥ on term trees? ⊥ -homomorphisms φ : g → ⊥ h homomorphism condition suspended on ⊥ -nodes allow mapping of ⊥ -nodes to arbitrary nodes same mechanism describing matching in term graph rewriting Definition (Simple partial order ≤ S ⊥ on term graphs) For all g , h ∈ G ∞ (Σ ⊥ ) , let g ≤ S ⊥ h iff there is some φ : g → ⊥ h . 9

  10. Properties of Completions Term graph rewriting with from ( x ) → x :: from ( s ( x )) :: :: :: from :: :: 0 0 from 0 ⊥ :: s s from ⊥ s ⊥ Theorem (metric completion of term graphs) The metric completion of ( G C (Σ) , d S ) is the metric space ( G ∞ C (Σ) , d S ) . Theorem (ideal completion of term graphs) The ideal completion of ( G C (Σ ⊥ ) , ≤ S ⊥ ) is order isomorphic to ( G ∞ C (Σ ⊥ ) , ≤ S ⊥ ) . 10

  11. Metric vs. Partial Order Convergence Partial order convergence f f f f f c c c c c c c c Why??? f f ≤ S Because ⊥ c c c Theorem Let S be a reduction in a GRS R : ✦ = ⇒ m R h p R h total S : g ֒ S : g ֒ → → ⇐ = ✪ 11

  12. Outline Introduction 1 Goals A Different Approach Weak Convergence 2 Strong Convergence 3 12

  13. Strong Convergence Intuition behind strong convergence syntactic restriction of convergence pretend that the root of the left-hand side and the right-hand side of each rule are distinct Strong metric convergence additional restriction: depth of contracted redexes must tend to infinity Strong partial order convergence modify limit formation: replace each redex with ⊥ 13

  14. Consequences Partial order convergence f f f f ⊥ c c c c c c Rules that produce this rewrite sequence ρ 1 : ρ 2 : f f f f c c c c c c Theorem Let S be a reduction in a GRS R : m R h p R h total S : g ։ S : g ։ ⇐ ⇒ 14

  15. Examples Term graph rewriting with from ( x ) → x :: from ( s ( x )) :: :: :: from ⊥ :: :: 0 0 ⊥ 0 0 :: s s s ⊥ s s Term graph rewriting with h ( x , y ) → h ( y , x ) f f f f g g g g ⊥ ⊥ ⊥ ⊥ c c c c 15

  16. Metric vs. Partial Order Approach Theorem (Soundness of partial order convergence) For every left-linear, left-finite GRS R we have p g R h U ( · ) U ( · ) p U ( R ) s t Theorem (Completeness of partial order convergence) For every orthogonal, left-finite GRS R we have p p U ( R ) s t t ′ U ( · ) U ( · ) p g R h 16

  17. Conclusions Simple structures formalising convergence on term graphs intuitive & simple generalisation of term rewriting counterparts the structures are “complete” “soundness” of limit & limit inferior (i.e. commutes with unravelling) But: weak partial order convergence is somewhat odd Strong convergence regain correspondence between metric and partial order convergence soundness and completeness w.r.t. infinitary term rewriting 17

Recommend


More recommend