(0) Obligation:

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

car(cons(x, l)) → x
cddr(nil) → nil
cddr(cons(x, nil)) → nil
cddr(cons(x, cons(y, l))) → l
cadr(cons(x, cons(y, l))) → y
isZero(0) → true
isZero(s(x)) → false
plus(x, y) → ifplus(isZero(x), x, y)
ifplus(true, x, y) → y
ifplus(false, x, y) → s(plus(p(x), y))
times(x, y) → iftimes(isZero(x), x, y)
iftimes(true, x, y) → 0
iftimes(false, x, y) → plus(y, times(p(x), y))
p(s(x)) → x
p(0) → 0
shorter(nil, y) → true
shorter(cons(x, l), 0) → false
shorter(cons(x, l), s(y)) → shorter(l, y)
prod(l) → if(shorter(l, 0), shorter(l, s(0)), l)
if(true, b, l) → s(0)
if(false, b, l) → if2(b, l)
if2(true, l) → car(l)
if2(false, l) → prod(cons(times(car(l), cadr(l)), cddr(l)))

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:

car(cons(x, l)) → x
cddr(nil) → nil
cddr(cons(x, nil)) → nil
cddr(cons(x, cons(y, l))) → l
cadr(cons(x, cons(y, l))) → y
isZero(0) → true
isZero(s(x)) → false
plus(x, y) → ifplus(isZero(x), x, y)
ifplus(true, x, y) → y
ifplus(false, x, y) → s(plus(p(x), y))
times(x, y) → iftimes(isZero(x), x, y)
iftimes(true, x, y) → 0
iftimes(false, x, y) → plus(y, times(p(x), y))
p(s(x)) → x
p(0) → 0
shorter(nil, y) → true
shorter(cons(x, l), 0) → false
shorter(cons(x, l), s(y)) → shorter(l, y)
prod(l) → if(shorter(l, 0), shorter(l, s(0)), l)
if(true, b, l) → s(0)
if(false, b, l) → if2(b, l)
if2(true, l) → car(l)
if2(false, l) → prod(cons(times(car(l), cadr(l)), cddr(l)))

The set Q consists of the following terms:

car(cons(x0, x1))
cddr(nil)
cddr(cons(x0, nil))
cddr(cons(x0, cons(x1, x2)))
cadr(cons(x0, cons(x1, x2)))
isZero(0)
isZero(s(x0))
plus(x0, x1)
ifplus(true, x0, x1)
ifplus(false, x0, x1)
times(x0, x1)
iftimes(true, x0, x1)
iftimes(false, x0, x1)
p(s(x0))
p(0)
shorter(nil, x0)
shorter(cons(x0, x1), 0)
shorter(cons(x0, x1), s(x2))
prod(x0)
if(true, x0, x1)
if(false, x0, x1)
if2(true, x0)
if2(false, x0)

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

PLUS(x, y) → IFPLUS(isZero(x), x, y)
PLUS(x, y) → ISZERO(x)
IFPLUS(false, x, y) → PLUS(p(x), y)
IFPLUS(false, x, y) → P(x)
TIMES(x, y) → IFTIMES(isZero(x), x, y)
TIMES(x, y) → ISZERO(x)
IFTIMES(false, x, y) → PLUS(y, times(p(x), y))
IFTIMES(false, x, y) → TIMES(p(x), y)
IFTIMES(false, x, y) → P(x)
SHORTER(cons(x, l), s(y)) → SHORTER(l, y)
PROD(l) → IF(shorter(l, 0), shorter(l, s(0)), l)
PROD(l) → SHORTER(l, 0)
PROD(l) → SHORTER(l, s(0))
IF(false, b, l) → IF2(b, l)
IF2(true, l) → CAR(l)
IF2(false, l) → PROD(cons(times(car(l), cadr(l)), cddr(l)))
IF2(false, l) → TIMES(car(l), cadr(l))
IF2(false, l) → CAR(l)
IF2(false, l) → CADR(l)
IF2(false, l) → CDDR(l)

The TRS R consists of the following rules:

