(0) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)
rev(x) → if(x, eq(0, length(x)), nil, 0, length(x))
if(x, true, z, c, l) → z
if(x, false, z, c, l) → help(s(c), l, x, z)
help(c, l, cons(x, y), z) → if(append(y, cons(x, nil)), ge(c, l), cons(x, z), c, l)
append(nil, y) → y
append(cons(x, y), z) → cons(x, append(y, z))
length(nil) → 0
length(cons(x, y)) → s(length(y))

Q is empty.

(1) Overlay + Local Confluence (EQUIVALENT transformation)

The TRS is overlay and locally confluent. By [NOC] we can switch to innermost.

(2) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)
rev(x) → if(x, eq(0, length(x)), nil, 0, length(x))
if(x, true, z, c, l) → z
if(x, false, z, c, l) → help(s(c), l, x, z)
help(c, l, cons(x, y), z) → if(append(y, cons(x, nil)), ge(c, l), cons(x, z), c, l)
append(nil, y) → y
append(cons(x, y), z) → cons(x, append(y, z))
length(nil) → 0
length(cons(x, y)) → s(length(y))

The set Q consists of the following terms:

ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
rev(x0)
if(x0, true, x1, x2, x3)
if(x0, false, x1, x2, x3)
help(x0, x1, cons(x2, x3), x4)
append(nil, x0)
append(cons(x0, x1), x2)
length(nil)
length(cons(x0, x1))

(3) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem.

(4) Obligation:

Q DP problem:
The TRS P consists of the following rules:

GE(s(x), s(y)) → GE(x, y)
REV(x) → IF(x, eq(0, length(x)), nil, 0, length(x))
REV(x) → LENGTH(x)
IF(x, false, z, c, l) → HELP(s(c), l, x, z)
HELP(c, l, cons(x, y), z) → IF(append(y, cons(x, nil)), ge(c, l), cons(x, z), c, l)
HELP(c, l, cons(x, y), z) → APPEND(y, cons(x, nil))
HELP(c, l, cons(x, y), z) → GE(c, l)
APPEND(cons(x, y), z) → APPEND(y, z)
LENGTH(cons(x, y)) → LENGTH(y)

The TRS R consists of the following rules:

ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)
rev(x) → if(x, eq(0, length(x)), nil, 0, length(x))
if(x, true, z, c, l) → z
if(x, false, z, c, l) → help(s(c), l, x, z)
help(c, l, cons(x, y), z) → if(append(y, cons(x, nil)), ge(c, l), cons(x, z), c, l)
append(nil, y) → y
append(cons(x, y), z) → cons(x, append(y, z))
length(nil) → 0
length(cons(x, y)) → s(length(y))

The set Q consists of the following terms:

ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
rev(x0)
if(x0, true, x1, x2, x3)
if(x0, false, x1, x2, x3)
help(x0, x1, cons(x2, x3), x4)
append(nil, x0)
append(cons(x0, x1), x2)
length(nil)
length(cons(x0, x1))

We have to consider all minimal (P,Q,R)-chains.

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 4 SCCs with 4 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

Q DP problem:
The TRS P consists of the following rules:

LENGTH(cons(x, y)) → LENGTH(y)

The TRS R consists of the following rules:

ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)
rev(x) → if(x, eq(0, length(x)), nil, 0, length(x))
if(x, true, z, c, l) → z
if(x, false, z, c, l) → help(s(c), l, x, z)
help(c, l, cons(x, y), z) → if(append(y, cons(x, nil)), ge(c, l), cons(x, z), c, l)
append(nil, y) → y
append(cons(x, y), z) → cons(x, append(y, z))
length(nil) → 0
length(cons(x, y)) → s(length(y))

The set Q consists of the following terms:

ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
rev(x0)
if(x0, true, x1, x2, x3)
if(x0, false, x1, x2, x3)
help(x0, x1, cons(x2, x3), x4)
append(nil, x0)
append(cons(x0, x1), x2)
length(nil)
length(cons(x0, x1))

We have to consider all minimal (P,Q,R)-chains.

(8) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(9) Obligation:

Q DP problem:
The TRS P consists of the following rules:

LENGTH(cons(x, y)) → LENGTH(y)

R is empty.
The set Q consists of the following terms:

ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
rev(x0)
if(x0, true, x1, x2, x3)
if(x0, false, x1, x2, x3)
help(x0, x1, cons(x2, x3), x4)
append(nil, x0)
append(cons(x0, x1), x2)
length(nil)
length(cons(x0, x1))

We have to consider all minimal (P,Q,R)-chains.

(10) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
rev(x0)
if(x0, true, x1, x2, x3)
if(x0, false, x1, x2, x3)
help(x0, x1, cons(x2, x3), x4)
append(nil, x0)
append(cons(x0, x1), x2)
length(nil)
length(cons(x0, x1))

