(0) Obligation:

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

active(fact(X)) → mark(if(zero(X), s(0), prod(X, fact(p(X)))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(prod(0, X)) → mark(0)
active(prod(s(X), Y)) → mark(add(Y, prod(X, Y)))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(zero(0)) → mark(true)
active(zero(s(X))) → mark(false)
active(p(s(X))) → mark(X)
mark(fact(X)) → active(fact(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(zero(X)) → active(zero(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(prod(X1, X2)) → active(prod(mark(X1), mark(X2)))
mark(p(X)) → active(p(mark(X)))
mark(add(X1, X2)) → active(add(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
fact(mark(X)) → fact(X)
fact(active(X)) → fact(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
zero(mark(X)) → zero(X)
zero(active(X)) → zero(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
prod(mark(X1), X2) → prod(X1, X2)
prod(X1, mark(X2)) → prod(X1, X2)
prod(active(X1), X2) → prod(X1, X2)
prod(X1, active(X2)) → prod(X1, X2)
p(mark(X)) → p(X)
p(active(X)) → p(X)
add(mark(X1), X2) → add(X1, X2)
add(X1, mark(X2)) → add(X1, X2)
add(active(X1), X2) → add(X1, X2)
add(X1, active(X2)) → add(X1, X2)

Q is empty.

(1) DependencyPairsProof (EQUIVALENT transformation)

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

(2) Obligation:

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

ACTIVE(fact(X)) → MARK(if(zero(X), s(0), prod(X, fact(p(X)))))
ACTIVE(fact(X)) → IF(zero(X), s(0), prod(X, fact(p(X))))
ACTIVE(fact(X)) → ZERO(X)
ACTIVE(fact(X)) → S(0)
ACTIVE(fact(X)) → PROD(X, fact(p(X)))
ACTIVE(fact(X)) → FACT(p(X))
ACTIVE(fact(X)) → P(X)
ACTIVE(add(0, X)) → MARK(X)
ACTIVE(add(s(X), Y)) → MARK(s(add(X, Y)))
ACTIVE(add(s(X), Y)) → S(add(X, Y))
ACTIVE(add(s(X), Y)) → ADD(X, Y)
ACTIVE(prod(0, X)) → MARK(0)
ACTIVE(prod(s(X), Y)) → MARK(add(Y, prod(X, Y)))
ACTIVE(prod(s(X), Y)) → ADD(Y, prod(X, Y))
ACTIVE(prod(s(X), Y)) → PROD(X, Y)
ACTIVE(if(true, X, Y)) → MARK(X)
ACTIVE(if(false, X, Y)) → MARK(Y)
ACTIVE(zero(0)) → MARK(true)
ACTIVE(zero(s(X))) → MARK(false)
ACTIVE(p(s(X))) → MARK(X)
MARK(fact(X)) → ACTIVE(fact(mark(X)))
MARK(fact(X)) → FACT(mark(X))
MARK(fact(X)) → MARK(X)
MARK(if(X1, X2, X3)) → ACTIVE(if(mark(X1), X2, X3))
MARK(if(X1, X2, X3)) → IF(mark(X1), X2, X3)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(zero(X)) → ACTIVE(zero(mark(X)))
MARK(zero(X)) → ZERO(mark(X))
MARK(zero(X)) → MARK(X)
MARK(s(X)) → ACTIVE(s(mark(X)))
MARK(s(X)) → S(mark(X))
MARK(s(X)) → MARK(X)
MARK(0) → ACTIVE(0)
MARK(prod(X1, X2)) → ACTIVE(prod(mark(X1), mark(X2)))
MARK(prod(X1, X2)) → PROD(mark(X1), mark(X2))
MARK(prod(X1, X2)) → MARK(X1)
MARK(prod(X1, X2)) → MARK(X2)
MARK(p(X)) → ACTIVE(p(mark(X)))
MARK(p(X)) → P(mark(X))
MARK(p(X)) → MARK(X)
MARK(add(X1, X2)) → ACTIVE(add(mark(X1), mark(X2)))
MARK(add(X1, X2)) → ADD(mark(X1), mark(X2))
MARK(add(X1, X2)) → MARK(X1)
MARK(add(X1, X2)) → MARK(X2)
MARK(true) → ACTIVE(true)
MARK(false) → ACTIVE(false)
FACT(mark(X)) → FACT(X)
FACT(active(X)) → FACT(X)
IF(mark(X1), X2, X3) → IF(X1, X2, X3)
IF(X1, mark(X2), X3) → IF(X1, X2, X3)
IF(X1, X2, mark(X3)) → IF(X1, X2, X3)
IF(active(X1), X2, X3) → IF(X1, X2, X3)
IF(X1, active(X2), X3) → IF(X1, X2, X3)
IF(X1, X2, active(X3)) → IF(X1, X2, X3)
ZERO(mark(X)) → ZERO(X)
ZERO(active(X)) → ZERO(X)
S(mark(X)) → S(X)
S(active(X)) → S(X)
PROD(mark(X1), X2) → PROD(X1, X2)
PROD(X1, mark(X2)) → PROD(X1, X2)
PROD(active(X1), X2) → PROD(X1, X2)
PROD(X1, active(X2)) → PROD(X1, X2)
P(mark(X)) → P(X)
P(active(X)) → P(X)
ADD(mark(X1), X2) → ADD(X1, X2)
ADD(X1, mark(X2)) → ADD(X1, X2)
ADD(active(X1), X2) → ADD(X1, X2)
ADD(X1, active(X2)) → ADD(X1, X2)

The TRS R consists of the following rules:

active(fact(X)) → mark(if(zero(X), s(0), prod(X, fact(p(X)))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(prod(0, X)) → mark(0)
active(prod(s(X), Y)) → mark(add(Y, prod(X, Y)))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(zero(0)) → mark(true)
active(zero(s(X))) → mark(false)
active(p(s(X))) → mark(X)
mark(fact(X)) → active(fact(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(zero(X)) → active(zero(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(prod(X1, X2)) → active(prod(mark(X1), mark(X2)))
mark(p(X)) → active(p(mark(X)))
mark(add(X1, X2)) → active(add(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
fact(mark(X)) → fact(X)
fact(active(X)) → fact(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
zero(mark(X)) → zero(X)
zero(active(X)) → zero(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
prod(mark(X1), X2) → prod(X1, X2)
prod(X1, mark(X2)) → prod(X1, X2)
prod(active(X1), X2) → prod(X1, X2)
prod(X1, active(X2)) → prod(X1, X2)
p(mark(X)) → p(X)
p(active(X)) → p(X)
add(mark(X1), X2) → add(X1, X2)
add(X1, mark(X2)) → add(X1, X2)
add(active(X1), X2) → add(X1, X2)
add(X1, active(X2)) → add(X1, X2)

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

(3) DependencyGraphProof (EQUIVALENT transformation)

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

(4) Complex Obligation (AND)

(5) Obligation:

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

ADD(X1, mark(X2)) → ADD(X1, X2)
ADD(mark(X1), X2) → ADD(X1, X2)
ADD(active(X1), X2) → ADD(X1, X2)
ADD(X1, active(X2)) → ADD(X1, X2)

The TRS R consists of the following rules:

active(fact(X)) → mark(if(zero(X), s(0), prod(X, fact(p(X)))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(prod(0, X)) → mark(0)
active(prod(s(X), Y)) → mark(add(Y, prod(X, Y)))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(zero(0)) → mark(true)
active(zero(s(X))) → mark(false)
active(p(s(X))) → mark(X)
mark(fact(X)) → active(fact(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(zero(X)) → active(zero(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(prod(X1, X2)) → active(prod(mark(X1), mark(X2)))
mark(p(X)) → active(p(mark(X)))
mark(add(X1, X2)) → active(add(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
fact(mark(X)) → fact(X)
fact(active(X)) → fact(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
zero(mark(X)) → zero(X)
zero(active(X)) → zero(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
prod(mark(X1), X2) → prod(X1, X2)
prod(X1, mark(X2)) → prod(X1, X2)
prod(active(X1), X2) → prod(X1, X2)
prod(X1, active(X2)) → prod(X1, X2)
p(mark(X)) → p(X)
p(active(X)) → p(X)
add(mark(X1), X2) → add(X1, X2)
add(X1, mark(X2)) → add(X1, X2)
add(active(X1), X2) → add(X1, X2)
add(X1, active(X2)) → add(X1, X2)

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

(6) Obligation:

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

P(active(X)) → P(X)
P(mark(X)) → P(X)

The TRS R consists of the following rules:

active(fact(X)) → mark(if(zero(X), s(0), prod(X, fact(p(X)))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(prod(0, X)) → mark(0)
active(prod(s(X), Y)) → mark(add(Y, prod(X, Y)))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(zero(0)) → mark(true)
active(zero(s(X))) → mark(false)
active(p(s(X))) → mark(X)
mark(fact(X)) → active(fact(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(zero(X)) → active(zero(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(prod(X1, X2)) → active(prod(mark(X1), mark(X2)))
mark(p(X)) → active(p(mark(X)))
mark(add(X1, X2)) → active(add(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
fact(mark(X)) → fact(X)
fact(active(X)) → fact(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
zero(mark(X)) → zero(X)
zero(active(X)) → zero(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
prod(mark(X1), X2) → prod(X1, X2)
prod(X1, mark(X2)) → prod(X1, X2)
prod(active(X1), X2) → prod(X1, X2)
prod(X1, active(X2)) → prod(X1, X2)
p(mark(X)) → p(X)
p(active(X)) → p(X)
add(mark(X1), X2) → add(X1, X2)
add(X1, mark(X2)) → add(X1, X2)
add(active(X1), X2) → add(X1, X2)
add(X1, active(X2)) → add(X1, X2)

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

(7) Obligation:

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

PROD(X1, mark(X2)) → PROD(X1, X2)
PROD(mark(X1), X2) → PROD(X1, X2)
PROD(active(X1), X2) → PROD(X1, X2)
PROD(X1, active(X2)) → PROD(X1, X2)

The TRS R consists of the following rules:

active(fact(X)) → mark(if(zero(X), s(0), prod(X, fact(p(X)))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(prod(0, X)) → mark(0)
active(prod(s(X), Y)) → mark(add(Y, prod(X, Y)))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(zero(0)) → mark(true)
active(zero(s(X))) → mark(false)
active(p(s(X))) → mark(X)
mark(fact(X)) → active(fact(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(zero(X)) → active(zero(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(prod(X1, X2)) → active(prod(mark(X1), mark(X2)))
mark(p(X)) → active(p(mark(X)))
mark(add(X1, X2)) → active(add(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
fact(mark(X)) → fact(X)
fact(active(X)) → fact(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
zero(mark(X)) → zero(X)
zero(active(X)) → zero(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
prod(mark(X1), X2) → prod(X1, X2)
prod(X1, mark(X2)) → prod(X1, X2)
prod(active(X1), X2) → prod(X1, X2)
prod(X1, active(X2)) → prod(X1, X2)
p(mark(X)) → p(X)
p(active(X)) → p(X)
add(mark(X1), X2) → add(X1, X2)
add(X1, mark(X2)) → add(X1, X2)
add(active(X1), X2) → add(X1, X2)
add(X1, active(X2)) → add(X1, X2)

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

(8) Obligation:

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

S(active(X)) → S(X)
S(mark(X)) → S(X)

The TRS R consists of the following rules:

active(fact(X)) → mark(if(zero(X), s(0), prod(X, fact(p(X)))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(prod(0, X)) → mark(0)
active(prod(s(X), Y)) → mark(add(Y, prod(X, Y)))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(zero(0)) → mark(true)
active(zero(s(X))) → mark(false)
active(p(s(X))) → mark(X)
mark(fact(X)) → active(fact(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(zero(X)) → active(zero(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(prod(X1, X2)) → active(prod(mark(X1), mark(X2)))
mark(p(X)) → active(p(mark(X)))
mark(add(X1, X2)) → active(add(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
fact(mark(X)) → fact(X)
fact(active(X)) → fact(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
zero(mark(X)) → zero(X)
zero(active(X)) → zero(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
prod(mark(X1), X2) → prod(X1, X2)
prod(X1, mark(X2)) → prod(X1, X2)
prod(active(X1), X2) → prod(X1, X2)
prod(X1, active(X2)) → prod(X1, X2)
p(mark(X)) → p(X)
p(active(X)) → p(X)
add(mark(X1), X2) → add(X1, X2)
add(X1, mark(X2)) → add(X1, X2)
add(active(X1), X2) → add(X1, X2)
add(X1, active(X2)) → add(X1, X2)

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

(9) Obligation:

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

ZERO(active(X)) → ZERO(X)
ZERO(mark(X)) → ZERO(X)

The TRS R consists of the following rules:

active(fact(X)) → mark(if(zero(X), s(0), prod(X, fact(p(X)))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(prod(0, X)) → mark(0)
active(prod(s(X), Y)) → mark(add(Y, prod(X, Y)))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(zero(0)) → mark(true)
active(zero(s(X))) → mark(false)
active(p(s(X))) → mark(X)
mark(fact(X)) → active(fact(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(zero(X)) → active(zero(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(prod(X1, X2)) → active(prod(mark(X1), mark(X2)))
mark(p(X)) → active(p(mark(X)))
mark(add(X1, X2)) → active(add(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
fact(mark(X)) → fact(X)
fact(active(X)) → fact(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
zero(mark(X)) → zero(X)
zero(active(X)) → zero(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
prod(mark(X1), X2) → prod(X1, X2)
prod(X1, mark(X2)) → prod(X1, X2)
prod(active(X1), X2) → prod(X1, X2)
prod(X1, active(X2)) → prod(X1, X2)
p(mark(X)) → p(X)
p(active(X)) → p(X)
add(mark(X1), X2) → add(X1, X2)
add(X1, mark(X2)) → add(X1, X2)
add(active(X1), X2) → add(X1, X2)
add(X1, active(X2)) → add(X1, X2)

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

(10) Obligation:

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

IF(X1, mark(X2), X3) → IF(X1, X2, X3)
IF(mark(X1), X2, X3) → IF(X1, X2, X3)
IF(X1, X2, mark(X3)) → IF(X1, X2, X3)
IF(active(X1), X2, X3) → IF(X1, X2, X3)
IF(X1, active(X2), X3) → IF(X1, X2, X3)
IF(X1, X2, active(X3)) → IF(X1, X2, X3)

The TRS R consists of the following rules:

active(fact(X)) → mark(if(zero(X), s(0), prod(X, fact(p(X)))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(prod(0, X)) → mark(0)
active(prod(s(X), Y)) → mark(add(Y, prod(X, Y)))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(zero(0)) → mark(true)
active(zero(s(X))) → mark(false)
active(p(s(X))) → mark(X)
mark(fact(X)) → active(fact(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(zero(X)) → active(zero(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(prod(X1, X2)) → active(prod(mark(X1), mark(X2)))
mark(p(X)) → active(p(mark(X)))
mark(add(X1, X2)) → active(add(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
fact(mark(X)) → fact(X)
fact(active(X)) → fact(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
zero(mark(X)) → zero(X)
zero(active(X)) → zero(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
prod(mark(X1), X2) → prod(X1, X2)
prod(X1, mark(X2)) → prod(X1, X2)
prod(active(X1), X2) → prod(X1, X2)
prod(X1, active(X2)) → prod(X1, X2)
p(mark(X)) → p(X)
p(active(X)) → p(X)
add(mark(X1), X2) → add(X1, X2)
add(X1, mark(X2)) → add(X1, X2)
add(active(X1), X2) → add(X1, X2)
add(X1, active(X2)) → add(X1, X2)

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

(11) Obligation:

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

FACT(active(X)) → FACT(X)
FACT(mark(X)) → FACT(X)

The TRS R consists of the following rules:

active(fact(X)) → mark(if(zero(X), s(0), prod(X, fact(p(X)))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(prod(0, X)) → mark(0)
active(prod(s(X), Y)) → mark(add(Y, prod(X, Y)))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(zero(0)) → mark(true)
active(zero(s(X))) → mark(false)
active(p(s(X))) → mark(X)
mark(fact(X)) → active(fact(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(zero(X)) → active(zero(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(prod(X1, X2)) → active(prod(mark(X1), mark(X2)))
mark(p(X)) → active(p(mark(X)))
mark(add(X1, X2)) → active(add(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
fact(mark(X)) → fact(X)
fact(active(X)) → fact(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
zero(mark(X)) → zero(X)
zero(active(X)) → zero(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
prod(mark(X1), X2) → prod(X1, X2)
prod(X1, mark(X2)) → prod(X1, X2)
prod(active(X1), X2) → prod(X1, X2)
prod(X1, active(X2)) → prod(X1, X2)
p(mark(X)) → p(X)
p(active(X)) → p(X)
add(mark(X1), X2) → add(X1, X2)
add(X1, mark(X2)) → add(X1, X2)
add(active(X1), X2) → add(X1, X2)
add(X1, active(X2)) → add(X1, X2)

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

(12) Obligation:

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

MARK(fact(X)) → ACTIVE(fact(mark(X)))
ACTIVE(fact(X)) → MARK(if(zero(X), s(0), prod(X, fact(p(X)))))
MARK(fact(X)) → MARK(X)
MARK(if(X1, X2, X3)) → ACTIVE(if(mark(X1), X2, X3))
ACTIVE(add(0, X)) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(zero(X)) → ACTIVE(zero(mark(X)))
ACTIVE(add(s(X), Y)) → MARK(s(add(X, Y)))
MARK(zero(X)) → MARK(X)
MARK(s(X)) → ACTIVE(s(mark(X)))
ACTIVE(prod(s(X), Y)) → MARK(add(Y, prod(X, Y)))
MARK(s(X)) → MARK(X)
MARK(prod(X1, X2)) → ACTIVE(prod(mark(X1), mark(X2)))
ACTIVE(if(true, X, Y)) → MARK(X)
MARK(prod(X1, X2)) → MARK(X1)
MARK(prod(X1, X2)) → MARK(X2)
MARK(p(X)) → ACTIVE(p(mark(X)))
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(p(X)) → MARK(X)
MARK(add(X1, X2)) → ACTIVE(add(mark(X1), mark(X2)))
ACTIVE(p(s(X))) → MARK(X)
MARK(add(X1, X2)) → MARK(X1)
MARK(add(X1, X2)) → MARK(X2)

The TRS R consists of the following rules:

active(fact(X)) → mark(if(zero(X), s(0), prod(X, fact(p(X)))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(prod(0, X)) → mark(0)
active(prod(s(X), Y)) → mark(add(Y, prod(X, Y)))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(zero(0)) → mark(true)
active(zero(s(X))) → mark(false)
active(p(s(X))) → mark(X)
mark(fact(X)) → active(fact(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(zero(X)) → active(zero(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(prod(X1, X2)) → active(prod(mark(X1), mark(X2)))
mark(p(X)) → active(p(mark(X)))
mark(add(X1, X2)) → active(add(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
fact(mark(X)) → fact(X)
fact(active(X)) → fact(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
zero(mark(X)) → zero(X)
zero(active(X)) → zero(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
prod(mark(X1), X2) → prod(X1, X2)
prod(X1, mark(X2)) → prod(X1, X2)
prod(active(X1), X2) → prod(X1, X2)
prod(X1, active(X2)) → prod(X1, X2)
p(mark(X)) → p(X)
p(active(X)) → p(X)
add(mark(X1), X2) → add(X1, X2)
add(X1, mark(X2)) → add(X1, X2)
add(active(X1), X2) → add(X1, X2)
add(X1, active(X2)) → add(X1, X2)

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

(13) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


MARK(zero(X)) → ACTIVE(zero(mark(X)))
MARK(s(X)) → ACTIVE(s(mark(X)))
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
MARK(x1)  =  MARK
fact(x1)  =  fact
ACTIVE(x1)  =  x1
mark(x1)  =  mark
if(x1, x2, x3)  =  if
zero(x1)  =  zero
s(x1)  =  s
0  =  0
prod(x1, x2)  =  prod
p(x1)  =  p
add(x1, x2)  =  add
true  =  true
false  =  false
active(x1)  =  active

Lexicographic Path Order [LPO].
Precedence:
[MARK, fact, if, prod, p, add] > 0 > [mark, active] > zero > true > s
false > [mark, active] > zero > true > s


The following usable rules [FROCOS05] were oriented:

active(fact(X)) → mark(if(zero(X), s(0), prod(X, fact(p(X)))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(prod(0, X)) → mark(0)
active(prod(s(X), Y)) → mark(add(Y, prod(X, Y)))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(zero(0)) → mark(true)
active(zero(s(X))) → mark(false)
active(p(s(X))) → mark(X)
mark(fact(X)) → active(fact(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(zero(X)) → active(zero(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(prod(X1, X2)) → active(prod(mark(X1), mark(X2)))
mark(p(X)) → active(p(mark(X)))
mark(add(X1, X2)) → active(add(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
fact(mark(X)) → fact(X)
fact(active(X)) → fact(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
zero(mark(X)) → zero(X)
zero(active(X)) → zero(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
prod(mark(X1), X2) → prod(X1, X2)
prod(X1, mark(X2)) → prod(X1, X2)
prod(active(X1), X2) → prod(X1, X2)
prod(X1, active(X2)) → prod(X1, X2)
p(mark(X)) → p(X)
p(active(X)) → p(X)
add(mark(X1), X2) → add(X1, X2)
add(X1, mark(X2)) → add(X1, X2)
add(active(X1), X2) → add(X1, X2)
add(X1, active(X2)) → add(X1, X2)

(14) Obligation:

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

MARK(fact(X)) → ACTIVE(fact(mark(X)))
ACTIVE(fact(X)) → MARK(if(zero(X), s(0), prod(X, fact(p(X)))))
MARK(fact(X)) → MARK(X)
MARK(if(X1, X2, X3)) → ACTIVE(if(mark(X1), X2, X3))
ACTIVE(add(0, X)) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
ACTIVE(add(s(X), Y)) → MARK(s(add(X, Y)))
MARK(zero(X)) → MARK(X)
ACTIVE(prod(s(X), Y)) → MARK(add(Y, prod(X, Y)))
MARK(s(X)) → MARK(X)
MARK(prod(X1, X2)) → ACTIVE(prod(mark(X1), mark(X2)))
ACTIVE(if(true, X, Y)) → MARK(X)
MARK(prod(X1, X2)) → MARK(X1)
MARK(prod(X1, X2)) → MARK(X2)
MARK(p(X)) → ACTIVE(p(mark(X)))
ACTIVE(if(false, X, Y)) → MARK(Y)
MARK(p(X)) → MARK(X)
MARK(add(X1, X2)) → ACTIVE(add(mark(X1), mark(X2)))
ACTIVE(p(s(X))) → MARK(X)
MARK(add(X1, X2)) → MARK(X1)
MARK(add(X1, X2)) → MARK(X2)

The TRS R consists of the following rules:

active(fact(X)) → mark(if(zero(X), s(0), prod(X, fact(p(X)))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(prod(0, X)) → mark(0)
active(prod(s(X), Y)) → mark(add(Y, prod(X, Y)))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(zero(0)) → mark(true)
active(zero(s(X))) → mark(false)
active(p(s(X))) → mark(X)
mark(fact(X)) → active(fact(mark(X)))
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(zero(X)) → active(zero(mark(X)))
mark(s(X)) → active(s(mark(X)))
mark(0) → active(0)
mark(prod(X1, X2)) → active(prod(mark(X1), mark(X2)))
mark(p(X)) → active(p(mark(X)))
mark(add(X1, X2)) → active(add(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
fact(mark(X)) → fact(X)
fact(active(X)) → fact(X)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
zero(mark(X)) → zero(X)
zero(active(X)) → zero(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
prod(mark(X1), X2) → prod(X1, X2)
prod(X1, mark(X2)) → prod(X1, X2)
prod(active(X1), X2) → prod(X1, X2)
prod(X1, active(X2)) → prod(X1, X2)
p(mark(X)) → p(X)
p(active(X)) → p(X)
add(mark(X1), X2) → add(X1, X2)
add(X1, mark(X2)) → add(X1, X2)
add(active(X1), X2) → add(X1, X2)
add(X1, active(X2)) → add(X1, X2)

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