Term Rewriting System R:
[X, Y, X1, X2]
fact(X) -> if(zero(X), ns(n0), nprod(X, nfact(np(X))))
fact(X) -> nfact(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))
prod(X1, X2) -> nprod(X1, X2)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
zero(0) -> true
zero(s(X)) -> false
p(s(X)) -> X
p(X) -> np(X)
s(X) -> ns(X)
0 -> n0
activate(ns(X)) -> s(activate(X))
activate(n0) -> 0
activate(nprod(X1, X2)) -> prod(activate(X1), activate(X2))
activate(nfact(X)) -> fact(activate(X))
activate(np(X)) -> p(activate(X))
activate(X) -> X

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

FACT(X) -> IF(zero(X), ns(n0), nprod(X, nfact(np(X))))
FACT(X) -> ZERO(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(ns(X)) -> S(activate(X))
ACTIVATE(ns(X)) -> ACTIVATE(X)
ACTIVATE(n0) -> 0'
ACTIVATE(nprod(X1, X2)) -> PROD(activate(X1), activate(X2))
ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(nfact(X)) -> FACT(activate(X))
ACTIVATE(nfact(X)) -> ACTIVATE(X)
ACTIVATE(np(X)) -> P(activate(X))
ACTIVATE(np(X)) -> ACTIVATE(X)

Furthermore, R contains three SCCs.


   R
DPs
       →DP Problem 1
Size-Change Principle
       →DP Problem 2
SCP
       →DP Problem 3
Inst


Dependency Pair:

ADD(s(X), Y) -> ADD(X, Y)


Rules:


fact(X) -> if(zero(X), ns(n0), nprod(X, nfact(np(X))))
fact(X) -> nfact(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))
prod(X1, X2) -> nprod(X1, X2)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
zero(0) -> true
zero(s(X)) -> false
p(s(X)) -> X
p(X) -> np(X)
s(X) -> ns(X)
0 -> n0
activate(ns(X)) -> s(activate(X))
activate(n0) -> 0
activate(nprod(X1, X2)) -> prod(activate(X1), activate(X2))
activate(nfact(X)) -> fact(activate(X))
activate(np(X)) -> p(activate(X))
activate(X) -> X





We number the DPs as follows:
  1. ADD(s(X), Y) -> ADD(X, Y)
and get the following Size-Change Graph(s):
{1} , {1}
1>1
2=2

which lead(s) to this/these maximal multigraph(s):
{1} , {1}
1>1
2=2

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
s(x1) -> s(x1)

We obtain no new DP problems.


   R
DPs
       →DP Problem 1
SCP
       →DP Problem 2
Size-Change Principle
       →DP Problem 3
Inst


Dependency Pair:

PROD(s(X), Y) -> PROD(X, Y)


Rules:


fact(X) -> if(zero(X), ns(n0), nprod(X, nfact(np(X))))
fact(X) -> nfact(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))
prod(X1, X2) -> nprod(X1, X2)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
zero(0) -> true
zero(s(X)) -> false
p(s(X)) -> X
p(X) -> np(X)
s(X) -> ns(X)
0 -> n0
activate(ns(X)) -> s(activate(X))
activate(n0) -> 0
activate(nprod(X1, X2)) -> prod(activate(X1), activate(X2))
activate(nfact(X)) -> fact(activate(X))
activate(np(X)) -> p(activate(X))
activate(X) -> X





We number the DPs as follows:
  1. PROD(s(X), Y) -> PROD(X, Y)
and get the following Size-Change Graph(s):
{1} , {1}
1>1
2=2

which lead(s) to this/these maximal multigraph(s):
{1} , {1}
1>1
2=2

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
s(x1) -> s(x1)

We obtain no new DP problems.


   R
DPs
       →DP Problem 1
SCP
       →DP Problem 2
SCP
       →DP Problem 3
Instantiation Transformation


Dependency Pairs:

IF(false, X, Y) -> ACTIVATE(Y)
ACTIVATE(np(X)) -> ACTIVATE(X)
ACTIVATE(nfact(X)) -> ACTIVATE(X)
ACTIVATE(nfact(X)) -> FACT(activate(X))
ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(ns(X)) -> ACTIVATE(X)
IF(true, X, Y) -> ACTIVATE(X)
FACT(X) -> IF(zero(X), ns(n0), nprod(X, nfact(np(X))))


