(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) 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.
(9) 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.
(10) 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.