A Dependency Pair Framework for Innermost Complexity Analysis of
Term Rewrite Systems
J¨urgen Giesl
LuFG Informatik 2, RWTH Aachen University, Germany
joint work withLars NoschinskiandFabian Emmes
Termination Analysis of TRSs
useful for termination ofprograms (Java, Haskell, Prolog, . . . )
Dependency Pair Framework
modular combination of different techniques automatable
Complexity Analysis of TRSs
should be useful for ofprograms⇒ Innermost Runtime Complexity adaptDependency Pair Framework
Hirokawa & Moser (IJCAR ’08, LPAR ’08) first adaption of DPs for complexity not modular
Zankl & Korp (RTA ’10)
modular approach based on relative rewriting forDerivational Complexity
(cannot exploit strength of DPs for innermost rewriting) new approach: directadaption of DP framework (CADE ’11)
modular combination of different techniques
automated and more powerful than previous approaches
Termination Analysis of TRSs
useful for termination ofprograms (Java, Haskell, Prolog, . . . ) Dependency Pair Framework
modular combination of different techniques automatable
Complexity Analysis of TRSs
should be useful for ofprograms⇒ Innermost Runtime Complexity adaptDependency Pair Framework
Hirokawa & Moser (IJCAR ’08, LPAR ’08) first adaption of DPs for complexity not modular
Zankl & Korp (RTA ’10)
modular approach based on relative rewriting forDerivational Complexity
(cannot exploit strength of DPs for innermost rewriting) new approach: directadaption of DP framework (CADE ’11)
modular combination of different techniques
automated and more powerful than previous approaches
Termination Analysis of TRSs
useful for termination ofprograms (Java, Haskell, Prolog, . . . ) Dependency Pair Framework
modular combination of different techniques automatable
Complexity Analysis of TRSs
should be useful for ofprograms⇒ Innermost Runtime Complexity adaptDependency Pair Framework
Hirokawa & Moser (IJCAR ’08, LPAR ’08) first adaption of DPs for complexity not modular
Zankl & Korp (RTA ’10)
modular approach based on relative rewriting forDerivational Complexity
(cannot exploit strength of DPs for innermost rewriting) new approach: directadaption of DP framework (CADE ’11)
modular combination of different techniques
automated and more powerful than previous approaches
Termination Analysis of TRSs
useful for termination ofprograms (Java, Haskell, Prolog, . . . ) Dependency Pair Framework
modular combination of different techniques automatable
Complexity Analysis of TRSs
should be useful for ofprograms⇒ Innermost Runtime Complexity
adaptDependency Pair Framework
Hirokawa & Moser (IJCAR ’08, LPAR ’08) first adaption of DPs for complexity not modular
Zankl & Korp (RTA ’10)
modular approach based on relative rewriting forDerivational Complexity
(cannot exploit strength of DPs for innermost rewriting) new approach: directadaption of DP framework (CADE ’11)
modular combination of different techniques
automated and more powerful than previous approaches
Termination Analysis of TRSs
useful for termination ofprograms (Java, Haskell, Prolog, . . . ) Dependency Pair Framework
modular combination of different techniques automatable
Complexity Analysis of TRSs
should be useful for ofprograms⇒ Innermost Runtime Complexity adaptDependency Pair Framework
Hirokawa & Moser (IJCAR ’08, LPAR ’08) first adaption of DPs for complexity not modular
Zankl & Korp (RTA ’10)
modular approach based on relative rewriting forDerivational Complexity
(cannot exploit strength of DPs for innermost rewriting) new approach: directadaption of DP framework (CADE ’11)
modular combination of different techniques
automated and more powerful than previous approaches
Termination Analysis of TRSs
useful for termination ofprograms (Java, Haskell, Prolog, . . . ) Dependency Pair Framework
modular combination of different techniques automatable
Complexity Analysis of TRSs
should be useful for ofprograms⇒ Innermost Runtime Complexity adaptDependency Pair Framework
Hirokawa & Moser (IJCAR ’08, LPAR ’08) first adaption of DPs for complexity not modular
Zankl & Korp (RTA ’10)
modular approach based on relative rewriting forDerivational Complexity
(cannot exploit strength of DPs for innermost rewriting) new approach: directadaption of DP framework (CADE ’11)
modular combination of different techniques
automated and more powerful than previous approaches
Termination Analysis of TRSs
useful for termination ofprograms (Java, Haskell, Prolog, . . . ) Dependency Pair Framework
modular combination of different techniques automatable
Complexity Analysis of TRSs
should be useful for ofprograms⇒ Innermost Runtime Complexity adaptDependency Pair Framework
Hirokawa & Moser (IJCAR ’08, LPAR ’08) first adaption of DPs for complexity not modular
Zankl & Korp (RTA ’10)
modular approach based on relative rewriting forDerivational Complexity
(cannot exploit strength of DPs for innermost rewriting)
new approach: directadaption of DP framework (CADE ’11) modular combination of different techniques
automated and more powerful than previous approaches
Termination Analysis of TRSs
useful for termination ofprograms (Java, Haskell, Prolog, . . . ) Dependency Pair Framework
modular combination of different techniques automatable
Complexity Analysis of TRSs
should be useful for ofprograms⇒ Innermost Runtime Complexity adaptDependency Pair Framework
Hirokawa & Moser (IJCAR ’08, LPAR ’08) first adaption of DPs for complexity not modular
Zankl & Korp (RTA ’10)
modular approach based on relative rewriting forDerivational Complexity
(cannot exploit strength of DPs for innermost rewriting) new approach: directadaption of DP framework (CADE ’11)
modular combination of different techniques
automated and more powerful than previous approaches
Innermost Runtime Complexity
R: double(0) → 0
double(s(x)) → s(s(double(x)))
Derivation Height dh(t): length of longest →i R-sequence witht
dh(double(sk(0)))=k+ 1 dh(doublek(s(0)))≈2k
Basic Terms f(t1, . . . ,tn)
f defined symbol (double), t1, . . . ,tn no defined symbols (s,0) Complexity ιR of TRS R:
length of longest →i R-sequence with basic termt where|t| ≤n
ιR=Pol0 iff length ∈ O(1) ιR =Pol1 iff length∈ O(n) ιR=Pol2 iff length ∈ O(n2) . . .
Example: ιR=Pol1
Innermost Runtime Complexity
R: double(0) → 0
double(s(x)) → s(s(double(x)))
Derivation Height dh(t): length of longest →i R-sequence witht dh(double(sk(0)))=k+ 1
dh(doublek(s(0)))≈2k
Basic Terms f(t1, . . . ,tn)
f defined symbol (double), t1, . . . ,tn no defined symbols (s,0) Complexity ιR of TRS R:
length of longest →i R-sequence with basic termt where|t| ≤n
ιR=Pol0 iff length ∈ O(1) ιR =Pol1 iff length∈ O(n) ιR=Pol2 iff length ∈ O(n2) . . .
Example: ιR=Pol1
Innermost Runtime Complexity
R: double(0) → 0
double(s(x)) → s(s(double(x)))
Derivation Height dh(t): length of longest →i R-sequence witht dh(double(sk(0)))=k+ 1
dh(doublek(s(0)))≈2k
Basic Terms f(t1, . . . ,tn)
f defined symbol (double), t1, . . . ,tn no defined symbols (s,0) Complexity ιR of TRS R:
length of longest →i R-sequence with basic termt where|t| ≤n
ιR=Pol0 iff length ∈ O(1) ιR =Pol1 iff length∈ O(n) ιR=Pol2 iff length ∈ O(n2) . . .
Example: ιR=Pol1
Innermost Runtime Complexity
R: double(0) → 0
double(s(x)) → s(s(double(x)))
Derivation Height dh(t): length of longest →i R-sequence witht dh(double(sk(0)))=k+ 1
dh(doublek(s(0)))≈2k Basic Terms f(t1, . . . ,tn)
f defined symbol (double), t1, . . . ,tn no defined symbols (s,0) Complexity ιR of TRS R:
length of longest →i R-sequence with basic termt where|t| ≤n
ιR=Pol0 iff length ∈ O(1) ιR =Pol1 iff length∈ O(n) ιR=Pol2 iff length ∈ O(n2) . . .
Example: ιR=Pol1
Innermost Runtime Complexity
R: double(0) → 0
double(s(x)) → s(s(double(x)))
Derivation Height dh(t): length of longest →i R-sequence witht dh(double(sk(0)))=k+ 1
dh(doublek(s(0)))≈2k
Basic Terms f(t1, . . . ,tn)
f defined symbol (double), t1, . . . ,tn no defined symbols (s,0)
Complexity ιR of TRS R:
length of longest →i R-sequence with basic termt where|t| ≤n
ιR=Pol0 iff length ∈ O(1) ιR =Pol1 iff length∈ O(n) ιR=Pol2 iff length ∈ O(n2) . . .
Example: ιR=Pol1
Innermost Runtime Complexity
R: double(0) → 0
double(s(x)) → s(s(double(x)))
Derivation Height dh(t): length of longest →i R-sequence witht dh(double(sk(0)))=k+ 1
dh(doublek(s(0)))≈2k
Basic Terms f(t1, . . . ,tn)
f defined symbol (double), t1, . . . ,tn no defined symbols (s,0) Complexity ιR of TRS R:
length of longest →i R-sequence with basic termt where|t| ≤n
ιR=Pol0 iff length ∈ O(1) ιR =Pol1 iff length∈ O(n) ιR=Pol2 iff length ∈ O(n2) . . .
Example: ιR=Pol1
Innermost Runtime Complexity
R: double(0) → 0
double(s(x)) → s(s(double(x)))
Derivation Height dh(t): length of longest →i R-sequence witht dh(double(sk(0)))=k+ 1
dh(doublek(s(0)))≈2k
Basic Terms f(t1, . . . ,tn)
f defined symbol (double), t1, . . . ,tn no defined symbols (s,0)
Complexity ιR of TRS R:
length of longest →i R-sequence with basic termt where|t| ≤n
ιR=Pol0 iff length ∈ O(1) ιR =Pol1 iff length∈ O(n) ιR=Pol2 iff length ∈ O(n2) . . .
Example: ιR=Pol1
Innermost Runtime Complexity
R: double(0) → 0
double(s(x)) → s(s(double(x)))
Derivation Height dh(t): length of longest →i R-sequence witht dh(double(sk(0)))=k+ 1
dh(doublek(s(0)))≈2k
Basic Terms f(t1, . . . ,tn)
f defined symbol (double), t1, . . . ,tn no defined symbols (s,0)
Complexity ιR of TRS R:
length of longest →i R-sequence with basic termt where|t| ≤n ιR=Pol0 iff length ∈ O(1)
ιR =Pol1 iff length∈ O(n) ιR=Pol2 iff length ∈ O(n2) . . .
Example: ιR=Pol1
Innermost Runtime Complexity
R: double(0) → 0
double(s(x)) → s(s(double(x)))
Derivation Height dh(t): length of longest →i R-sequence witht dh(double(sk(0)))=k+ 1
dh(doublek(s(0)))≈2k
Basic Terms f(t1, . . . ,tn)
f defined symbol (double), t1, . . . ,tn no defined symbols (s,0)
Complexity ιR of TRS R:
length of longest →i R-sequence with basic termt where|t| ≤n ιR=Pol0 iff length ∈ O(1) ιR =Pol1 iff length∈ O(n)
ιR=Pol2 iff length ∈ O(n2) . . . Example: ιR=Pol1
Innermost Runtime Complexity
R: double(0) → 0
double(s(x)) → s(s(double(x)))
Derivation Height dh(t): length of longest →i R-sequence witht dh(double(sk(0)))=k+ 1
dh(doublek(s(0)))≈2k
Basic Terms f(t1, . . . ,tn)
f defined symbol (double), t1, . . . ,tn no defined symbols (s,0)
Complexity ιR of TRS R:
length of longest →i R-sequence with basic termt where|t| ≤n
ιR=Pol0 iff length ∈ O(1) ιR =Pol1 iff length∈ O(n) ιR=Pol2 iff length ∈ O(n2) . . .
Example: ιR=Pol1
Innermost Runtime Complexity
R: double(0) → 0
double(s(x)) → s(s(double(x)))
Derivation Height dh(t): length of longest →i R-sequence witht dh(double(sk(0)))=k+ 1
dh(doublek(s(0)))≈2k
Basic Terms f(t1, . . . ,tn)
f defined symbol (double), t1, . . . ,tn no defined symbols (s,0)
Complexity ιR of TRS R:
length of longest →i R-sequence with basic termt where|t| ≤n
ιR=Pol0 iff length ∈ O(1) ιR =Pol1 iff length∈ O(n) ιR=Pol2 iff length ∈ O(n2) . . .
Example: ιR=Pol1
Dependency Tuples
m(x,y)→if(gt(x,y),x,y) gt(0,k)→false p(0)→0 if(true,x,y)→s(m(p(x),y)) gt(s(n),0)→true p(s(n))→n if(false,x,y)→0 gt(s(n),s(k))→gt(n,k)
Termination Analysis: Dependency Pairs
compare lhs with subterms of rhs that start with definedsymbol m
]
(x,y)→if
]
(gt(x,y),x,y) if
]
(true,x,y)→m
]
(p(x),y) m
]
(x,y)→gt
]
(x,y) if
]
(true,x,y)→p
]
(x) gt
]
(s(n),s(k))→gt
]
(n,k)
Complexity Analysis: Dependency Tuples compare lhs with alldefined subterms of rhsat once
m](x,y)→Com2(if](gt(x,y),x,y),gt](x,y)) p](0)→Com0
if](true,x,y)→Com2(m](p(x),y),p](x)) p](s(n))→Com0
if](false,x,y)→Com0 gt](0,k)→Com0 gt](s(n),0)→Com0
gt](s(n),s(k))→Com1(gt](n,k))
Dependency Tuples
m(x,y)→if(gt(x,y),x,y) gt(0,k)→false p(0)→0 if(true,x,y)→s(m(p(x),y)) gt(s(n),0)→true p(s(n))→n if(false,x,y)→0 gt(s(n),s(k))→gt(n,k)
Termination Analysis: Dependency Pairs
compare lhs with subterms of rhs that start with definedsymbol m
]
(x,y)→if
]
(gt(x,y),x,y) if
]
(true,x,y)→m
]
(p(x),y) m
]
(x,y)→gt
]
(x,y) if
]
(true,x,y)→p
]
(x) gt
]
(s(n),s(k))→gt
]
(n,k)
Complexity Analysis: Dependency Tuples compare lhs with alldefined subterms of rhsat once
m](x,y)→Com2(if](gt(x,y),x,y),gt](x,y)) p](0)→Com0
if](true,x,y)→Com2(m](p(x),y),p](x)) p](s(n))→Com0
if](false,x,y)→Com0 gt](0,k)→Com0 gt](s(n),0)→Com0
gt](s(n),s(k))→Com1(gt](n,k))
Dependency Tuples
m(x,y)→if(gt(x,y),x,y) gt(0,k)→false p(0)→0 if(true,x,y)→s(m(p(x),y)) gt(s(n),0)→true p(s(n))→n if(false,x,y)→0 gt(s(n),s(k))→gt(n,k)
Termination Analysis: Dependency Pairs
compare lhs with subterms of rhs that start with definedsymbol
m
]
(x,y)→if
]
(gt(x,y),x,y) if
]
(true,x,y)→m
]
(p(x),y) m
]
(x,y)→gt
]
(x,y) if
]
(true,x,y)→p
]
(x) gt
]
(s(n),s(k))→gt
]
(n,k)
Complexity Analysis: Dependency Tuples compare lhs with alldefined subterms of rhsat once
m](x,y)→Com2(if](gt(x,y),x,y),gt](x,y)) p](0)→Com0
if](true,x,y)→Com2(m](p(x),y),p](x)) p](s(n))→Com0
if](false,x,y)→Com0 gt](0,k)→Com0 gt](s(n),0)→Com0
gt](s(n),s(k))→Com1(gt](n,k))
Dependency Tuples
m(x,y)→if(gt(x,y),x,y) gt(0,k)→false p(0)→0 if(true,x,y)→s(m(p(x),y)) gt(s(n),0)→true p(s(n))→n if(false,x,y)→0 gt(s(n),s(k))→gt(n,k)
Termination Analysis: Dependency Pairs
compare lhs with subterms of rhs that start with definedsymbol
m
]
(x,y)→if
]
(gt(x,y),x,y) if
]
(true,x,y)→m
]
(p(x),y) m
]
(x,y)→gt
]
(x,y) if
]
(true,x,y)→p
]
(x) gt
]
(s(n),s(k))→gt
]
(n,k)
Complexity Analysis: Dependency Tuples compare lhs with alldefined subterms of rhsat once
m](x,y)→Com2(if](gt(x,y),x,y),gt](x,y)) p](0)→Com0
if](true,x,y)→Com2(m](p(x),y),p](x)) p](s(n))→Com0
if](false,x,y)→Com0 gt](0,k)→Com0 gt](s(n),0)→Com0
gt](s(n),s(k))→Com1(gt](n,k))
Dependency Tuples
m(x,y)→if(gt(x,y),x,y) gt(0,k)→false p(0)→0 if(true,x,y)→s(m(p(x),y)) gt(s(n),0)→true p(s(n))→n if(false,x,y)→0 gt(s(n),s(k))→gt(n,k)
Termination Analysis: Dependency Pairs
compare lhs with subterms of rhs that start with definedsymbol m
]
(x,y)→if
]
(gt(x,y),x,y) if
]
(true,x,y)→m
]
(p(x),y) m
]
(x,y)→gt
]
(x,y) if
]
(true,x,y)→p
]
(x) gt
]
(s(n),s(k))→gt
]
(n,k)
Complexity Analysis: Dependency Tuples compare lhs with alldefined subterms of rhsat once
m](x,y)→Com2(if](gt(x,y),x,y),gt](x,y)) p](0)→Com0
if](true,x,y)→Com2(m](p(x),y),p](x)) p](s(n))→Com0
if](false,x,y)→Com0 gt](0,k)→Com0 gt](s(n),0)→Com0
gt](s(n),s(k))→Com1(gt](n,k))
Dependency Tuples
m(x,y)→if(gt(x,y),x,y) gt(0,k)→false p(0)→0 if(true,x,y)→s(m(p(x),y)) gt(s(n),0)→true p(s(n))→n if(false,x,y)→0 gt(s(n),s(k))→gt(n,k)
Termination Analysis: Dependency Pairs
compare lhs with subterms of rhs that start with definedsymbol m](x,y)→if](gt(x,y),x,y) if](true,x,y)→m](p(x),y) m](x,y)→gt](x,y) if](true,x,y)→p](x)
gt](s(n),s(k))→gt](n,k)
Complexity Analysis: Dependency Tuples compare lhs with alldefined subterms of rhsat once
m](x,y)→Com2(if](gt(x,y),x,y),gt](x,y)) p](0)→Com0
if](true,x,y)→Com2(m](p(x),y),p](x)) p](s(n))→Com0
if](false,x,y)→Com0 gt](0,k)→Com0 gt](s(n),0)→Com0
gt](s(n),s(k))→Com1(gt](n,k))
Dependency Tuples
m(x,y)→if(gt(x,y),x,y) gt(0,k)→false p(0)→0 if(true,x,y)→s(m(p(x),y)) gt(s(n),0)→true p(s(n))→n if(false,x,y)→0 gt(s(n),s(k))→gt(n,k)
Termination Analysis: Dependency Pairs
compare lhs with subterms of rhs that start with definedsymbol m](x,y)→if](gt(x,y),x,y) if](true,x,y)→m](p(x),y) m](x,y)→gt](x,y) if](true,x,y)→p](x)
gt](s(n),s(k))→gt](n,k)
Complexity Analysis: Dependency Tuples
compare lhs with alldefined subterms of rhsat once
m](x,y)→Com2(if](gt(x,y),x,y),gt](x,y)) p](0)→Com0
if](true,x,y)→Com2(m](p(x),y),p](x)) p](s(n))→Com0
if](false,x,y)→Com0 gt](0,k)→Com0 gt](s(n),0)→Com0
gt](s(n),s(k))→Com1(gt](n,k))
Dependency Tuples
m(x,y)→if(gt(x,y),x,y) gt(0,k)→false p(0)→0 if(true,x,y)→s(m(p(x),y)) gt(s(n),0)→true p(s(n))→n if(false,x,y)→0 gt(s(n),s(k))→gt(n,k)
Termination Analysis: Dependency Pairs
compare lhs with subterms of rhs that start with definedsymbol m](x,y)→if](gt(x,y),x,y) if](true,x,y)→m](p(x),y) m](x,y)→gt](x,y) if](true,x,y)→p](x)
gt](s(n),s(k))→gt](n,k)
Complexity Analysis: Dependency Tuples compare lhs with alldefined subterms of rhsat once
m](x,y)→Com2(if](gt(x,y),x,y),gt](x,y)) p](0)→Com0
if](true,x,y)→Com2(m](p(x),y),p](x)) p](s(n))→Com0
if](false,x,y)→Com0 gt](0,k)→Com0 gt](s(n),0)→Com0
gt](s(n),s(k))→Com1(gt](n,k))
Dependency Tuples
m(x,y)→if(gt(x,y),x,y) gt(0,k)→false p(0)→0 if(true,x,y)→s(m(p(x),y)) gt(s(n),0)→true p(s(n))→n if(false,x,y)→0 gt(s(n),s(k))→gt(n,k)
Termination Analysis: Dependency Pairs
compare lhs with subterms of rhs that start with definedsymbol m](x,y)→if](gt(x,y),x,y) if](true,x,y)→m](p(x),y) m](x,y)→gt](x,y) if](true,x,y)→p](x)
gt](s(n),s(k))→gt](n,k)
Complexity Analysis: Dependency Tuples compare lhs with alldefined subterms of rhsat once
m](x,y)→Com2(if](gt(x,y),x,y),gt](x,y)) p](0)→Com0
if](true,x,y)→Com2(m](p(x),y),p](x)) p](s(n))→Com0
if](false,x,y)→Com0 gt](0,k)→Com0 gt](s(n),0)→Com0
gt](s(n),s(k))→Com1(gt](n,k))
Chain Trees
DT(R) : m](x,y)→Com2(if](gt(x,y),x,y),gt](x,y)) p](0)→Com0
if](true,x,y)→Com2(m](p(x),y),p](x)) p](s(n))→Com0 if](false,x,y)→Com0 gt](0,k)→Com0
gt](s(n),0)→Com0
gt](s(n),s(k))→Com1(gt](n,k)) (D,R)-Chain Tree:
Edgeσ1(
u]→Comn(v1], . . . ,vn])
) toσ2(w]→Comm(. . .)) if vi]σ1→i ∗R w]σ2
m](s(0),0)→Com2(if](gt(s(0),0),s(0),0),gt](s(0),0))
if](true,s(0),0)→Com2(m](p(s(0)),0),p](s(0))) gt](s(0),0)→Com0
m](s(0),0)→Com2(if](gt(s(0),0),s(0),0),gt](s(0),0)) p](s(0))→Com0
if](false,s(0),0)→Com0 gt](s(0),0)→Com0
Chain Trees
DT(R) : m](x,y)→Com2(if](gt(x,y),x,y),gt](x,y)) p](0)→Com0
if](true,x,y)→Com2(m](p(x),y),p](x)) p](s(n))→Com0 if](false,x,y)→Com0 gt](0,k)→Com0
gt](s(n),0)→Com0
gt](s(n),s(k))→Com1(gt](n,k)) (D,R)-Chain Tree:
Edgeσ1(
u]→Comn(v1], . . . ,vn])
) toσ2(w]→Comm(. . .)) if vi]σ1→i ∗R w]σ2
m](s(0),0)→Com2(if](gt(s(0),0),s(0),0),gt](s(0),0))
if](true,s(0),0)→Com2(m](p(s(0)),0),p](s(0))) gt](s(0),0)→Com0
m](s(0),0)→Com2(if](gt(s(0),0),s(0),0),gt](s(0),0)) p](s(0))→Com0
if](false,s(0),0)→Com0 gt](s(0),0)→Com0
Chain Trees
DT(R) : m](x,y)→Com2(if](gt(x,y),x,y),gt](x,y)) p](0)→Com0
if](true,x,y)→Com2(m](p(x),y),p](x)) p](s(n))→Com0 if](false,x,y)→Com0 gt](0,k)→Com0
gt](s(n),0)→Com0
gt](s(n),s(k))→Com1(gt](n,k)) (D,R)-Chain Tree:
Edge
σ1(u]→Comn(v1], . . . ,vn]))
toσ2(w]→Comm(. . .)) if vi]σ1→i ∗R w]σ2
m](s(0),0)→Com2(if](gt(s(0),0),s(0),0),gt](s(0),0))
if](true,s(0),0)→Com2(m](p(s(0)),0),p](s(0))) gt](s(0),0)→Com0
m](s(0),0)→Com2(if](gt(s(0),0),s(0),0),gt](s(0),0)) p](s(0))→Com0
if](false,s(0),0)→Com0 gt](s(0),0)→Com0
Chain Trees
DT(R) : m](x,y)→Com2(if](gt(x,y),x,y),gt](x,y)) p](0)→Com0
if](true,x,y)→Com2(m](p(x),y),p](x)) p](s(n))→Com0 if](false,x,y)→Com0 gt](0,k)→Com0
gt](s(n),0)→Com0
gt](s(n),s(k))→Com1(gt](n,k)) (D,R)-Chain Tree:
Edgeσ1(u]→Comn(v1], . . . ,vn])) to σ2(w]→Comm(. . .)) if vi]σ1→i ∗Rw]σ2
m](s(0),0)→Com2(if](gt(s(0),0),s(0),0),gt](s(0),0))
if](true,s(0),0)→Com2(m](p(s(0)),0),p](s(0))) gt](s(0),0)→Com0
m](s(0),0)→Com2(if](gt(s(0),0),s(0),0),gt](s(0),0)) p](s(0))→Com0
if](false,s(0),0)→Com0 gt](s(0),0)→Com0