Rules:


fact(X) -> if(zero(X), ns(n0), nprod(X, nfact(np(X))))
fact(X) -> nfact(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))
prod(X1, X2) -> nprod(X1, X2)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
zero(0) -> true
zero(s(X)) -> false
p(s(X)) -> X
p(X) -> np(X)
s(X) -> ns(X)
0 -> n0
activate(ns(X)) -> s(activate(X))
activate(n0) -> 0
activate(nprod(X1, X2)) -> prod(activate(X1), activate(X2))
activate(nfact(X)) -> fact(activate(X))
activate(np(X)) -> p(activate(X))
activate(X) -> X





On this DP problem, an Instantiation SCC transformation can be performed.
As a result of transforming the rule

IF(true, X, Y) -> ACTIVATE(X)
one new Dependency Pair is created:

IF(true, ns(n0), nprod(X'0, nfact(np(X''')))) -> ACTIVATE(ns(n0))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
SCP
       →DP Problem 2
SCP
       →DP Problem 3
Inst
           →DP Problem 4
Instantiation Transformation


Dependency Pairs:

ACTIVATE(np(X)) -> ACTIVATE(X)
ACTIVATE(nfact(X)) -> ACTIVATE(X)
IF(true, ns(n0), nprod(X'0, nfact(np(X''')))) -> ACTIVATE(ns(n0))
FACT(X) -> IF(zero(X), ns(n0), nprod(X, nfact(np(X))))
ACTIVATE(nfact(X)) -> FACT(activate(X))
ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(ns(X)) -> ACTIVATE(X)
IF(false, X, Y) -> ACTIVATE(Y)


Rules:


fact(X) -> if(zero(X), ns(n0), nprod(X, nfact(np(X))))
fact(X) -> nfact(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))
prod(X1, X2) -> nprod(X1, X2)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
zero(0) -> true
zero(s(X)) -> false
p(s(X)) -> X
p(X) -> np(X)
s(X) -> ns(X)
0 -> n0
activate(ns(X)) -> s(activate(X))
activate(n0) -> 0
activate(nprod(X1, X2)) -> prod(activate(X1), activate(X2))
activate(nfact(X)) -> fact(activate(X))
activate(np(X)) -> p(activate(X))
activate(X) -> X





On this DP problem, an Instantiation SCC transformation can be performed.
As a result of transforming the rule

IF(false, X, Y) -> ACTIVATE(Y)
one new Dependency Pair is created:

IF(false, ns(n0), nprod(X'0, nfact(np(X''')))) -> ACTIVATE(nprod(X'0, nfact(np(X'''))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
SCP
       →DP Problem 2
SCP
       →DP Problem 3
Inst
           →DP Problem 4
Inst
             ...
               →DP Problem 5
Remaining Obligation(s)




The following remains to be proven:
Dependency Pairs:

ACTIVATE(nfact(X)) -> ACTIVATE(X)
IF(false, ns(n0), nprod(X'0, nfact(np(X''')))) -> ACTIVATE(nprod(X'0, nfact(np(X'''))))
IF(true, ns(n0), nprod(X'0, nfact(np(X''')))) -> ACTIVATE(ns(n0))
FACT(X) -> IF(zero(X), ns(n0), nprod(X, nfact(np(X))))
ACTIVATE(nfact(X)) -> FACT(activate(X))
ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(ns(X)) -> ACTIVATE(X)
ACTIVATE(np(X)) -> ACTIVATE(X)


Rules:


fact(X) -> if(zero(X), ns(n0), nprod(X, nfact(np(X))))
fact(X) -> nfact(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))
prod(X1, X2) -> nprod(X1, X2)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
zero(0) -> true
zero(s(X)) -> false
p(s(X)) -> X
p(X) -> np(X)
s(X) -> ns(X)
0 -> n0
activate(ns(X)) -> s(activate(X))
activate(n0) -> 0
activate(nprod(X1, X2)) -> prod(activate(X1), activate(X2))
activate(nfact(X)) -> fact(activate(X))
activate(np(X)) -> p(activate(X))
activate(X) -> X




The Proof could not be continued due to a Timeout.
Termination of R could not be shown.
Duration:
1:00 minutes