(0) Obligation:

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

times(x, y) → sum(generate(x, y))
generate(x, y) → gen(x, y, 0)
gen(x, y, z) → if(ge(z, x), x, y, z)
if(true, x, y, z) → nil
if(false, x, y, z) → cons(y, gen(x, y, s(z)))
sum(xs) → sum2(xs, 0)
sum2(xs, y) → ifsum(isNil(xs), isZero(head(xs)), xs, y)
ifsum(true, b, xs, y) → y
ifsum(false, b, xs, y) → ifsum2(b, xs, y)
ifsum2(true, xs, y) → sum2(tail(xs), y)
ifsum2(false, xs, y) → sum2(cons(p(head(xs)), tail(xs)), s(y))
isNil(nil) → true
isNil(cons(x, xs)) → false
tail(nil) → nil
tail(cons(x, xs)) → xs
head(cons(x, xs)) → x
head(nil) → error
isZero(0) → true
isZero(s(0)) → false
isZero(s(s(x))) → isZero(s(x))
p(0) → s(s(0))
p(s(0)) → 0
p(s(s(x))) → s(p(s(x)))
ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)
ac
ad

Q is empty.

(1) AAECC Innermost (EQUIVALENT transformation)

We have applied [NOC,AAECCNOC] to switch to innermost. The TRS R 1 is

generate(x, y) → gen(x, y, 0)
gen(x, y, z) → if(ge(z, x), x, y, z)
if(true, x, y, z) → nil
if(false, x, y, z) → cons(y, gen(x, y, s(z)))
ifsum(true, b, xs, y) → y
ifsum(false, b, xs, y) → ifsum2(b, xs, y)
ifsum2(true, xs, y) → sum2(tail(xs), y)
ifsum2(false, xs, y) → sum2(cons(p(head(xs)), tail(xs)), s(y))
isNil(nil) → true
isNil(cons(x, xs)) → false
tail(nil) → nil
tail(cons(x, xs)) → xs
head(cons(x, xs)) → x
head(nil) → error
isZero(0) → true
isZero(s(0)) → false
isZero(s(s(x))) → isZero(s(x))
p(0) → s(s(0))
p(s(0)) → 0
p(s(s(x))) → s(p(s(x)))
ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)
sum(xs) → sum2(xs, 0)
sum2(xs, y) → ifsum(isNil(xs), isZero(head(xs)), xs, y)
times(x, y) → sum(generate(x, y))

The TRS R 2 is

ac
ad

The signature Sigma is {c, a, d}

(2) Obligation:

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

times(x, y) → sum(generate(x, y))
generate(x, y) → gen(x, y, 0)
gen(x, y, z) → if(ge(z, x), x, y, z)
if(true, x, y, z) → nil
if(false, x, y, z) → cons(y, gen(x, y, s(z)))
sum(xs) → sum2(xs, 0)
sum2(xs, y) → ifsum(isNil(xs), isZero(head(xs)), xs, y)
ifsum(true, b, xs, y) → y
ifsum(false, b, xs, y) → ifsum2(b, xs, y)
ifsum2(true, xs, y) → sum2(tail(xs), y)
ifsum2(false, xs, y) → sum2(cons(p(head(xs)), tail(xs)), s(y))
isNil(nil) → true
isNil(cons(x, xs)) → false
tail(nil) → nil
tail(cons(x, xs)) → xs
head(cons(x, xs)) → x
head(nil) → error
isZero(0) → true
isZero(s(0)) → false
isZero(s(s(x))) → isZero(s(x))
p(0) → s(s(0))
p(s(0)) → 0
p(s(s(x))) → s(p(s(x)))
ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)
ac
ad

The set Q consists of the following terms:

times(x0, x1)
generate(x0, x1)
gen(x0, x1, x2)
if(true, x0, x1, x2)
if(false, x0, x1, x2)
sum(x0)
sum2(x0, x1)
ifsum(true, x0, x1, x2)
ifsum(false, x0, x1, x2)
ifsum2(true, x0, x1)
ifsum2(false, x0, x1)
isNil(nil)
isNil(cons(x0, x1))
tail(nil)
tail(cons(x0, x1))
head(cons(x0, x1))
head(nil)
isZero(0)
isZero(s(0))
isZero(s(s(x0)))
p(0)
p(s(0))
p(s(s(x0)))
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
a

