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
Removing Redundant Rules for Innermost Termination



Removing the following rules from R which left hand sides contain non normal subterms

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))
zero(0) -> true
zero(s(X)) -> false
p(s(X)) -> X


   R
RRRI
       →TRS2
Dependency Pair Analysis



R contains the following Dependency Pairs:

FACT(X) -> IF(zero(X), ns(n0), nprod(X, nfact(np(X))))
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
RRRI
       →TRS2
DPs
           →DP Problem 1
Size-Change Principle


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





We number the DPs as follows:
  1. ACTIVATE(np(X)) -> ACTIVATE(X)
  2. ACTIVATE(nfact(X)) -> ACTIVATE(X)
  3. ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X2)
  4. ACTIVATE(nprod(X1, X2)) -> ACTIVATE(X1)
  5. ACTIVATE(ns(X)) -> ACTIVATE(X)
and get the following Size-Change Graph(s):
{5, 4, 3, 2, 1} , {5, 4, 3, 2, 1}
1>1

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

DP: empty set
Oriented Rules: none

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

with Argument Filtering System:
ns(x1) -> ns(x1)
nprod(x1, x2) -> nprod(x1, x2)
nfact(x1) -> nfact(x1)
np(x1) -> np(x1)

We obtain no new DP problems.

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