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

Innermost 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 one SCC.


   R
DPs
       →DP Problem 1
Narrowing 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


Strategy:

innermost




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

FACT(X) -> IF(zero(X), ns(n0), nprod(X, nfact(np(X))))
no new Dependency Pairs are created.
The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Polynomial Ordering


Dependency Pairs:

ACTIVATE(np(X)) -> ACTIVATE(X)
ACTIVATE(nfact(X)) -> ACTIVATE(X)
ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(ns(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


Strategy:

innermost




The following dependency pair can be strictly oriented:

ACTIVATE(ns(X)) -> ACTIVATE(X)


There are no usable rules for innermost that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(n__s(x1))=  1 + x1  
  POL(ACTIVATE(x1))=  x1  
  POL(n__fact(x1))=  x1  
  POL(n__prod(x1, x2))=  x1 + x2  
  POL(n__p(x1))=  x1  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Polo
             ...
               →DP Problem 3
Polynomial Ordering


Dependency Pairs:

ACTIVATE(np(X)) -> ACTIVATE(X)
ACTIVATE(nfact(X)) -> ACTIVATE(X)
ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X1)


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


Strategy:

innermost




The following dependency pair can be strictly oriented:

ACTIVATE(np(X)) -> ACTIVATE(X)


There are no usable rules for innermost that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(ACTIVATE(x1))=  x1  
  POL(n__fact(x1))=  x1  
  POL(n__prod(x1, x2))=  x1 + x2  
  POL(n__p(x1))=  1 + x1  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Polo
             ...
               →DP Problem 4
Polynomial Ordering


Dependency Pairs:

ACTIVATE(nfact(X)) -> ACTIVATE(X)
ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X1)


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


Strategy:

innermost




The following dependency pair can be strictly oriented:

ACTIVATE(nfact(X)) -> ACTIVATE(X)


There are no usable rules for innermost that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(ACTIVATE(x1))=  x1  
  POL(n__fact(x1))=  1 + x1  
  POL(n__prod(x1, x2))=  x1 + x2  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Polo
             ...
               →DP Problem 5
Polynomial Ordering


Dependency Pairs:

ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X1)


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


Strategy:

innermost




The following dependency pairs can be strictly oriented:

ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X1)


There are no usable rules for innermost that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(ACTIVATE(x1))=  x1  
  POL(n__prod(x1, x2))=  1 + x1 + x2  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Polo
             ...
               →DP Problem 6
Dependency Graph


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


Strategy:

innermost




Using the Dependency Graph resulted in no new DP problems.

Innermost Termination of R successfully shown.
Duration:
0:00 minutes