(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:

TIMES(x, y) → SUM(generate(x, y))
TIMES(x, y) → GENERATE(x, y)
GENERATE(x, y) → GEN(x, y, 0)
GEN(x, y, z) → IF(ge(z, x), x, y, z)
GEN(x, y, z) → GE(z, x)
IF(false, x, y, z) → GEN(x, y, s(z))
SUM(xs) → SUM2(xs, 0)
SUM2(xs, y) → IFSUM(isNil(xs), isZero(head(xs)), xs, y)
SUM2(xs, y) → ISNIL(xs)
SUM2(xs, y) → ISZERO(head(xs))
SUM2(xs, y) → HEAD(xs)
IFSUM(false, b, xs, y) → IFSUM2(b, xs, y)
IFSUM2(true, xs, y) → SUM2(tail(xs), y)
IFSUM2(true, xs, y) → TAIL(xs)
IFSUM2(false, xs, y) → SUM2(cons(p(head(xs)), tail(xs)), s(y))
IFSUM2(false, xs, y) → P(head(xs))
IFSUM2(false, xs, y) → HEAD(xs)
IFSUM2(false, xs, y) → TAIL(xs)
ISZERO(s(s(x))) → ISZERO(s(x))
P(s(s(x))) → P(s(x))
GE(s(x), s(y)) → GE(x, y)

The TRS R consists of the following rules:

times(x, y) → sum(generate(x, y))
generate(x, y) → gen(x, y, 0)
gen(x, y, z) → if(ge(z, x), x, y, z)
if(true, x, y, z) → nil
if(false, x, y, z) → cons(y, gen(x, y, s(z)))
sum(xs) → sum2(xs, 0)
sum2(xs, y) → ifsum(isNil(xs), isZero(head(xs)), xs, y)
ifsum(true, b, xs, y) → y
ifsum(false, b, xs, y) → ifsum2(b, xs, y)
ifsum2(true, xs, y) → sum2(tail(xs), y)
ifsum2(false, xs, y) → sum2(cons(p(head(xs)), tail(xs)), s(y))
isNil(nil) → true
isNil(cons(x, xs)) → false
tail(nil) → nil
tail(cons(x, xs)) → xs
head(cons(x, xs)) → x
head(nil) → error
isZero(0) → true
isZero(s(0)) → false
isZero(s(s(x))) → isZero(s(x))
p(0) → s(s(0))
p(s(0)) → 0
p(s(s(x))) → s(p(s(x)))
ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)
ac
ad

The set Q consists of the following terms:

times(x0, x1)
generate(x0, x1)
gen(x0, x1, x2)
if(true, x0, x1, x2)
if(false, x0, x1, x2)
sum(x0)
sum2(x0, x1)
ifsum(true, x0, x1, x2)
ifsum(false, x0, x1, x2)
ifsum2(true, x0, x1)
ifsum2(false, x0, x1)
isNil(nil)
isNil(cons(x0, x1))
tail(nil)
tail(cons(x0, x1))
head(cons(x0, x1))
head(nil)
isZero(0)
isZero(s(0))
isZero(s(s(x0)))
p(0)
p(s(0))
p(s(s(x0)))
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
a

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

(5) DependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) 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:

times(x, y) → sum(generate(x, y))
generate(x, y) → gen(x, y, 0)
gen(x, y, z) → if(ge(z, x), x, y, z)
if(true, x, y, z) → nil
if(false, x, y, z) → cons(y, gen(x, y, s(z)))
sum(xs) → sum2(xs, 0)
sum2(xs, y) → ifsum(isNil(xs), isZero(head(xs)), xs, y)
ifsum(true, b, xs, y) → y
ifsum(false, b, xs, y) → ifsum2(b, xs, y)
ifsum2(true, xs, y) → sum2(tail(xs), y)
ifsum2(false, xs, y) → sum2(cons(p(head(xs)), tail(xs)), s(y))
isNil(nil) → true
isNil(cons(x, xs)) → false
tail(nil) → nil
tail(cons(x, xs)) → xs
head(cons(x, xs)) → x
head(nil) → error
isZero(0) → true
isZero(s(0)) → false
isZero(s(s(x))) → isZero(s(x))
p(0) → s(s(0))
p(s(0)) → 0
p(s(s(x))) → s(p(s(x)))
ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)
ac
ad

The set Q consists of the following terms:

times(x0, x1)
generate(x0, x1)
gen(x0, x1, x2)
if(true, x0, x1, x2)
if(false, x0, x1, x2)
sum(x0)
sum2(x0, x1)
ifsum(true, x0, x1, x2)
ifsum(false, x0, x1, x2)
ifsum2(true, x0, x1)
ifsum2(false, x0, x1)
isNil(nil)
isNil(cons(x0, x1))
tail(nil)
tail(cons(x0, x1))
head(cons(x0, x1))
head(nil)
isZero(0)
isZero(s(0))
isZero(s(s(x0)))
p(0)
p(s(0))
p(s(s(x0)))
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
a

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

(8) Obligation:

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

P(s(s(x))) → P(s(x))

The TRS R consists of the following rules:

times(x, y) → sum(generate(x, y))
generate(x, y) → gen(x, y, 0)
gen(x, y, z) → if(ge(z, x), x, y, z)
if(true, x, y, z) → nil
if(false, x, y, z) → cons(y, gen(x, y, s(z)))
sum(xs) → sum2(xs, 0)
sum2(xs, y) → ifsum(isNil(xs), isZero(head(xs)), xs, y)
ifsum(true, b, xs, y) → y
ifsum(false, b, xs, y) → ifsum2(b, xs, y)
ifsum2(true, xs, y) → sum2(tail(xs), y)
ifsum2(false, xs, y) → sum2(cons(p(head(xs)), tail(xs)), s(y))
isNil(nil) → true
isNil(cons(x, xs)) → false
tail(nil) → nil
tail(cons(x, xs)) → xs
head(cons(x, xs)) → x
head(nil) → error
isZero(0) → true
isZero(s(0)) → false
isZero(s(s(x))) → isZero(s(x))
p(0) → s(s(0))
p(s(0)) → 0
p(s(s(x))) → s(p(s(x)))
ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)
ac
ad

The set Q consists of the following terms:

times(x0, x1)
generate(x0, x1)
gen(x0, x1, x2)
if(true, x0, x1, x2)
if(false, x0, x1, x2)
sum(x0)
sum2(x0, x1)
ifsum(true, x0, x1, x2)
ifsum(false, x0, x1, x2)
ifsum2(true, x0, x1)
ifsum2(false, x0, x1)
isNil(nil)
isNil(cons(x0, x1))
tail(nil)
tail(cons(x0, x1))
head(cons(x0, x1))
head(nil)
isZero(0)
isZero(s(0))
isZero(s(s(x0)))
p(0)
p(s(0))
p(s(s(x0)))
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
a

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

(9) Obligation:

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

ISZERO(s(s(x))) → ISZERO(s(x))

The TRS R consists of the following rules:

times(x, y) → sum(generate(x, y))
generate(x, y) → gen(x, y, 0)
gen(x, y, z) → if(ge(z, x), x, y, z)
if(true, x, y, z) → nil
if(false, x, y, z) → cons(y, gen(x, y, s(z)))
sum(xs) → sum2(xs, 0)
sum2(xs, y) → ifsum(isNil(xs), isZero(head(xs)), xs, y)
ifsum(true, b, xs, y) → y
ifsum(false, b, xs, y) → ifsum2(b, xs, y)
ifsum2(true, xs, y) → sum2(tail(xs), y)
ifsum2(false, xs, y) → sum2(cons(p(head(xs)), tail(xs)), s(y))
isNil(nil) → true
isNil(cons(x, xs)) → false
tail(nil) → nil
tail(cons(x, xs)) → xs
head(cons(x, xs)) → x
head(nil) → error
isZero(0) → true
isZero(s(0)) → false
isZero(s(s(x))) → isZero(s(x))
p(0) → s(s(0))
p(s(0)) → 0
p(s(s(x))) → s(p(s(x)))
ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)
ac
ad

The set Q consists of the following terms:

times(x0, x1)
generate(x0, x1)
gen(x0, x1, x2)
if(true, x0, x1, x2)
if(false, x0, x1, x2)
sum(x0)
sum2(x0, x1)
ifsum(true, x0, x1, x2)
ifsum(false, x0, x1, x2)
ifsum2(true, x0, x1)
ifsum2(false, x0, x1)
isNil(nil)
isNil(cons(x0, x1))
tail(nil)
tail(cons(x0, x1))
head(cons(x0, x1))
head(nil)
isZero(0)
isZero(s(0))
isZero(s(s(x0)))
p(0)
p(s(0))
p(s(s(x0)))
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
a

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