(11) Obligation:

Q DP problem:
The TRS P consists of the following rules:

LENGTH(cons(x, y)) → LENGTH(y)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(12) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] 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, y)) → LENGTH(y)
    The graph contains the following edges 1 > 1

(13) TRUE

(14) Obligation:

Q DP problem:
The TRS P consists of the following rules:

APPEND(cons(x, y), z) → APPEND(y, z)

The TRS R consists of the following rules:

ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)
rev(x) → if(x, eq(0, length(x)), nil, 0, length(x))
if(x, true, z, c, l) → z
if(x, false, z, c, l) → help(s(c), l, x, z)
help(c, l, cons(x, y), z) → if(append(y, cons(x, nil)), ge(c, l), cons(x, z), c, l)
append(nil, y) → y
append(cons(x, y), z) → cons(x, append(y, z))
length(nil) → 0
length(cons(x, y)) → s(length(y))

The set Q consists of the following terms:

ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
rev(x0)
if(x0, true, x1, x2, x3)
if(x0, false, x1, x2, x3)
help(x0, x1, cons(x2, x3), x4)
append(nil, x0)
append(cons(x0, x1), x2)
length(nil)
length(cons(x0, x1))

We have to consider all minimal (P,Q,R)-chains.

(15) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(16) Obligation:

Q DP problem:
The TRS P consists of the following rules:

APPEND(cons(x, y), z) → APPEND(y, z)

R is empty.
The set Q consists of the following terms:

ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
rev(x0)
if(x0, true, x1, x2, x3)
if(x0, false, x1, x2, x3)
help(x0, x1, cons(x2, x3), x4)
append(nil, x0)
append(cons(x0, x1), x2)
length(nil)
length(cons(x0, x1))

We have to consider all minimal (P,Q,R)-chains.

(17) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
rev(x0)
if(x0, true, x1, x2, x3)
if(x0, false, x1, x2, x3)
help(x0, x1, cons(x2, x3), x4)
append(nil, x0)
append(cons(x0, x1), x2)
length(nil)
length(cons(x0, x1))

(18) Obligation:

Q DP problem:
The TRS P consists of the following rules:

APPEND(cons(x, y), z) → APPEND(y, z)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(19) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] 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:

  • APPEND(cons(x, y), z) → APPEND(y, z)
    The graph contains the following edges 1 > 1, 2 >= 2

(20) TRUE

(21) Obligation:

Q DP problem:
The TRS P consists of the following rules:

GE(s(x), s(y)) → GE(x, y)

The TRS R consists of the following rules:

ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)
rev(x) → if(x, eq(0, length(x)), nil, 0, length(x))
if(x, true, z, c, l) → z
if(x, false, z, c, l) → help(s(c), l, x, z)
help(c, l, cons(x, y), z) → if(append(y, cons(x, nil)), ge(c, l), cons(x, z), c, l)
append(nil, y) → y
append(cons(x, y), z) → cons(x, append(y, z))
length(nil) → 0
length(cons(x, y)) → s(length(y))

The set Q consists of the following terms:

ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
rev(x0)
if(x0, true, x1, x2, x3)
if(x0, false, x1, x2, x3)
help(x0, x1, cons(x2, x3), x4)
append(nil, x0)
append(cons(x0, x1), x2)
length(nil)
length(cons(x0, x1))

We have to consider all minimal (P,Q,R)-chains.

(22) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(23) Obligation:

Q DP problem:
The TRS P consists of the following rules:

GE(s(x), s(y)) → GE(x, y)

R is empty.
The set Q consists of the following terms:

ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
rev(x0)
if(x0, true, x1, x2, x3)
if(x0, false, x1, x2, x3)
help(x0, x1, cons(x2, x3), x4)
append(nil, x0)
append(cons(x0, x1), x2)
length(nil)
length(cons(x0, x1))

We have to consider all minimal (P,Q,R)-chains.

(24) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
rev(x0)
if(x0, true, x1, x2, x3)
if(x0, false, x1, x2, x3)
help(x0, x1, cons(x2, x3), x4)
append(nil, x0)
append(cons(x0, x1), x2)
length(nil)
length(cons(x0, x1))

(25) Obligation:

Q DP problem:
The TRS P consists of the following rules:

GE(s(x), s(y)) → GE(x, y)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(26) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] 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(x), s(y)) → GE(x, y)
    The graph contains the following edges 1 > 1, 2 > 2

(27) TRUE

(28) Obligation:

Q DP problem:
The TRS P consists of the following rules:

HELP(c, l, cons(x, y), z) → IF(append(y, cons(x, nil)), ge(c, l), cons(x, z), c, l)
IF(x, false, z, c, l) → HELP(s(c), l, x, z)