car(cons(x, l)) → x
cddr(nil) → nil
cddr(cons(x, nil)) → nil
cddr(cons(x, cons(y, l))) → l
cadr(cons(x, cons(y, l))) → y
isZero(0) → true
isZero(s(x)) → false
plus(x, y) → ifplus(isZero(x), x, y)
ifplus(true, x, y) → y
ifplus(false, x, y) → s(plus(p(x), y))
times(x, y) → iftimes(isZero(x), x, y)
iftimes(true, x, y) → 0
iftimes(false, x, y) → plus(y, times(p(x), y))
p(s(x)) → x
p(0) → 0
shorter(nil, y) → true
shorter(cons(x, l), 0) → false
shorter(cons(x, l), s(y)) → shorter(l, y)
prod(l) → if(shorter(l, 0), shorter(l, s(0)), l)
if(true, b, l) → s(0)
if(false, b, l) → if2(b, l)
if2(true, l) → car(l)
if2(false, l) → prod(cons(times(car(l), cadr(l)), cddr(l)))

The set Q consists of the following terms:

car(cons(x0, x1))
cddr(nil)
cddr(cons(x0, nil))
cddr(cons(x0, cons(x1, x2)))
cadr(cons(x0, cons(x1, x2)))
isZero(0)
isZero(s(x0))
plus(x0, x1)
ifplus(true, x0, x1)
ifplus(false, x0, x1)
times(x0, x1)
iftimes(true, x0, x1)
iftimes(false, x0, x1)
p(s(x0))
p(0)
shorter(nil, x0)
shorter(cons(x0, x1), 0)
shorter(cons(x0, x1), s(x2))
prod(x0)
if(true, x0, x1)
if(false, x0, x1)
if2(true, x0)
if2(false, x0)

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 12 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

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

SHORTER(cons(x, l), s(y)) → SHORTER(l, y)

The TRS R consists of the following rules:

car(cons(x, l)) → x
cddr(nil) → nil
cddr(cons(x, nil)) → nil
cddr(cons(x, cons(y, l))) → l
cadr(cons(x, cons(y, l))) → y
isZero(0) → true
isZero(s(x)) → false
plus(x, y) → ifplus(isZero(x), x, y)
ifplus(true, x, y) → y
ifplus(false, x, y) → s(plus(p(x), y))
times(x, y) → iftimes(isZero(x), x, y)
iftimes(true, x, y) → 0
iftimes(false, x, y) → plus(y, times(p(x), y))
p(s(x)) → x
p(0) → 0
shorter(nil, y) → true
shorter(cons(x, l), 0) → false
shorter(cons(x, l), s(y)) → shorter(l, y)
prod(l) → if(shorter(l, 0), shorter(l, s(0)), l)
if(true, b, l) → s(0)
if(false, b, l) → if2(b, l)
if2(true, l) → car(l)
if2(false, l) → prod(cons(times(car(l), cadr(l)), cddr(l)))

The set Q consists of the following terms:

car(cons(x0, x1))
cddr(nil)
cddr(cons(x0, nil))
cddr(cons(x0, cons(x1, x2)))
cadr(cons(x0, cons(x1, x2)))
isZero(0)
isZero(s(x0))
plus(x0, x1)
ifplus(true, x0, x1)
ifplus(false, x0, x1)
times(x0, x1)
iftimes(true, x0, x1)
iftimes(false, x0, x1)
p(s(x0))
p(0)
shorter(nil, x0)
shorter(cons(x0, x1), 0)
shorter(cons(x0, x1), s(x2))
prod(x0)
if(true, x0, x1)
if(false, x0, x1)
if2(true, x0)
if2(false, x0)

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

(8) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


SHORTER(cons(x, l), s(y)) → SHORTER(l, y)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
SHORTER(x1, x2)  =  SHORTER(x1)
cons(x1, x2)  =  cons(x1, x2)
s(x1)  =  s(x1)

Lexicographic path order with status [LPO].
Precedence:
cons2 > SHORTER1
s1 > SHORTER1

