(0) Obligation:

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

fact(X) → if(zero(X), n__s(0), n__prod(X, fact(p(X))))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
prod(0, X) → 0
prod(s(X), Y) → add(Y, prod(X, Y))
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
zero(0) → true
zero(s(X)) → false
p(s(X)) → X
s(X) → n__s(X)
prod(X1, X2) → n__prod(X1, X2)
activate(n__s(X)) → s(X)
activate(n__prod(X1, X2)) → prod(X1, X2)
activate(X) → X

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:

FACT(X) → IF(zero(X), n__s(0), n__prod(X, fact(p(X))))
FACT(X) → ZERO(X)
FACT(X) → FACT(p(X))
FACT(X) → P(X)
ADD(s(X), Y) → S(add(X, Y))
ADD(s(X), Y) → ADD(X, Y)
PROD(s(X), Y) → ADD(Y, prod(X, Y))
PROD(s(X), Y) → PROD(X, Y)
IF(true, X, Y) → ACTIVATE(X)
IF(false, X, Y) → ACTIVATE(Y)
ACTIVATE(n__s(X)) → S(X)
ACTIVATE(n__prod(X1, X2)) → PROD(X1, X2)

The TRS R consists of the following rules:

fact(X) → if(zero(X), n__s(0), n__prod(X, fact(p(X))))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
prod(0, X) → 0
prod(s(X), Y) → add(Y, prod(X, Y))
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
zero(0) → true
zero(s(X)) → false
p(s(X)) → X
s(X) → n__s(X)
prod(X1, X2) → n__prod(X1, X2)
activate(n__s(X)) → s(X)
activate(n__prod(X1, X2)) → prod(X1, X2)
activate(X) → X

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 3 SCCs with 9 less nodes.

(4) Complex Obligation (AND)

(5) Obligation:

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

ADD(s(X), Y) → ADD(X, Y)

The TRS R consists of the following rules:

fact(X) → if(zero(X), n__s(0), n__prod(X, fact(p(X))))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
prod(0, X) → 0
prod(s(X), Y) → add(Y, prod(X, Y))
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
zero(0) → true
zero(s(X)) → false
p(s(X)) → X
s(X) → n__s(X)
prod(X1, X2) → n__prod(X1, X2)
activate(n__s(X)) → s(X)
activate(n__prod(X1, X2)) → prod(X1, X2)
activate(X) → X

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

(6) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


ADD(s(X), Y) → ADD(X, Y)
The remaining pairs can at least be oriented weakly.
Used ordering: Lexicographic Path Order [LPO].
Precedence:
trivial


The following usable rules [FROCOS05] were oriented: none

(7) Obligation:

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

fact(X) → if(zero(X), n__s(0), n__prod(X, fact(p(X))))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
prod(0, X) → 0
prod(s(X), Y) → add(Y, prod(X, Y))
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
zero(0) → true
zero(s(X)) → false
p(s(X)) → X
s(X) → n__s(X)
prod(X1, X2) → n__prod(X1, X2)
activate(n__s(X)) → s(X)
activate(n__prod(X1, X2)) → prod(X1, X2)
activate(X) → X

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

(8) PisEmptyProof (EQUIVALENT transformation)

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

(9) TRUE

(10) Obligation:

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

PROD(s(X), Y) → PROD(X, Y)

The TRS R consists of the following rules:

fact(X) → if(zero(X), n__s(0), n__prod(X, fact(p(X))))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
prod(0, X) → 0
prod(s(X), Y) → add(Y, prod(X, Y))
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
zero(0) → true
zero(s(X)) → false
p(s(X)) → X
s(X) → n__s(X)
prod(X1, X2) → n__prod(X1, X2)
activate(n__s(X)) → s(X)
activate(n__prod(X1, X2)) → prod(X1, X2)
activate(X) → X

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

(11) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


PROD(s(X), Y) → PROD(X, Y)
The remaining pairs can at least be oriented weakly.
Used ordering: Lexicographic Path Order [LPO].
Precedence:
trivial


The following usable rules [FROCOS05] were oriented: none

(12) Obligation:

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

fact(X) → if(zero(X), n__s(0), n__prod(X, fact(p(X))))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
prod(0, X) → 0
prod(s(X), Y) → add(Y, prod(X, Y))
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
zero(0) → true
zero(s(X)) → false
p(s(X)) → X
s(X) → n__s(X)
prod(X1, X2) → n__prod(X1, X2)
activate(n__s(X)) → s(X)
activate(n__prod(X1, X2)) → prod(X1, X2)
activate(X) → X

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

(13) PisEmptyProof (EQUIVALENT transformation)

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

(14) TRUE

(15) Obligation:

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

FACT(X) → FACT(p(X))

The TRS R consists of the following rules:

fact(X) → if(zero(X), n__s(0), n__prod(X, fact(p(X))))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
prod(0, X) → 0
prod(s(X), Y) → add(Y, prod(X, Y))
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
zero(0) → true
zero(s(X)) → false
p(s(X)) → X
s(X) → n__s(X)
prod(X1, X2) → n__prod(X1, X2)
activate(n__s(X)) → s(X)
activate(n__prod(X1, X2)) → prod(X1, X2)
activate(X) → X

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