Termination w.r.t. Q of the following Term Rewriting System could be proven:
Q restricted rewrite system:
The TRS R consists of the following rules:
nthtail(n, l) → cond(ge(n, length(l)), n, l)
cond(true, n, l) → l
cond(false, n, l) → tail(nthtail(s(n), l))
tail(nil) → nil
tail(cons(x, l)) → l
length(nil) → 0
length(cons(x, l)) → s(length(l))
ge(u, 0) → true
ge(0, s(v)) → false
ge(s(u), s(v)) → ge(u, v)
The set Q consists of the following terms:
ge(x0, 0)
nthtail(x0, x1)
tail(nil)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
cond(false, x0, x1)
cond(true, x0, x1)
tail(cons(x0, x1))
↳ QTRS
↳ DependencyPairsProof
Q restricted rewrite system:
The TRS R consists of the following rules:
nthtail(n, l) → cond(ge(n, length(l)), n, l)
cond(true, n, l) → l
cond(false, n, l) → tail(nthtail(s(n), l))
tail(nil) → nil
tail(cons(x, l)) → l
length(nil) → 0
length(cons(x, l)) → s(length(l))
ge(u, 0) → true
ge(0, s(v)) → false
ge(s(u), s(v)) → ge(u, v)
The set Q consists of the following terms:
ge(x0, 0)
nthtail(x0, x1)
tail(nil)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
cond(false, x0, x1)
cond(true, x0, x1)
tail(cons(x0, x1))
Using Dependency Pairs [1,13] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:
NTHTAIL(n, l) → GE(n, length(l))
LENGTH(cons(x, l)) → LENGTH(l)
NTHTAIL(n, l) → LENGTH(l)
COND(false, n, l) → TAIL(nthtail(s(n), l))
COND(false, n, l) → NTHTAIL(s(n), l)
NTHTAIL(n, l) → COND(ge(n, length(l)), n, l)
GE(s(u), s(v)) → GE(u, v)
The TRS R consists of the following rules:
nthtail(n, l) → cond(ge(n, length(l)), n, l)
cond(true, n, l) → l
cond(false, n, l) → tail(nthtail(s(n), l))
tail(nil) → nil
tail(cons(x, l)) → l
length(nil) → 0
length(cons(x, l)) → s(length(l))
ge(u, 0) → true
ge(0, s(v)) → false
ge(s(u), s(v)) → ge(u, v)
The set Q consists of the following terms:
ge(x0, 0)
nthtail(x0, x1)
tail(nil)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
cond(false, x0, x1)
cond(true, x0, x1)
tail(cons(x0, x1))
We have to consider all minimal (P,Q,R)-chains.
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
Q DP problem:
The TRS P consists of the following rules:
NTHTAIL(n, l) → GE(n, length(l))
LENGTH(cons(x, l)) → LENGTH(l)
NTHTAIL(n, l) → LENGTH(l)
COND(false, n, l) → TAIL(nthtail(s(n), l))
COND(false, n, l) → NTHTAIL(s(n), l)
NTHTAIL(n, l) → COND(ge(n, length(l)), n, l)
GE(s(u), s(v)) → GE(u, v)
The TRS R consists of the following rules:
nthtail(n, l) → cond(ge(n, length(l)), n, l)
cond(true, n, l) → l
cond(false, n, l) → tail(nthtail(s(n), l))
tail(nil) → nil
tail(cons(x, l)) → l
length(nil) → 0
length(cons(x, l)) → s(length(l))
ge(u, 0) → true
ge(0, s(v)) → false
ge(s(u), s(v)) → ge(u, v)
The set Q consists of the following terms:
ge(x0, 0)
nthtail(x0, x1)
tail(nil)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
cond(false, x0, x1)
cond(true, x0, x1)
tail(cons(x0, x1))
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [13,14,18] contains 3 SCCs with 3 less nodes.
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ UsableRulesProof
↳ QDP
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
GE(s(u), s(v)) → GE(u, v)
The TRS R consists of the following rules:
nthtail(n, l) → cond(ge(n, length(l)), n, l)
cond(true, n, l) → l
cond(false, n, l) → tail(nthtail(s(n), l))
tail(nil) → nil
tail(cons(x, l)) → l
length(nil) → 0
length(cons(x, l)) → s(length(l))
ge(u, 0) → true
ge(0, s(v)) → false
ge(s(u), s(v)) → ge(u, v)
The set Q consists of the following terms:
ge(x0, 0)
nthtail(x0, x1)
tail(nil)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
cond(false, x0, x1)
cond(true, x0, x1)
tail(cons(x0, x1))
We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [13] we can delete all non-usable rules [14] from R.
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ UsableRulesProof
↳ QDP
↳ QReductionProof
↳ QDP
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
GE(s(u), s(v)) → GE(u, v)
R is empty.
The set Q consists of the following terms:
ge(x0, 0)
nthtail(x0, x1)
tail(nil)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
cond(false, x0, x1)
cond(true, x0, x1)
tail(cons(x0, x1))
We have to consider all minimal (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.
ge(x0, 0)
nthtail(x0, x1)
tail(nil)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
cond(false, x0, x1)
cond(true, x0, x1)
tail(cons(x0, x1))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ UsableRulesProof
↳ QDP
↳ QReductionProof
↳ QDP
↳ QDPSizeChangeProof
↳ QDP
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
GE(s(u), s(v)) → GE(u, v)
R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [16] together with the size-change analysis [27] we have proven that there are no infinite chains for this DP problem. From the DPs we obtained the following set of size-change graphs:
- GE(s(u), s(v)) → GE(u, v)
The graph contains the following edges 1 > 1, 2 > 2
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ UsableRulesProof
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
LENGTH(cons(x, l)) → LENGTH(l)
The TRS R consists of the following rules:
nthtail(n, l) → cond(ge(n, length(l)), n, l)
cond(true, n, l) → l
cond(false, n, l) → tail(nthtail(s(n), l))
tail(nil) → nil
tail(cons(x, l)) → l
length(nil) → 0
length(cons(x, l)) → s(length(l))
ge(u, 0) → true
ge(0, s(v)) → false
ge(s(u), s(v)) → ge(u, v)
The set Q consists of the following terms:
ge(x0, 0)
nthtail(x0, x1)
tail(nil)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
cond(false, x0, x1)
cond(true, x0, x1)
tail(cons(x0, x1))
We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [13] we can delete all non-usable rules [14] from R.
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ UsableRulesProof
↳ QDP
↳ QReductionProof
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
LENGTH(cons(x, l)) → LENGTH(l)
R is empty.
The set Q consists of the following terms:
ge(x0, 0)
nthtail(x0, x1)
tail(nil)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
cond(false, x0, x1)
cond(true, x0, x1)
tail(cons(x0, x1))
We have to consider all minimal (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.
ge(x0, 0)
nthtail(x0, x1)
tail(nil)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
cond(false, x0, x1)
cond(true, x0, x1)
tail(cons(x0, x1))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ UsableRulesProof
↳ QDP
↳ QReductionProof
↳ QDP
↳ QDPSizeChangeProof
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
LENGTH(cons(x, l)) → LENGTH(l)
R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [16] together with the size-change analysis [27] we have proven that there are no infinite chains for this DP problem. From the DPs we obtained the following set of size-change graphs:
- LENGTH(cons(x, l)) → LENGTH(l)
The graph contains the following edges 1 > 1
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDP
↳ UsableRulesProof
Q DP problem:
The TRS P consists of the following rules:
NTHTAIL(n, l) → COND(ge(n, length(l)), n, l)
COND(false, n, l) → NTHTAIL(s(n), l)
The TRS R consists of the following rules:
nthtail(n, l) → cond(ge(n, length(l)), n, l)
cond(true, n, l) → l
cond(false, n, l) → tail(nthtail(s(n), l))
tail(nil) → nil
tail(cons(x, l)) → l
length(nil) → 0
length(cons(x, l)) → s(length(l))
ge(u, 0) → true
ge(0, s(v)) → false
ge(s(u), s(v)) → ge(u, v)
The set Q consists of the following terms:
ge(x0, 0)
nthtail(x0, x1)
tail(nil)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
cond(false, x0, x1)
cond(true, x0, x1)
tail(cons(x0, x1))
We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [13] we can delete all non-usable rules [14] from R.
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDP
↳ UsableRulesProof
↳ QDP
↳ QReductionProof
Q DP problem:
The TRS P consists of the following rules:
NTHTAIL(n, l) → COND(ge(n, length(l)), n, l)
COND(false, n, l) → NTHTAIL(s(n), l)
The TRS R consists of the following rules:
length(nil) → 0
length(cons(x, l)) → s(length(l))
ge(u, 0) → true
ge(0, s(v)) → false
ge(s(u), s(v)) → ge(u, v)
The set Q consists of the following terms:
ge(x0, 0)
nthtail(x0, x1)
tail(nil)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
cond(false, x0, x1)
cond(true, x0, x1)
tail(cons(x0, x1))
We have to consider all minimal (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.
nthtail(x0, x1)
tail(nil)
cond(false, x0, x1)
cond(true, x0, x1)
tail(cons(x0, x1))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDP
↳ UsableRulesProof
↳ QDP
↳ QReductionProof
↳ QDP
↳ Narrowing
↳ NonInfProof
Q DP problem:
The TRS P consists of the following rules:
COND(false, n, l) → NTHTAIL(s(n), l)
NTHTAIL(n, l) → COND(ge(n, length(l)), n, l)
The TRS R consists of the following rules:
length(nil) → 0
length(cons(x, l)) → s(length(l))
ge(u, 0) → true
ge(0, s(v)) → false
ge(s(u), s(v)) → ge(u, v)
The set Q consists of the following terms:
ge(x0, 0)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
We have to consider all minimal (P,Q,R)-chains.
By narrowing [13] the rule NTHTAIL(n, l) → COND(ge(n, length(l)), n, l) at position [0] we obtained the following new rules:
NTHTAIL(y0, nil) → COND(ge(y0, 0), y0, nil)
NTHTAIL(y0, cons(x0, x1)) → COND(ge(y0, s(length(x1))), y0, cons(x0, x1))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDP
↳ UsableRulesProof
↳ QDP
↳ QReductionProof
↳ QDP
↳ Narrowing
↳ QDP
↳ DependencyGraphProof
↳ NonInfProof
Q DP problem:
The TRS P consists of the following rules:
NTHTAIL(y0, nil) → COND(ge(y0, 0), y0, nil)
NTHTAIL(y0, cons(x0, x1)) → COND(ge(y0, s(length(x1))), y0, cons(x0, x1))
COND(false, n, l) → NTHTAIL(s(n), l)
The TRS R consists of the following rules:
length(nil) → 0
length(cons(x, l)) → s(length(l))
ge(u, 0) → true
ge(0, s(v)) → false
ge(s(u), s(v)) → ge(u, v)
The set Q consists of the following terms:
ge(x0, 0)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [13,14,18] contains 1 SCC with 1 less node.
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDP
↳ UsableRulesProof
↳ QDP
↳ QReductionProof
↳ QDP
↳ Narrowing
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ Instantiation
↳ NonInfProof
Q DP problem:
The TRS P consists of the following rules:
NTHTAIL(y0, cons(x0, x1)) → COND(ge(y0, s(length(x1))), y0, cons(x0, x1))
COND(false, n, l) → NTHTAIL(s(n), l)
The TRS R consists of the following rules:
length(nil) → 0
length(cons(x, l)) → s(length(l))
ge(u, 0) → true
ge(0, s(v)) → false
ge(s(u), s(v)) → ge(u, v)
The set Q consists of the following terms:
ge(x0, 0)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
We have to consider all minimal (P,Q,R)-chains.
By instantiating [13] the rule NTHTAIL(y0, cons(x0, x1)) → COND(ge(y0, s(length(x1))), y0, cons(x0, x1)) we obtained the following new rules:
NTHTAIL(s(z0), cons(x1, x2)) → COND(ge(s(z0), s(length(x2))), s(z0), cons(x1, x2))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDP
↳ UsableRulesProof
↳ QDP
↳ QReductionProof
↳ QDP
↳ Narrowing
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ Instantiation
↳ QDP
↳ Rewriting
↳ NonInfProof
Q DP problem:
The TRS P consists of the following rules:
COND(false, n, l) → NTHTAIL(s(n), l)
NTHTAIL(s(z0), cons(x1, x2)) → COND(ge(s(z0), s(length(x2))), s(z0), cons(x1, x2))
The TRS R consists of the following rules:
length(nil) → 0
length(cons(x, l)) → s(length(l))
ge(u, 0) → true
ge(0, s(v)) → false
ge(s(u), s(v)) → ge(u, v)
The set Q consists of the following terms:
ge(x0, 0)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
We have to consider all minimal (P,Q,R)-chains.
By rewriting [13] the rule NTHTAIL(s(z0), cons(x1, x2)) → COND(ge(s(z0), s(length(x2))), s(z0), cons(x1, x2)) at position [0] we obtained the following new rules:
NTHTAIL(s(z0), cons(x1, x2)) → COND(ge(z0, length(x2)), s(z0), cons(x1, x2))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDP
↳ UsableRulesProof
↳ QDP
↳ QReductionProof
↳ QDP
↳ Narrowing
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ Instantiation
↳ QDP
↳ Rewriting
↳ QDP
↳ Instantiation
↳ NonInfProof
Q DP problem:
The TRS P consists of the following rules:
NTHTAIL(s(z0), cons(x1, x2)) → COND(ge(z0, length(x2)), s(z0), cons(x1, x2))
COND(false, n, l) → NTHTAIL(s(n), l)
The TRS R consists of the following rules:
length(nil) → 0
length(cons(x, l)) → s(length(l))
ge(u, 0) → true
ge(0, s(v)) → false
ge(s(u), s(v)) → ge(u, v)
The set Q consists of the following terms:
ge(x0, 0)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
We have to consider all minimal (P,Q,R)-chains.
By instantiating [13] the rule COND(false, n, l) → NTHTAIL(s(n), l) we obtained the following new rules:
COND(false, s(z0), cons(z1, z2)) → NTHTAIL(s(s(z0)), cons(z1, z2))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDP
↳ UsableRulesProof
↳ QDP
↳ QReductionProof
↳ QDP
↳ Narrowing
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ Instantiation
↳ QDP
↳ Rewriting
↳ QDP
↳ Instantiation
↳ QDP
↳ NonInfProof
Q DP problem:
The TRS P consists of the following rules:
NTHTAIL(s(z0), cons(x1, x2)) → COND(ge(z0, length(x2)), s(z0), cons(x1, x2))
COND(false, s(z0), cons(z1, z2)) → NTHTAIL(s(s(z0)), cons(z1, z2))
The TRS R consists of the following rules:
length(nil) → 0
length(cons(x, l)) → s(length(l))
ge(u, 0) → true
ge(0, s(v)) → false
ge(s(u), s(v)) → ge(u, v)
The set Q consists of the following terms:
ge(x0, 0)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
We have to consider all minimal (P,Q,R)-chains.
The DP Problem is simplified using the Induction Calculus with the following steps:
Note that final constraints are written in bold face.
For Pair NTHTAIL(n, l) → COND(ge(n, length(l)), n, l) the following chains were created:
- We consider the chain NTHTAIL(n, l) → COND(ge(n, length(l)), n, l), COND(false, n, l) → NTHTAIL(s(n), l) which results in the following constraint:
- (1) (COND(ge(x2, length(x3)), x2, x3)=COND(false, x4, x5) ⇒ NTHTAIL(x2, x3)≥COND(ge(x2, length(x3)), x2, x3))
We simplified constraint (1) using rules (I), (II), (IV), (VII) which results in the following new constraint:
- (2) (length(x3)=x12∧ge(x2, x12)=false ⇒ NTHTAIL(x2, x3)≥COND(ge(x2, length(x3)), x2, x3))
We simplified constraint (2) using rule (V) (with possible (I) afterwards) using induction on ge(x2, x12)=false which results in the following new constraints:
- (3) (false=false∧length(x3)=s(x14) ⇒ NTHTAIL(0, x3)≥COND(ge(0, length(x3)), 0, x3))
- (4) (ge(x15, x16)=false∧length(x3)=s(x16)∧(∀x17:ge(x15, x16)=false∧length(x17)=x16 ⇒ NTHTAIL(x15, x17)≥COND(ge(x15, length(x17)), x15, x17)) ⇒ NTHTAIL(s(x15), x3)≥COND(ge(s(x15), length(x3)), s(x15), x3))
We simplified constraint (3) using rules (I), (II) which results in the following new constraint:
- (5) (length(x3)=s(x14) ⇒ NTHTAIL(0, x3)≥COND(ge(0, length(x3)), 0, x3))
We simplified constraint (4) using rule (V) (with possible (I) afterwards) using induction on length(x3)=s(x16) which results in the following new constraint:
- (6) (s(length(x22))=s(x16)∧ge(x15, x16)=false∧(∀x17:ge(x15, x16)=false∧length(x17)=x16 ⇒ NTHTAIL(x15, x17)≥COND(ge(x15, length(x17)), x15, x17))∧(∀x23,x24,x25:length(x22)=s(x23)∧ge(x24, x23)=false∧(∀x25:ge(x24, x23)=false∧length(x25)=x23 ⇒ NTHTAIL(x24, x25)≥COND(ge(x24, length(x25)), x24, x25)) ⇒ NTHTAIL(s(x24), x22)≥COND(ge(s(x24), length(x22)), s(x24), x22)) ⇒ NTHTAIL(s(x15), cons(x21, x22))≥COND(ge(s(x15), length(cons(x21, x22))), s(x15), cons(x21, x22)))
We simplified constraint (5) using rule (V) (with possible (I) afterwards) using induction on length(x3)=s(x14) which results in the following new constraint:
- (7) (s(length(x19))=s(x14)∧(∀x20:length(x19)=s(x20) ⇒ NTHTAIL(0, x19)≥COND(ge(0, length(x19)), 0, x19)) ⇒ NTHTAIL(0, cons(x18, x19))≥COND(ge(0, length(cons(x18, x19))), 0, cons(x18, x19)))
We simplified constraint (7) using rules (I), (II), (IV) which results in the following new constraint:
- (8) (NTHTAIL(0, cons(x18, x19))≥COND(ge(0, length(cons(x18, x19))), 0, cons(x18, x19)))
We simplified constraint (6) using rules (I), (II) which results in the following new constraint:
- (9) (length(x22)=x16∧ge(x15, x16)=false∧(∀x17:ge(x15, x16)=false∧length(x17)=x16 ⇒ NTHTAIL(x15, x17)≥COND(ge(x15, length(x17)), x15, x17))∧(∀x23,x24,x25:length(x22)=s(x23)∧ge(x24, x23)=false∧(∀x25:ge(x24, x23)=false∧length(x25)=x23 ⇒ NTHTAIL(x24, x25)≥COND(ge(x24, length(x25)), x24, x25)) ⇒ NTHTAIL(s(x24), x22)≥COND(ge(s(x24), length(x22)), s(x24), x22)) ⇒ NTHTAIL(s(x15), cons(x21, x22))≥COND(ge(s(x15), length(cons(x21, x22))), s(x15), cons(x21, x22)))
We simplified constraint (9) using rule (VI) where we applied the induction hypothesis (∀x17:ge(x15, x16)=false∧length(x17)=x16 ⇒ NTHTAIL(x15, x17)≥COND(ge(x15, length(x17)), x15, x17)) with σ = [x17 / x22] which results in the following new constraint:
- (10) (NTHTAIL(x15, x22)≥COND(ge(x15, length(x22)), x15, x22)∧(∀x23,x24,x25:length(x22)=s(x23)∧ge(x24, x23)=false∧(∀x25:ge(x24, x23)=false∧length(x25)=x23 ⇒ NTHTAIL(x24, x25)≥COND(ge(x24, length(x25)), x24, x25)) ⇒ NTHTAIL(s(x24), x22)≥COND(ge(s(x24), length(x22)), s(x24), x22)) ⇒ NTHTAIL(s(x15), cons(x21, x22))≥COND(ge(s(x15), length(cons(x21, x22))), s(x15), cons(x21, x22)))
We simplified constraint (10) using rule (IV) which results in the following new constraint:
- (11) (NTHTAIL(x15, x22)≥COND(ge(x15, length(x22)), x15, x22) ⇒ NTHTAIL(s(x15), cons(x21, x22))≥COND(ge(s(x15), length(cons(x21, x22))), s(x15), cons(x21, x22)))
For Pair COND(false, n, l) → NTHTAIL(s(n), l) the following chains were created:
- We consider the chain COND(false, n, l) → NTHTAIL(s(n), l), NTHTAIL(n, l) → COND(ge(n, length(l)), n, l) which results in the following constraint:
- (12) (NTHTAIL(s(x6), x7)=NTHTAIL(x8, x9) ⇒ COND(false, x6, x7)≥NTHTAIL(s(x6), x7))
We simplified constraint (12) using rules (I), (II), (IV) which results in the following new constraint:
- (13) (COND(false, x6, x7)≥NTHTAIL(s(x6), x7))
To summarize, we get the following constraints P≥ for the following pairs.
- NTHTAIL(n, l) → COND(ge(n, length(l)), n, l)
- (NTHTAIL(0, cons(x18, x19))≥COND(ge(0, length(cons(x18, x19))), 0, cons(x18, x19)))
- (NTHTAIL(x15, x22)≥COND(ge(x15, length(x22)), x15, x22) ⇒ NTHTAIL(s(x15), cons(x21, x22))≥COND(ge(s(x15), length(cons(x21, x22))), s(x15), cons(x21, x22)))
- COND(false, n, l) → NTHTAIL(s(n), l)
- (COND(false, x6, x7)≥NTHTAIL(s(x6), x7))
The constraints for P> respective Pbound are constructed from P≥ where we just replace every occurence of "t ≥ s" in P≥ by "t > s" respective "t ≥ c". Here c stands for the fresh constant used for Pbound.
Using the following integer polynomial ordering the resulting constraints can be solved.
Polynomial interpretation [21]:
POL(0) = 0
POL(COND(x1, x2, x3)) = -1 - x1 - x2 + x3
POL(NTHTAIL(x1, x2)) = -1 - x1 + x2
POL(c) = -1
POL(cons(x1, x2)) = 2 + x2
POL(false) = 0
POL(ge(x1, x2)) = 0
POL(length(x1)) = 0
POL(nil) = 2
POL(s(x1)) = 2 + x1
POL(true) = 0
The following pairs are in P>:
COND(false, n, l) → NTHTAIL(s(n), l)
The following pairs are in Pbound:
NTHTAIL(n, l) → COND(ge(n, length(l)), n, l)
The following rules are usable:
true → ge(u, 0)
ge(u, v) → ge(s(u), s(v))
false → ge(0, s(v))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDP
↳ UsableRulesProof
↳ QDP
↳ QReductionProof
↳ QDP
↳ Narrowing
↳ NonInfProof
↳ AND
↳ QDP
↳ DependencyGraphProof
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
NTHTAIL(n, l) → COND(ge(n, length(l)), n, l)
The TRS R consists of the following rules:
length(nil) → 0
length(cons(x, l)) → s(length(l))
ge(u, 0) → true
ge(0, s(v)) → false
ge(s(u), s(v)) → ge(u, v)
The set Q consists of the following terms:
ge(x0, 0)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [13,14,18] contains 0 SCCs with 1 less node.
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDP
↳ UsableRulesProof
↳ QDP
↳ QReductionProof
↳ QDP
↳ Narrowing
↳ NonInfProof
↳ AND
↳ QDP
↳ QDP
↳ DependencyGraphProof
Q DP problem:
The TRS P consists of the following rules:
COND(false, n, l) → NTHTAIL(s(n), l)
The TRS R consists of the following rules:
length(nil) → 0
length(cons(x, l)) → s(length(l))
ge(u, 0) → true
ge(0, s(v)) → false
ge(s(u), s(v)) → ge(u, v)
The set Q consists of the following terms:
ge(x0, 0)
length(nil)
ge(0, s(x0))
ge(s(x0), s(x1))
length(cons(x0, x1))
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [13,14,18] contains 0 SCCs with 1 less node.