Termination Absence of infinite computations f : α × α ⇒ α g : ( α → α ) ⇒ α Let and in { x : α → α } ⊢ f ( g ( x ) , g ( x )) : α → @ ( x , g ( x )) : α � �� � f ( g ( λ y . f ( y , y ) ) , g ( λ y . f ( y , y ) )) : α → � �� � � �� � x x @ ( λ y . f ( y , y ) , g ( λ y . f ( y , y ))) : α Albert Rubio - UPC RTA 2008– p.6/31
Termination Absence of infinite computations f : α × α ⇒ α g : ( α → α ) ⇒ α Let and in { x : α → α } ⊢ f ( g ( x ) , g ( x )) : α → @ ( x , g ( x )) : α � �� � f ( g ( λ y . f ( y , y ) ) , g ( λ y . f ( y , y ) )) : α → � �� � � �� � x x � �� � @ ( λ y . f ( y , y ) , g ( λ y . f ( y , y ) ) ) : α → β � �� � � �� � v λ y . u Albert Rubio - UPC RTA 2008– p.6/31
Termination Absence of infinite computations f : α × α ⇒ α g : ( α → α ) ⇒ α Let and in { x : α → α } ⊢ f ( g ( x ) , g ( x )) : α → @ ( x , g ( x )) : α � �� � f ( g ( λ y . f ( y , y ) ) , g ( λ y . f ( y , y ) )) : α → � �� � � �� � x x � �� � @ ( λ y . f ( y , y ) , g ( λ y . f ( y , y ) ) ) : α → β � �� � � �� � v λ y . u f ( g ( λ y . f ( y , y )) , g ( λ y . f ( y , y ))) : α → . . . Albert Rubio - UPC RTA 2008– p.6/31
Motivation Why studing termination (early days)? Albert Rubio - UPC RTA 2008– p.7/31
Motivation Why studing termination (early days)? Knuth-Bendix completion and theorem proving Albert Rubio - UPC RTA 2008– p.7/31
Motivation Why studing termination (early days)? Knuth-Bendix completion and theorem proving Termination of some particular TRS Albert Rubio - UPC RTA 2008– p.7/31
Motivation Why studing termination (early days)? Knuth-Bendix completion and theorem proving Termination of some particular TRS rule-based algorithms Albert Rubio - UPC RTA 2008– p.7/31
Motivation Why studing termination (early days)? Knuth-Bendix completion and theorem proving Termination of some particular TRS rule-based algorithms rule-based specification Albert Rubio - UPC RTA 2008– p.7/31
A bit of history The beginings 1970, Manna and Ness. Reference for reduction orderings . One of the first papers on termination of rewriting. Albert Rubio - UPC RTA 2008– p.8/31
A bit of history The beginings 1970, Manna and Ness. Reference for reduction orderings . One of the first papers on termination of rewriting. 1970, Knuth and Bendix. Knuth Bendix Ordering (KBO). Albert Rubio - UPC RTA 2008– p.8/31
A bit of history The beginings 1970, Manna and Ness. Reference for reduction orderings . One of the first papers on termination of rewriting. 1970, Knuth and Bendix. Knuth Bendix Ordering (KBO). 1978, Huet and Lankford. Undecidability of the termination of Term Rewriting Systems. Albert Rubio - UPC RTA 2008– p.8/31
A bit of history The beginings 1970, Manna and Ness. Reference for reduction orderings . One of the first papers on termination of rewriting. 1970, Knuth and Bendix. Knuth Bendix Ordering (KBO). 1978, Huet and Lankford. Undecidability of the termination of Term Rewriting Systems. 1979, Dershowitz. Recursive Path Ordering (RPO). Albert Rubio - UPC RTA 2008– p.8/31
A bit of history The beginings 1970, Manna and Ness. Reference for reduction orderings . One of the first papers on termination of rewriting. 1970, Knuth and Bendix. Knuth Bendix Ordering (KBO). 1978, Huet and Lankford. Undecidability of the termination of Term Rewriting Systems. 1979, Dershowitz. Recursive Path Ordering (RPO). 1979, Dershowitz Manna. Multiset ordering. Albert Rubio - UPC RTA 2008– p.8/31
A bit of history The beginings 1970, Manna and Ness. Reference for reduction orderings . One of the first papers on termination of rewriting. 1970, Knuth and Bendix. Knuth Bendix Ordering (KBO). 1978, Huet and Lankford. Undecidability of the termination of Term Rewriting Systems. 1979, Dershowitz. Recursive Path Ordering (RPO). 1979, Dershowitz Manna. Multiset ordering. 1979, Lankford. One of the first references on polynomial interpretations. Albert Rubio - UPC RTA 2008– p.8/31
A bit of history The beginings 1970, Manna and Ness. Reference for reduction orderings . One of the first papers on termination of rewriting. 1970, Knuth and Bendix. Knuth Bendix Ordering (KBO). 1978, Huet and Lankford. Undecidability of the termination of Term Rewriting Systems. 1979, Dershowitz. Recursive Path Ordering (RPO). 1979, Dershowitz Manna. Multiset ordering. 1979, Lankford. One of the first references on polynomial interpretations. 1980, Kamin and Levy. Lexicographic Path Ordering (LPO) and Semantic Path Ordering (SPO). Albert Rubio - UPC RTA 2008– p.8/31
Reduction Orderings � �� � � �� � s ( s ( s ( s ( 0 ) ) + s ( s ( s ( s ( 0 )))) )) → s ( s ( s ( s ( 0 ) + s ( s ( s ( s ( 0 )))) ) )) ���� � �� � ���� � �� � n m n m s ( n ) + m → s ( n + m ) Albert Rubio - UPC RTA 2008– p.9/31
Reduction Orderings � �� � � �� � s ( s ( s ( s ( 0 ) ) + s ( s ( s ( s ( 0 )))) )) → s ( s ( s ( s ( 0 ) + s ( s ( s ( s ( 0 )))) ) )) ���� � �� � ���� � �� � n m n m s ( n ) + m → s ( n + m ) s ( n ) + m ≻ s ( n + m ) Albert Rubio - UPC RTA 2008– p.9/31
Reduction Orderings � �� � � �� � s ( s ( s ( s ( 0 ) ) + s ( s ( s ( s ( 0 )))) )) → s ( s ( s ( s ( 0 ) + s ( s ( s ( s ( 0 )))) ) )) ���� � �� � ���� � �� � n m n m s ( n ) + m → s ( n + m ) s ( n ) + m ≻ s ( n + m ) s ( s ( 0 ) ) + s ( s ( s ( s ( 0 )))) ≻ s ( s ( 0 ) + s ( s ( s ( s ( 0 )))) ) stable under ���� � �� � ���� � �� � substitution n m n m Albert Rubio - UPC RTA 2008– p.9/31
Reduction Orderings � �� � � �� � s ( s ( s ( s ( 0 ) ) + s ( s ( s ( s ( 0 )))) )) → s ( s ( s ( s ( 0 ) + s ( s ( s ( s ( 0 )))) ) )) ���� � �� � ���� � �� � n m n m s ( n ) + m → s ( n + m ) s ( n ) + m ≻ s ( n + m ) s ( s ( 0 ) ) + s ( s ( s ( s ( 0 )))) ≻ s ( s ( 0 ) + s ( s ( s ( s ( 0 )))) ) stable under ���� � �� � ���� � �� � substitution n m n m � �� � � �� � s ( s ( s ( s ( 0 ) ) + s ( s ( s ( s ( 0 )))) )) ≻ s ( s ( s ( s ( 0 ) + s ( s ( s ( s ( 0 )))) ) )) monotonic ���� � �� � ���� � �� � n m n m Albert Rubio - UPC RTA 2008– p.9/31
Reduction Orderings (cont.) ≻ is a reduction ordering if it’s well-founded � ∃ t 1 ≻ t 2 ≻ t 3 ≻ . . . stable under sustitution s ≻ t s σ ≻ t σ implies for every substitution σ monotonic s ≻ t u [ s ] ≻ u [ t ] for every context u [ ] implies Albert Rubio - UPC RTA 2008– p.10/31
Reduction Orderings (cont.) ≻ is a reduction ordering if it’s well-founded � ∃ t 1 ≻ t 2 ≻ t 3 ≻ . . . stable under sustitution s ≻ t s σ ≻ t σ implies for every substitution σ monotonic s ≻ t u [ s ] ≻ u [ t ] for every context u [ ] implies l ≻ r for all l → r ∈ R R terminates if and only if for some reduction ordering ≻ . Albert Rubio - UPC RTA 2008– p.10/31
Reduction Orderings (cont.) ≻ is a higher-order reduction ordering if it’s well-founded � ∃ t 1 ≻ t 2 ≻ t 3 ≻ . . . stable under substitution s ≻ t s σ ≻ t σ implies for all substitution σ monotonic s ≻ t u [ s ] ≻ u [ t ] for all context u [ ] implies Albert Rubio - UPC RTA 2008– p.11/31
Reduction Orderings (cont.) ≻ is a higher-order reduction ordering if it’s well-founded � ∃ t 1 ≻ t 2 ≻ t 3 ≻ . . . stable under substitution s ≻ t s σ ≻ t σ implies for all substitution σ monotonic s ≻ t u [ s ] ≻ u [ t ] for all context u [ ] implies functional s → β t s ≻ t implies Albert Rubio - UPC RTA 2008– p.11/31
Reduction Orderings (cont.) ≻ is a higher-order reduction ordering if it’s well-founded � ∃ t 1 ≻ t 2 ≻ t 3 ≻ . . . stable under substitution s ≻ t s σ ≻ t σ implies for all substitution σ monotonic s ≻ t u [ s ] ≻ u [ t ] for all context u [ ] implies functional s → β t s ≻ t implies l ≻ r for all l → r ∈ R R terminates if and only if for some higher-order reduction ordering ≻ . Albert Rubio - UPC RTA 2008– p.11/31
Polynomial Interpretations Albert Rubio - UPC RTA 2008– p.12/31
Polynomial Interpretations Interprets every function symbol as a (linear) polynomial: [ f ] = A k − → A where A is often the positive integers or the reals. Albert Rubio - UPC RTA 2008– p.12/31
Polynomial Interpretations Interprets every function symbol as a (linear) polynomial: [ f ] = A k − → A where A is often the positive integers or the reals. Interpret terms by: Pol ( f ( t 1 , . . . , t n )) = [ f ]( Pol ( t 1 ) , . . . , Pol ( t n )) Albert Rubio - UPC RTA 2008– p.12/31
Polynomial Interpretations Interprets every function symbol as a (linear) polynomial: [ f ] = A k − → A where A is often the positive integers or the reals. Interpret terms by: Pol ( f ( t 1 , . . . , t n )) = [ f ]( Pol ( t 1 ) , . . . , Pol ( t n )) Then a reduction ordering is obtained by s ≻ t if Pol ( s ) − Pol ( t ) > 0 if all coeficients are strictly positive. If there are zero coeficients then it is just weakly monotonic. Albert Rubio - UPC RTA 2008– p.12/31
The recursive path ordering Albert Rubio - UPC RTA 2008– p.13/31
The recursive path ordering compares terms by extending an ordering on function symbols. Albert Rubio - UPC RTA 2008– p.13/31
The recursive path ordering compares terms by extending an ordering on function symbols. Let ≻ F be a (well-founded) ordering on the function symbols For instance: prod ≻ F + ≻ F s ≻ F 0 Albert Rubio - UPC RTA 2008– p.13/31
The recursive path ordering compares terms by extending an ordering on function symbols. Let ≻ F be a (well-founded) ordering on the function symbols For instance: prod ≻ F + ≻ F s ≻ F 0 s = f ( s 1 , . . . , s n ) ≻ rpo t if and only if 1. s i � rpo t for some 1 ≤ i ≤ n . 2. t = g ( t 1 , . . . , t m ) , f ≻ F g s ≻ rpo t j for all 1 ≤ j ≤ m . and 3. t = f ( t 1 , . . . , t m ) { s 1 , . . . , s n } ≻≻ rpo { t 1 , . . . , t m } and Albert Rubio - UPC RTA 2008– p.13/31
The recursive path ordering (cont.) s = f ( s 1 , . . . , s n ) ≻ rpo t if and only if 1. s i � rpo t for some 1 ≤ i ≤ n . 2. t = g ( t 1 , . . . , t m ) , f ≻ F g and s ≻ rpo t j for all 1 ≤ j ≤ m . 3. t = f ( t 1 , . . . , t m ) { s 1 , . . . , s n } ≻≻ rpo { t 1 , . . . , t m } and Let prod ≻ F + ≻ F s ≻ F 0 Albert Rubio - UPC RTA 2008– p.14/31
The recursive path ordering (cont.) s = f ( s 1 , . . . , s n ) ≻ rpo t if and only if 1. s i � rpo t for some 1 ≤ i ≤ n . 2. t = g ( t 1 , . . . , t m ) , f ≻ F g and s ≻ rpo t j for all 1 ≤ j ≤ m . 3. t = f ( t 1 , . . . , t m ) { s 1 , . . . , s n } ≻≻ rpo { t 1 , . . . , t m } and Let prod ≻ F + ≻ F s ≻ F 0 prod ( s ( n ) , m ) ≻ rpo s ( prod ( n , m )) Albert Rubio - UPC RTA 2008– p.14/31
The recursive path ordering (cont.) s = f ( s 1 , . . . , s n ) ≻ rpo t if and only if 1. s i � rpo t for some 1 ≤ i ≤ n . 2. t = g ( t 1 , . . . , t m ) , f ≻ F g and s ≻ rpo t j for all 1 ≤ j ≤ m . 3. t = f ( t 1 , . . . , t m ) { s 1 , . . . , s n } ≻≻ rpo { t 1 , . . . , t m } and Let prod ≻ F + ≻ F s ≻ F 0 prod ( s ( n ) , m ) ≻ rpo s ( prod ( n , m )) Case 2 prod ( s ( n ) , m ) ≻ rpo prod ( n , m ) Albert Rubio - UPC RTA 2008– p.14/31
The recursive path ordering (cont.) s = f ( s 1 , . . . , s n ) ≻ rpo t if and only if 1. s i � rpo t for some 1 ≤ i ≤ n . 2. t = g ( t 1 , . . . , t m ) , f ≻ F g and s ≻ rpo t j for all 1 ≤ j ≤ m . 3. t = f ( t 1 , . . . , t m ) { s 1 , . . . , s n } ≻≻ rpo { t 1 , . . . , t m } and Let prod ≻ F + ≻ F s ≻ F 0 prod ( s ( n ) , m ) ≻ rpo s ( prod ( n , m )) Case 2 prod ( s ( n ) , m ) ≻ rpo prod ( n , m ) Case 3 { s ( n ) , m } ≻≻ rpo { n , m } Albert Rubio - UPC RTA 2008– p.14/31
The recursive path ordering (cont.) s = f ( s 1 , . . . , s n ) ≻ rpo t if and only if 1. s i � rpo t for some 1 ≤ i ≤ n . 2. t = g ( t 1 , . . . , t m ) , f ≻ F g and s ≻ rpo t j for all 1 ≤ j ≤ m . 3. t = f ( t 1 , . . . , t m ) { s 1 , . . . , s n } ≻≻ rpo { t 1 , . . . , t m } and Let prod ≻ F + ≻ F s ≻ F 0 prod ( s ( n ) , m ) ≻ rpo s ( prod ( n , m )) Case 2 prod ( s ( n ) , m ) ≻ rpo prod ( n , m ) Case 3 { s ( n ) , � m } ≻≻ rpo { n , � m } multiset comparison Albert Rubio - UPC RTA 2008– p.14/31
The recursive path ordering (cont.) s = f ( s 1 , . . . , s n ) ≻ rpo t if and only if 1. s i � rpo t for some 1 ≤ i ≤ n . 2. t = g ( t 1 , . . . , t m ) , f ≻ F g and s ≻ rpo t j for all 1 ≤ j ≤ m . 3. t = f ( t 1 , . . . , t m ) { s 1 , . . . , s n } ≻≻ rpo { t 1 , . . . , t m } and Let prod ≻ F + ≻ F s ≻ F 0 prod ( s ( n ) , m ) ≻ rpo s ( prod ( n , m )) Case 2 prod ( s ( n ) , m ) ≻ rpo prod ( n , m ) Case 3 { s ( n ) , � m } ≻≻ rpo { n , � m } multiset comparison s ( n ) ≻ rpo n Albert Rubio - UPC RTA 2008– p.14/31
The recursive path ordering (cont.) s = f ( s 1 , . . . , s n ) ≻ rpo t if and only if 1. s i � rpo t for some 1 ≤ i ≤ n . 2. t = g ( t 1 , . . . , t m ) , f ≻ F g and s ≻ rpo t j for all 1 ≤ j ≤ m . 3. t = f ( t 1 , . . . , t m ) { s 1 , . . . , s n } ≻≻ rpo { t 1 , . . . , t m } and Let prod ≻ F + ≻ F s ≻ F 0 prod ( s ( n ) , m ) ≻ rpo s ( prod ( n , m )) Case 2 prod ( s ( n ) , m ) ≻ rpo prod ( n , m ) Case 3 { s ( n ) , � m } ≻≻ rpo { n , � m } multiset comparison s ( n ) ≻ rpo n Case 1 Albert Rubio - UPC RTA 2008– p.14/31
Powerful automatable methods Methods that can be fully automated Can handle hard examples. Albert Rubio - UPC RTA 2008– p.15/31
Powerful automatable methods Methods that can be fully automated Can handle hard examples. Only two will be considered in this talk: The Dependency Pair Method The Monotonic Semantic Path Ordering Albert Rubio - UPC RTA 2008– p.15/31
The Dependency Pair Method (cont.) (Arts and Giesl 1997) Basically, it transforms the rewrite system into a new reduction system which is simpler to analyze and (dis)prove termination. Albert Rubio - UPC RTA 2008– p.16/31
The Dependency Pair Method (cont.) (Arts and Giesl 1997) Basically, it transforms the rewrite system into a new reduction system which is simpler to analyze and (dis)prove termination. prod ( 0, m ) → 0 prod ( s ( n ) , m ) → prod ( n , m ) + m PROD ( s ( n ) , m ) ⇒ SUM ( prod ( n , m ) , m ) PROD ( s ( n ) , m ) ⇒ PROD ( n , m ) 0 + m → m s ( n ) + m → s ( n + m ) SUM ( s ( n ) , m ) ⇒ SUM ( n , m ) Albert Rubio - UPC RTA 2008– p.16/31
The Dependency Pair Method (cont.) (Arts and Giesl 1997) Basically, it transforms the rewrite system into a new reduction system which is simpler to analyze and (dis)prove termination. prod ( 0, m ) → 0 prod ( s ( n ) , m ) → prod ( n , m ) + m PROD ( s ( n ) , m ) ⇒ SUM ( prod ( n , m ) , m ) PROD ( s ( n ) , m ) ⇒ PROD ( n , m ) 0 + m → m s ( n ) + m → s ( n + m ) SUM ( s ( n ) , m ) ⇒ SUM ( n , m ) PROD(s(n),m) PROD(s(n),m) SUM(s(n),m) PROD(n,m) SUM(PROD(n,m)) SUM(n,m) Albert Rubio - UPC RTA 2008– p.16/31
The Dependency Pair Method (cont.) (Arts and Giesl 1997) Basically, it transforms the rewrite system into a new reduction system which is simpler to analyze and (dis)prove termination. prod ( 0, m ) → prod ( 0, m ) ⇒ 0 ZERO prod ( s ( n ) , m ) → prod ( n , m ) + m PROD ( s ( n ) , m ) ⇒ SUM ( prod ( n , m ) , m ) PROD ( s ( n ) , m ) ⇒ PROD ( n , m ) 0 + m → m s ( n ) + m → s ( n + m ) SUM ( s ( n ) , m ) ⇒ SUM ( n , m ) SUM ( s ( n ) , m ) ⇒ SUC ( n + m ) Albert Rubio - UPC RTA 2008– p.16/31
The Dependency Pair Method (cont.) (Arts and Giesl 1997) Basically, it transforms the rewrite system into a new reduction system which is simpler to analyze and (dis)prove termination. prod ( 0, m ) → prod ( 0, m ) ⇒ 0 ZERO prod ( s ( n ) , m ) → prod ( n , m ) + m PROD ( s ( n ) , m ) ⇒ SUM ( prod ( n , m ) , m ) PROD ( s ( n ) , m ) ⇒ PROD ( n , m ) 0 + m → m s ( n ) + m → s ( n + m ) SUM ( s ( n ) , m ) ⇒ SUM ( n , m ) SUM ( s ( n ) , m ) ⇒ SUC ( n + m ) PROD(s(n),m) PROD(s(n),m) SUM(s(n),m) PROD(n,m) SUM(prod(n,m)) SUM(n,m) SUM(s(n),m) PROD(s(n),m) SUC(n+m) ZERO Does not change the potential cycles!!! Albert Rubio - UPC RTA 2008– p.16/31
The Dependency Pair Method (cont.) (Arts and Giesl 1997) Basically, it transforms the rewrite system into a new reduction system which is simpler to analyze and (dis)prove termination. prod ( 0, m ) → prod ( 0, m ) ⇒ 0 ZERO prod ( s ( n ) , m ) → prod ( n , m ) + m PROD ( s ( n ) , m ) ⇒ SUM ( prod ( n , m ) , m ) PROD ( s ( n ) , m ) ⇒ PROD ( n , m ) 0 + m → m s ( n ) + m → s ( n + m ) SUM ( s ( n ) , m ) ⇒ SUM ( n , m ) SUM ( s ( n ) , m ) ⇒ SUC ( n + m ) PROD(s(n),m) PROD(s(n),m) SUM(s(n),m) PROD(n,m) SUM(prod(n,m)) SUM(n,m) SUM(s(n),m) PROD(s(n),m) SUC(n+m) ZERO Albert Rubio - UPC RTA 2008– p.16/31
The Dependency Pair Method (cont.) (Arts and Giesl 1997) Basically, it transforms the rewrite system into a new reduction system which is simpler to analyze and (dis)prove termination. prod ( 0, m ) → prod ( 0, m ) ⇒ 0 ZERO prod ( s ( n ) , m ) → prod ( n , m ) + m PROD ( s ( n ) , m ) ⇒ SUM ( prod ( n , m ) , m ) PROD ( s ( n ) , m ) ⇒ PROD ( n , m ) 0 + m → m s ( n ) + m → s ( n + m ) SUM ( s ( n ) , m ) ⇒ SUM ( n , m ) SUM ( s ( n ) , m ) ⇒ SUC ( n + m ) PROD(s(n),m) PROD(s(n),m) SUM(s(n),m) PROD(n,m) SUM(prod(n,m)) SUM(n,m) SUM(s(n),m) PROD(s(n),m) SUC(n+m) ZERO Albert Rubio - UPC RTA 2008– p.16/31
The Dependency Pair Method (cont.) (Arts and Giesl 1997) Basically, it transforms the rewrite system into a new reduction system which is simpler to analyze and (dis)prove termination. prod ( 0, m ) → prod ( 0, m ) ⇒ 0 ZERO prod ( s ( n ) , m ) → prod ( n , m ) + m PROD ( s ( n ) , m ) ⇒ SUM ( prod ( n , m ) , m ) PROD ( s ( n ) , m ) ⇒ PROD ( n , m ) 0 + m → m s ( n ) + m → s ( n + m ) SUM ( s ( n ) , m ) ⇒ SUM ( n , m ) SUM ( s ( n ) , m ) ⇒ SUC ( n + m ) PROD(s(n),m) PROD(s(n),m) SUM(s(n),m) PROD(n,m) SUM(PROD(n,m)) SUM(n,m) Albert Rubio - UPC RTA 2008– p.16/31
The Dependency Pair Method (cont.) (Arts and Giesl 1997) Basically, it transforms the rewrite system into a new reduction system which is simpler to analyze and (dis)prove termination. prod ( 0, m ) → 0 prod ( s ( n ) , m ) → prod ( n , m ) + m PROD ( s ( n ) , m ) ⇒ SUM ( prod ( n , m ) , m ) PROD ( s ( n ) , m ) ⇒ PROD ( n , m ) 0 + m → m s ( n ) + m → s ( n + m ) SUM ( s ( n ) , m ) ⇒ SUM ( n , m ) PROD(s(n),m) PROD(s(n),m) SUM(s(n),m) PROD(n,m) SUM(PROD(n,m)) SUM(n,m) Albert Rubio - UPC RTA 2008– p.16/31
The Dependency Pair Method (cont.) (Arts and Giesl 1997) Basically, it transforms the rewrite system into a new reduction system which is simpler to analyze and (dis)prove termination. prod ( 0, m ) → 0 prod ( s ( n ) , m ) → prod ( n , m ) + m PROD ( s ( n ) , m ) ⇒ SUM ( prod ( n , m ) , m ) PROD ( s ( n ) , m ) ⇒ PROD ( n , m ) 0 + m → m s ( n ) + m → s ( n + m ) SUM ( s ( n ) , m ) ⇒ SUM ( n , m ) PROD(s(n),m) PROD(s(n),m) SUM(s(n),m) PROD(n,m) SUM(prod(n,m)) SUM(n,m) Albert Rubio - UPC RTA 2008– p.16/31
The Dependency Pair Method (cont.) (Arts and Giesl 1997) Basically, it transforms the rewrite system into a new reduction system which is simpler to analyze and (dis)prove termination. prod ( 0, m ) → 0 prod ( s ( n ) , m ) → prod ( n , m ) + m PROD ( s ( n ) , m ) ⇒ SUM ( prod ( n , m ) , m ) PROD ( s ( n ) , m ) ⇒ PROD ( n , m ) 0 + m → m s ( n ) + m → s ( n + m ) SUM ( s ( n ) , m ) ⇒ SUM ( n , m ) PROD(s(n),m) SUM(s(n),m) PROD(n,m) SUM(n,m) Albert Rubio - UPC RTA 2008– p.16/31
The Dependency Pair Method (cont.) (Arts and Giesl 1997) Basically, it transforms the rewrite system into a new reduction system which is simpler to analyze and (dis)prove termination. prod ( 0, m ) → 0 prod ( s ( n ) , m ) → prod ( n , m ) + m PROD ( s ( n ) , m ) ⇒ SUM ( prod ( n , m ) , m ) PROD ( s ( n ) , m ) ⇒ PROD ( n , m ) 0 + m → m s ( n ) + m → s ( n + m ) SUM ( s ( n ) , m ) ⇒ SUM ( n , m ) The first phase its a simple rewriting trace analysis. This method was a breakthrough in the development of automated termination provers for term rewriting Albert Rubio - UPC RTA 2008– p.16/31
The Dependency Pair Method (cont.) After simplifying the graph we have to show that all pontential cycles are finite. Solve the ordering constraints ensuring that all cycles in the graph are strictly decreasing. Find an ordering satisfying the constraint: Polynomial Interpretations. RPO-like orderings with argument filterings. ... Albert Rubio - UPC RTA 2008– p.17/31
The (Monotonic) Semantic Path Ordering (Borralleras, Ferreira and Rubio 2000) Albert Rubio - UPC RTA 2008– p.18/31
The (Monotonic) Semantic Path Ordering (Borralleras, Ferreira and Rubio 2000) s = f ( s 1 , . . . , s n ) ≻ rpo t if and only if 1. s i � rpo t for some 1 ≤ i ≤ n . 2. t = g ( t 1 , . . . , t m ) , f ≻ F g and s ≻ rpo t j for all 1 ≤ j ≤ m . 3. t = f ( t 1 , . . . , t m ) { s 1 , . . . , s n } ≻≻ rpo { t 1 , . . . , t m } and Albert Rubio - UPC RTA 2008– p.18/31
The (Monotonic) Semantic Path Ordering (Borralleras, Ferreira and Rubio 2000) s = f ( s 1 , . . . , s n ) ≻ spo t if and only if 1. s i � spo t for some 1 ≤ i ≤ n . 2. t = g ( t 1 , . . . , t m ) , s ❂ t and s ≻ spo t j for all 1 ≤ j ≤ m . 3. t = g ( t 1 , . . . , t m ) , s ⊒ t and { s 1 , . . . , s n } ≻≻ spo { t 1 , . . . , t m } in addition you need s ⊒ t to ensure monotonicity, where ⊒ is monotonic. Albert Rubio - UPC RTA 2008– p.18/31
Recommend
More recommend