The TRS R consists of the following rules:

ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)
rev(x) → if(x, eq(0, length(x)), nil, 0, length(x))
if(x, true, z, c, l) → z
if(x, false, z, c, l) → help(s(c), l, x, z)
help(c, l, cons(x, y), z) → if(append(y, cons(x, nil)), ge(c, l), cons(x, z), c, l)
append(nil, y) → y
append(cons(x, y), z) → cons(x, append(y, z))
length(nil) → 0
length(cons(x, y)) → s(length(y))

The set Q consists of the following terms:

ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
rev(x0)
if(x0, true, x1, x2, x3)
if(x0, false, x1, x2, x3)
help(x0, x1, cons(x2, x3), x4)
append(nil, x0)
append(cons(x0, x1), x2)
length(nil)
length(cons(x0, x1))

We have to consider all minimal (P,Q,R)-chains.

(29) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(30) Obligation:

Q DP problem:
The TRS P consists of the following rules:

HELP(c, l, cons(x, y), z) → IF(append(y, cons(x, nil)), ge(c, l), cons(x, z), c, l)
IF(x, false, z, c, l) → HELP(s(c), l, x, z)

The TRS R consists of the following rules:

append(nil, y) → y
append(cons(x, y), z) → cons(x, append(y, z))
ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)

The set Q consists of the following terms:

ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
rev(x0)
if(x0, true, x1, x2, x3)
if(x0, false, x1, x2, x3)
help(x0, x1, cons(x2, x3), x4)
append(nil, x0)
append(cons(x0, x1), x2)
length(nil)
length(cons(x0, x1))

We have to consider all minimal (P,Q,R)-chains.

(31) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

rev(x0)
if(x0, true, x1, x2, x3)
if(x0, false, x1, x2, x3)
help(x0, x1, cons(x2, x3), x4)
length(nil)
length(cons(x0, x1))

(32) Obligation:

Q DP problem:
The TRS P consists of the following rules:

HELP(c, l, cons(x, y), z) → IF(append(y, cons(x, nil)), ge(c, l), cons(x, z), c, l)
IF(x, false, z, c, l) → HELP(s(c), l, x, z)

The TRS R consists of the following rules:

append(nil, y) → y
append(cons(x, y), z) → cons(x, append(y, z))
ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)

The set Q consists of the following terms:

ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
append(nil, x0)
append(cons(x0, x1), x2)

We have to consider all minimal (P,Q,R)-chains.

(33) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule HELP(c, l, cons(x, y), z) → IF(append(y, cons(x, nil)), ge(c, l), cons(x, z), c, l) we obtained the following new rules [LPAR04]:

HELP(s(z2), z3, cons(x2, x3), z1) → IF(append(x3, cons(x2, nil)), ge(s(z2), z3), cons(x2, z1), s(z2), z3)

(34) Obligation:

Q DP problem:
The TRS P consists of the following rules:

IF(x, false, z, c, l) → HELP(s(c), l, x, z)
HELP(s(z2), z3, cons(x2, x3), z1) → IF(append(x3, cons(x2, nil)), ge(s(z2), z3), cons(x2, z1), s(z2), z3)

The TRS R consists of the following rules:

append(nil, y) → y
append(cons(x, y), z) → cons(x, append(y, z))
ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)

The set Q consists of the following terms:

ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
append(nil, x0)
append(cons(x0, x1), x2)

We have to consider all minimal (P,Q,R)-chains.

(35) NonInfProof (EQUIVALENT transformation)

The DP Problem is simplified using the Induction Calculus [NONINF] with the following steps:
Note that final constraints are written in bold face.


For Pair HELP(c, l, cons(x, y), z) → IF(append(y, cons(x, nil)), ge(c, l), cons(x, z), c, l) the following chains were created:
  • We consider the chain IF(x, false, z, c, l) → HELP(s(c), l, x, z), HELP(c, l, cons(x, y), z) → IF(append(y, cons(x, nil)), ge(c, l), cons(x, z), c, l) which results in the following constraint:

    (1)    (HELP(s(x7), x8, x5, x6)=HELP(x9, x10, cons(x11, x12), x13) ⇒ HELP(x9, x10, cons(x11, x12), x13)≥IF(append(x12, cons(x11, nil)), ge(x9, x10), cons(x11, x13), x9, x10))



    We simplified constraint (1) using rules (I), (II), (III) which results in the following new constraint:

    (2)    (HELP(s(x7), x8, cons(x11, x12), x6)≥IF(append(x12, cons(x11, nil)), ge(s(x7), x8), cons(x11, x6), s(x7), x8))