(10) Obligation:

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

IFSUM(false, b, xs, y) → IFSUM2(b, xs, y)
IFSUM2(true, xs, y) → SUM2(tail(xs), y)
SUM2(xs, y) → IFSUM(isNil(xs), isZero(head(xs)), xs, y)
IFSUM2(false, xs, y) → SUM2(cons(p(head(xs)), tail(xs)), s(y))

The TRS R consists of the following rules:

times(x, y) → sum(generate(x, y))
generate(x, y) → gen(x, y, 0)
gen(x, y, z) → if(ge(z, x), x, y, z)
if(true, x, y, z) → nil
if(false, x, y, z) → cons(y, gen(x, y, s(z)))
sum(xs) → sum2(xs, 0)
sum2(xs, y) → ifsum(isNil(xs), isZero(head(xs)), xs, y)
ifsum(true, b, xs, y) → y
ifsum(false, b, xs, y) → ifsum2(b, xs, y)
ifsum2(true, xs, y) → sum2(tail(xs), y)
ifsum2(false, xs, y) → sum2(cons(p(head(xs)), tail(xs)), s(y))
isNil(nil) → true
isNil(cons(x, xs)) → false
tail(nil) → nil
tail(cons(x, xs)) → xs
head(cons(x, xs)) → x
head(nil) → error
isZero(0) → true
isZero(s(0)) → false
isZero(s(s(x))) → isZero(s(x))
p(0) → s(s(0))
p(s(0)) → 0
p(s(s(x))) → s(p(s(x)))
ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)
ac
ad

The set Q consists of the following terms:

times(x0, x1)
generate(x0, x1)
gen(x0, x1, x2)
if(true, x0, x1, x2)
if(false, x0, x1, x2)
sum(x0)
sum2(x0, x1)
ifsum(true, x0, x1, x2)
ifsum(false, x0, x1, x2)
ifsum2(true, x0, x1)
ifsum2(false, x0, x1)
isNil(nil)
isNil(cons(x0, x1))
tail(nil)
tail(cons(x0, x1))
head(cons(x0, x1))
head(nil)
isZero(0)
isZero(s(0))
isZero(s(s(x0)))
p(0)
p(s(0))
p(s(s(x0)))
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
a

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

(11) Obligation:

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

IF(false, x, y, z) → GEN(x, y, s(z))
GEN(x, y, z) → IF(ge(z, x), x, y, z)

The TRS R consists of the following rules:

times(x, y) → sum(generate(x, y))
generate(x, y) → gen(x, y, 0)
gen(x, y, z) → if(ge(z, x), x, y, z)
if(true, x, y, z) → nil
if(false, x, y, z) → cons(y, gen(x, y, s(z)))
sum(xs) → sum2(xs, 0)
sum2(xs, y) → ifsum(isNil(xs), isZero(head(xs)), xs, y)
ifsum(true, b, xs, y) → y
ifsum(false, b, xs, y) → ifsum2(b, xs, y)
ifsum2(true, xs, y) → sum2(tail(xs), y)
ifsum2(false, xs, y) → sum2(cons(p(head(xs)), tail(xs)), s(y))
isNil(nil) → true
isNil(cons(x, xs)) → false
tail(nil) → nil
tail(cons(x, xs)) → xs
head(cons(x, xs)) → x
head(nil) → error
isZero(0) → true
isZero(s(0)) → false
isZero(s(s(x))) → isZero(s(x))
p(0) → s(s(0))
p(s(0)) → 0
p(s(s(x))) → s(p(s(x)))
ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)
ac
ad

The set Q consists of the following terms:

times(x0, x1)
generate(x0, x1)
gen(x0, x1, x2)
if(true, x0, x1, x2)
if(false, x0, x1, x2)
sum(x0)
sum2(x0, x1)
ifsum(true, x0, x1, x2)
ifsum(false, x0, x1, x2)
ifsum2(true, x0, x1)
ifsum2(false, x0, x1)
isNil(nil)
isNil(cons(x0, x1))
tail(nil)
tail(cons(x0, x1))
head(cons(x0, x1))
head(nil)
isZero(0)
isZero(s(0))
isZero(s(s(x0)))
p(0)
p(s(0))
p(s(s(x0)))
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
a

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