Status:
cons2: [1,2]
SHORTER1: [1]
s1: [1]

The following usable rules [FROCOS05] were oriented: none

(9) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

car(cons(x, l)) → x
cddr(nil) → nil
cddr(cons(x, nil)) → nil
cddr(cons(x, cons(y, l))) → l
cadr(cons(x, cons(y, l))) → y
isZero(0) → true
isZero(s(x)) → false
plus(x, y) → ifplus(isZero(x), x, y)
ifplus(true, x, y) → y
ifplus(false, x, y) → s(plus(p(x), y))
times(x, y) → iftimes(isZero(x), x, y)
iftimes(true, x, y) → 0
iftimes(false, x, y) → plus(y, times(p(x), y))
p(s(x)) → x
p(0) → 0
shorter(nil, y) → true
shorter(cons(x, l), 0) → false
shorter(cons(x, l), s(y)) → shorter(l, y)
prod(l) → if(shorter(l, 0), shorter(l, s(0)), l)
if(true, b, l) → s(0)
if(false, b, l) → if2(b, l)
if2(true, l) → car(l)
if2(false, l) → prod(cons(times(car(l), cadr(l)), cddr(l)))

The set Q consists of the following terms:

car(cons(x0, x1))
cddr(nil)
cddr(cons(x0, nil))
cddr(cons(x0, cons(x1, x2)))
cadr(cons(x0, cons(x1, x2)))
isZero(0)
isZero(s(x0))
plus(x0, x1)
ifplus(true, x0, x1)
ifplus(false, x0, x1)
times(x0, x1)
iftimes(true, x0, x1)
iftimes(false, x0, x1)
p(s(x0))
p(0)
shorter(nil, x0)
shorter(cons(x0, x1), 0)
shorter(cons(x0, x1), s(x2))
prod(x0)
if(true, x0, x1)
if(false, x0, x1)
if2(true, x0)
if2(false, x0)

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

(10) PisEmptyProof (EQUIVALENT transformation)

The TRS P is empty. Hence, there is no (P,Q,R) chain.

(11) TRUE

(12) Obligation:

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

IFPLUS(false, x, y) → PLUS(p(x), y)
PLUS(x, y) → IFPLUS(isZero(x), x, y)

The TRS R consists of the following rules:

car(cons(x, l)) → x
cddr(nil) → nil
cddr(cons(x, nil)) → nil
cddr(cons(x, cons(y, l))) → l
cadr(cons(x, cons(y, l))) → y
isZero(0) → true
isZero(s(x)) → false
plus(x, y) → ifplus(isZero(x), x, y)
ifplus(true, x, y) → y
ifplus(false, x, y) → s(plus(p(x), y))
times(x, y) → iftimes(isZero(x), x, y)
iftimes(true, x, y) → 0
iftimes(false, x, y) → plus(y, times(p(x), y))
p(s(x)) → x
p(0) → 0
shorter(nil, y) → true
shorter(cons(x, l), 0) → false
shorter(cons(x, l), s(y)) → shorter(l, y)
prod(l) → if(shorter(l, 0), shorter(l, s(0)), l)
if(true, b, l) → s(0)
if(false, b, l) → if2(b, l)
if2(true, l) → car(l)
if2(false, l) → prod(cons(times(car(l), cadr(l)), cddr(l)))

The set Q consists of the following terms:

car(cons(x0, x1))
cddr(nil)
cddr(cons(x0, nil))
cddr(cons(x0, cons(x1, x2)))
cadr(cons(x0, cons(x1, x2)))
isZero(0)
isZero(s(x0))
plus(x0, x1)
ifplus(true, x0, x1)
ifplus(false, x0, x1)
times(x0, x1)
iftimes(true, x0, x1)
iftimes(false, x0, x1)
p(s(x0))
p(0)
shorter(nil, x0)
shorter(cons(x0, x1), 0)
shorter(cons(x0, x1), s(x2))
prod(x0)
if(true, x0, x1)
if(false, x0, x1)
if2(true, x0)
if2(false, x0)

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

