Infinitary Term Graph Rewriting is Simple, Sound and Complete Patrick Bahr paba@diku.dk University of Copenhagen Department of Computer Science 23rd International Conference on Rewriting Techniques and Applications, Nagoya, Japan, March May 30 – June 1, 2012
Infinitary Rewriting vs. Term Graph Rewriting Pick one to avoid the other. 2
Infinitary Rewriting vs. Term Graph Rewriting Pick one to avoid the other. Pick term graph rewriting finite representation of infinite terms (via cycles) finite representation of infinite rewrite sequences f g h b 2
Infinitary Rewriting vs. Term Graph 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 c 2
Infinitary Term Graph Rewriting – What is it for? A common formalism study correspondences between infinitary TRSs and finitary GRSs 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 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
Approach Previous approach (RTA ’11) weak convergence two modes of convergence: metric & partial order 4
Approach Previous approach (RTA ’11) weak convergence two modes of convergence: metric & partial order ◮ correspondence between metric & partial order approach result: ◮ soundness w.r.t. infinitary term rewriting (sorta kinda) 4
Approach Previous approach (RTA ’11) weak convergence two modes of convergence: metric & partial order ◮ correspondence between metric & partial order approach result: ◮ soundness w.r.t. infinitary term rewriting (sorta kinda) problem: complicated; difficult to analyse; completeness ?? 4
Approach Previous approach (RTA ’11) weak convergence two modes of convergence: metric & partial order ◮ correspondence between metric & partial order approach result: ◮ soundness w.r.t. infinitary term rewriting (sorta kinda) problem: complicated; difficult to analyse; completeness ?? Our new approach strong convergence two modes of convergence: metric & partial order 4
Approach Previous approach (RTA ’11) weak convergence two modes of convergence: metric & partial order ◮ correspondence between metric & partial order approach result: ◮ soundness w.r.t. infinitary term rewriting (sorta kinda) problem: complicated; difficult to analyse; completeness ?? Our new approach strong convergence two modes of convergence: metric & partial order but: simpler (ignoring the sharing as much as possible) 4
Approach Previous approach (RTA ’11) weak convergence two modes of convergence: metric & partial order ◮ correspondence between metric & partial order approach result: ◮ soundness w.r.t. infinitary term rewriting (sorta kinda) problem: complicated; difficult to analyse; completeness ?? Our new approach strong convergence two modes of convergence: metric & partial order but: simpler (ignoring the sharing as much as possible) ◮ correspondence between metric & partial order approach result: ◮ soundness w.r.t. infinitary term rewriting ◮ completeness w.r.t. infinitary term rewriting 4
Approach Previous approach (RTA ’11) weak convergence two modes of convergence: metric & partial order ◮ correspondence between metric & partial order approach result: ◮ soundness w.r.t. infinitary term rewriting (sorta kinda) problem: complicated; difficult to analyse; completeness ?? Our new approach strong convergence = ⇒ independence from the rewriting formalism two modes of convergence: metric & partial order but: simpler (ignoring the sharing as much as possible) ◮ correspondence between metric & partial order approach result: ◮ soundness w.r.t. infinitary term rewriting ◮ completeness w.r.t. infinitary term rewriting 4
Outline Introduction 1 Goals A Different Approach Modes of Convergence on Term Graphs 2 Metric Approach Partial Order Approach Metric vs. Partial Order Approach 5
Metric Infinitary Term Rewriting Complete metric on terms terms are endowed with a complete metric in order to formalise the convergence of infinite reductions. metric distance between terms: d ( s , t ) = 2 − sim ( s , t ) sim ( s , t ) = maximum depth d s.t. s and t coincide up to depth d 6
Metric Infinitary Term Rewriting Complete metric on terms terms are endowed with a complete metric in order to formalise the convergence of infinite reductions. metric distance between terms: d ( s , t ) = 2 − sim ( s , t ) sim ( s , t ) = maximum depth d s.t. s and t coincide up to depth d Strong convergence via metric d and redex depth convergence in the metric space ( T ∞ (Σ) , d ) depth of the differences between the terms has to tend to infinity � 6
Metric Infinitary Term Rewriting Complete metric on terms terms are endowed with a complete metric in order to formalise the convergence of infinite reductions. metric distance between terms: d ( s , t ) = 2 − sim ( s , t ) sim ( s , t ) = maximum depth d s.t. s and t coincide up to depth d Strong convergence via metric d and redex depth convergence in the metric space ( T ∞ (Σ) , d ) depth of the differences between the terms has to tend to infinity � depth of redexes has to tend to infinity 6
Example: Metric Convergence in TRSs from 0 from ( x ) → x :: from ( s ( x )) 7
Example: Metric Convergence in TRSs :: from from 0 0 1 from ( x ) → x :: from ( s ( x )) 7
Example: Metric Convergence in TRSs :: from + :: 0 0 from 1 2 from ( x ) → x :: from ( s ( x )) 7
Example: Metric Convergence in TRSs :: from 1 level + :: 0 0 from 1 2 from ( x ) → x :: from ( s ( x )) 7
Example: Metric Convergence in TRSs :: from 1 level + :: 0 0 :: 1 from 2 3 from ( x ) → x :: from ( s ( x )) 7
Example: Metric Convergence in TRSs :: from + 2 levels :: 0 0 :: 1 from 2 3 from ( x ) → x :: from ( s ( x )) 7
Example: Metric Convergence in TRSs :: from + 2 levels :: 0 0 :: 1 :: 2 from 3 4 from ( x ) → x :: from ( s ( x )) 7
Example: Metric Convergence in TRSs :: from + :: 3 levels 0 0 :: 1 :: 2 from 3 4 from ( x ) → x :: from ( s ( x )) 7
Example: Metric Convergence in TRSs :: from ω :: 3 levels 0 0 :: 1 :: 2 :: 3 4 from ( x ) → x :: from ( s ( x )) 7
Example: Metric Convergence in TRSs :: from ω :: 0 0 :: 1 :: 2 :: 3 4 from ( x ) → x :: from ( s ( x )) 7
A Metric on Term Graphs Depth of a node = length of a shortest path from the root to the node. 8
A Metric on Term Graphs Depth of a node = length of a shortest path from the root to the node. Truncation of term graphs The truncation g † d is obtained from g by relabelling all nodes at depth d with ⊥ , and removing all nodes that thus become unreachable from the root. 8
A Metric on Term Graphs Depth of a node = length of a shortest path from the root to the node. Truncation of term graphs The truncation g † d is obtained from g by relabelling all nodes at depth d with ⊥ , and removing all nodes that thus become unreachable from the root. The simple metric on term graphs d † ( g , h ) = 2 − sim † ( g , h ) Where sim † ( g , h ) = maximum depth d s.t. g † d ∼ = h † d . 8
A Metric on Term Graphs Depth of a node = length of a shortest path from the root to the node. Truncation of term graphs The truncation g † d is obtained from g by relabelling all nodes at depth d with ⊥ , and removing all nodes that thus become unreachable from the root. The simple metric on term graphs d † ( g , h ) = 2 − sim † ( g , h ) Where sim † ( g , h ) = maximum depth d s.t. g † d ∼ = h † d . Strong convergence via metric d † and redex depth convergence in the metric space ( G ∞ C (Σ) , d † ) depth of redexes has to tend to infinity 8
Soundness & Completeness 9
Soundness & Completeness soundness of metric convergence m g R h U ( · ) U ( R ) s 9
Soundness & Completeness soundness of metric convergence m g R h U ( · ) U ( · ) m U ( R ) s t 9
Soundness & Completeness Theorem (soundness of metric convergence) For every left-linear, left-finite GRS R we have m g R h U ( · ) U ( · ) m U ( R ) s t 9
Soundness & Completeness Theorem (soundness of metric convergence) For every left-linear, left-finite GRS R we have m g R h U ( · ) U ( · ) m U ( R ) s t Completeness property m U ( R ) s t U ( · ) g R 9
Recommend
More recommend