For Pair IF(x, false, z, c, l) → HELP(s(c), l, x, z) the following chains were created:
  • We consider the chain HELP(c, l, cons(x, y), z) → IF(append(y, cons(x, nil)), ge(c, l), cons(x, z), c, l), IF(x, false, z, c, l) → HELP(s(c), l, x, z) which results in the following constraint:

    (3)    (IF(append(x17, cons(x16, nil)), ge(x14, x15), cons(x16, x18), x14, x15)=IF(x19, false, x20, x21, x22) ⇒ IF(x19, false, x20, x21, x22)≥HELP(s(x21), x22, x19, x20))



    We simplified constraint (3) using rules (I), (II), (III), (VII) which results in the following new constraint:

    (4)    (cons(x16, nil)=x27append(x17, x27)=x19ge(x14, x15)=falseIF(x19, false, cons(x16, x18), x14, x15)≥HELP(s(x14), x15, x19, cons(x16, x18)))



    We simplified constraint (4) using rule (V) (with possible (I) afterwards) using induction on ge(x14, x15)=false which results in the following new constraints:

    (5)    (false=falsecons(x16, nil)=x27append(x17, x27)=x19IF(x19, false, cons(x16, x18), 0, s(x29))≥HELP(s(0), s(x29), x19, cons(x16, x18)))


    (6)    (ge(x31, x30)=falsecons(x16, nil)=x27append(x17, x27)=x19∧(∀x32,x33,x34,x35,x36:ge(x31, x30)=falsecons(x32, nil)=x33append(x34, x33)=x35IF(x35, false, cons(x32, x36), x31, x30)≥HELP(s(x31), x30, x35, cons(x32, x36))) ⇒ IF(x19, false, cons(x16, x18), s(x31), s(x30))≥HELP(s(s(x31)), s(x30), x19, cons(x16, x18)))



    We simplified constraint (5) using rules (I), (II), (III), (IV) which results in the following new constraint:

    (7)    (IF(x19, false, cons(x16, x18), 0, s(x29))≥HELP(s(0), s(x29), x19, cons(x16, x18)))



    We simplified constraint (6) using rule (VI) where we applied the induction hypothesis (∀x32,x33,x34,x35,x36:ge(x31, x30)=falsecons(x32, nil)=x33append(x34, x33)=x35IF(x35, false, cons(x32, x36), x31, x30)≥HELP(s(x31), x30, x35, cons(x32, x36))) with σ = [x32 / x16, x33 / x27, x34 / x17, x35 / x19, x36 / x18] which results in the following new constraint:

    (8)    (IF(x19, false, cons(x16, x18), x31, x30)≥HELP(s(x31), x30, x19, cons(x16, x18)) ⇒ IF(x19, false, cons(x16, x18), s(x31), s(x30))≥HELP(s(s(x31)), s(x30), x19, cons(x16, x18)))







To summarize, we get the following constraints P for the following pairs.
  • HELP(c, l, cons(x, y), z) → IF(append(y, cons(x, nil)), ge(c, l), cons(x, z), c, l)
    • (HELP(s(x7), x8, cons(x11, x12), x6)≥IF(append(x12, cons(x11, nil)), ge(s(x7), x8), cons(x11, x6), s(x7), x8))

  • IF(x, false, z, c, l) → HELP(s(c), l, x, z)
    • (IF(x19, false, cons(x16, x18), x31, x30)≥HELP(s(x31), x30, x19, cons(x16, x18)) ⇒ IF(x19, false, cons(x16, x18), s(x31), s(x30))≥HELP(s(s(x31)), s(x30), x19, cons(x16, x18)))
    • (IF(x19, false, cons(x16, x18), 0, s(x29))≥HELP(s(0), s(x29), x19, cons(x16, x18)))




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 [NONINF]:

POL(0) = 0   
POL(HELP(x1, x2, x3, x4)) = -1 - x1 + x2 - x3 + x4   
POL(IF(x1, x2, x3, x4, x5)) = -1 - x2 - x3 - x4 + x5   
POL(append(x1, x2)) = 0   
POL(c) = -2   
POL(cons(x1, x2)) = 0   
POL(false) = 0   
POL(ge(x1, x2)) = 0   
POL(nil) = 0   
POL(s(x1)) = 1 + x1   
POL(true) = 0   

The following pairs are in P>:

IF(x, false, z, c, l) → HELP(s(c), l, x, z)
The following pairs are in Pbound:

IF(x, false, z, c, l) → HELP(s(c), l, x, z)
The following rules are usable:

truege(x, 0)
falsege(0, s(y))
ge(x, y) → ge(s(x), s(y))

(36) Obligation:

Q DP problem:
The TRS P consists of the following rules:

HELP(c, l, cons(x, y), z) → IF(append(y, cons(x, nil)), ge(c, l), cons(x, z), c, l)

The TRS R consists of the following rules:

append(nil, y) → y
append(cons(x, y), z) → cons(x, append(y, z))
ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)

The set Q consists of the following terms:

ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
append(nil, x0)
append(cons(x0, x1), x2)

We have to consider all minimal (P,Q,R)-chains.

(37) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.

(38) TRUE