(13) Obligation:

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

IFTIMES(false, x, y) → TIMES(p(x), y)
TIMES(x, y) → IFTIMES(isZero(x), x, y)

The TRS R consists of the following rules:

car(cons(x, l)) → x
cddr(nil) → nil
cddr(cons(x, nil)) → nil
cddr(cons(x, cons(y, l))) → l
cadr(cons(x, cons(y, l))) → y
isZero(0) → true
isZero(s(x)) → false
plus(x, y) → ifplus(isZero(x), x, y)
ifplus(true, x, y) → y
ifplus(false, x, y) → s(plus(p(x), y))
times(x, y) → iftimes(isZero(x), x, y)
iftimes(true, x, y) → 0
iftimes(false, x, y) → plus(y, times(p(x), y))
p(s(x)) → x
p(0) → 0
shorter(nil, y) → true
shorter(cons(x, l), 0) → false
shorter(cons(x, l), s(y)) → shorter(l, y)
prod(l) → if(shorter(l, 0), shorter(l, s(0)), l)
if(true, b, l) → s(0)
if(false, b, l) → if2(b, l)
if2(true, l) → car(l)
if2(false, l) → prod(cons(times(car(l), cadr(l)), cddr(l)))

The set Q consists of the following terms:

car(cons(x0, x1))
cddr(nil)
cddr(cons(x0, nil))
cddr(cons(x0, cons(x1, x2)))
cadr(cons(x0, cons(x1, x2)))
isZero(0)
isZero(s(x0))
plus(x0, x1)
ifplus(true, x0, x1)
ifplus(false, x0, x1)
times(x0, x1)
iftimes(true, x0, x1)
iftimes(false, x0, x1)
p(s(x0))
p(0)
shorter(nil, x0)
shorter(cons(x0, x1), 0)
shorter(cons(x0, x1), s(x2))
prod(x0)
if(true, x0, x1)
if(false, x0, x1)
if2(true, x0)
if2(false, x0)

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

(14) Obligation:

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

IF2(false, l) → PROD(cons(times(car(l), cadr(l)), cddr(l)))
PROD(l) → IF(shorter(l, 0), shorter(l, s(0)), l)
IF(false, b, l) → IF2(b, l)

The TRS R consists of the following rules:

car(cons(x, l)) → x
cddr(nil) → nil
cddr(cons(x, nil)) → nil
cddr(cons(x, cons(y, l))) → l
cadr(cons(x, cons(y, l))) → y
isZero(0) → true
isZero(s(x)) → false
plus(x, y) → ifplus(isZero(x), x, y)
ifplus(true, x, y) → y
ifplus(false, x, y) → s(plus(p(x), y))
times(x, y) → iftimes(isZero(x), x, y)
iftimes(true, x, y) → 0
iftimes(false, x, y) → plus(y, times(p(x), y))
p(s(x)) → x
p(0) → 0
shorter(nil, y) → true
shorter(cons(x, l), 0) → false
shorter(cons(x, l), s(y)) → shorter(l, y)
prod(l) → if(shorter(l, 0), shorter(l, s(0)), l)
if(true, b, l) → s(0)
if(false, b, l) → if2(b, l)
if2(true, l) → car(l)
if2(false, l) → prod(cons(times(car(l), cadr(l)), cddr(l)))

The set Q consists of the following terms:

car(cons(x0, x1))
cddr(nil)
cddr(cons(x0, nil))
cddr(cons(x0, cons(x1, x2)))
cadr(cons(x0, cons(x1, x2)))
isZero(0)
isZero(s(x0))
plus(x0, x1)
ifplus(true, x0, x1)
ifplus(false, x0, x1)
times(x0, x1)
iftimes(true, x0, x1)
iftimes(false, x0, x1)
p(s(x0))
p(0)
shorter(nil, x0)
shorter(cons(x0, x1), 0)
shorter(cons(x0, x1), s(x2))
prod(x0)
if(true, x0, x1)
if(false, x0, x1)
if2(true, x0)
if2(false, x0)

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