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
Polynomial Ordering
       →DP Problem 2
Polo
       →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





The following dependency pair can be strictly oriented:

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


There are no usable rules w.r.t. to the implicit AFS that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(s(x1))=  1 + x1  
  POL(ADD(x1, x2))=  x1  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
           →DP Problem 4
Dependency Graph
       →DP Problem 2
Polo
       →DP Problem 3
Inst


Dependency Pair:


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





Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polynomial Ordering
       →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





The following dependency pair can be strictly oriented:

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


There are no usable rules w.r.t. to the implicit AFS that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(s(x1))=  1 + x1  
  POL(PROD(x1, x2))=  x1  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
           →DP Problem 5
Dependency Graph
       →DP Problem 3
Inst


Dependency Pair:


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





Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →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
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Inst
           →DP Problem 6
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
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Inst
           →DP Problem 6
Inst
             ...
               →DP Problem 7
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




Termination of R could not be shown.
Duration:
0:00 minutes