Term Rewriting System R:
[X, Y, X1, X2]
fact(X) -> if(zero(X), ns(0), nprod(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))
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
s(X) -> ns(X)
activate(ns(X)) -> s(X)
activate(nprod(X1, X2)) -> prod(X1, X2)
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(0), nprod(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(ns(X)) -> S(X)
ACTIVATE(nprod(X1, X2)) -> PROD(X1, X2)

Furthermore, R contains three SCCs.


   R
DPs
       →DP Problem 1
Argument Filtering and Ordering
       →DP Problem 2
AFS
       →DP Problem 3
Remaining


Dependency Pair:

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


Rules:


fact(X) -> if(zero(X), ns(0), nprod(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))
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
s(X) -> ns(X)
activate(ns(X)) -> s(X)
activate(nprod(X1, X2)) -> prod(X1, X2)
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 AFS that need to be oriented.
Used ordering: Homeomorphic Embedding Order with EMB
resulting in one new DP problem.
Used Argument Filtering System:
ADD(x1, x2) -> ADD(x1, x2)
s(x1) -> s(x1)


   R
DPs
       →DP Problem 1
AFS
           →DP Problem 4
Dependency Graph
       →DP Problem 2
AFS
       →DP Problem 3
Remaining


Dependency Pair:


Rules:


fact(X) -> if(zero(X), ns(0), nprod(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))
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
s(X) -> ns(X)
activate(ns(X)) -> s(X)
activate(nprod(X1, X2)) -> prod(X1, X2)
activate(X) -> X





Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
AFS
       →DP Problem 2
Argument Filtering and Ordering
       →DP Problem 3
Remaining


Dependency Pair:

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


Rules:


fact(X) -> if(zero(X), ns(0), nprod(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))
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
s(X) -> ns(X)
activate(ns(X)) -> s(X)
activate(nprod(X1, X2)) -> prod(X1, X2)
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 AFS that need to be oriented.
Used ordering: Homeomorphic Embedding Order with EMB
resulting in one new DP problem.
Used Argument Filtering System:
PROD(x1, x2) -> PROD(x1, x2)
s(x1) -> s(x1)


   R
DPs
       →DP Problem 1
AFS
       →DP Problem 2
AFS
           →DP Problem 5
Dependency Graph
       →DP Problem 3
Remaining


Dependency Pair:


Rules:


fact(X) -> if(zero(X), ns(0), nprod(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))
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
s(X) -> ns(X)
activate(ns(X)) -> s(X)
activate(nprod(X1, X2)) -> prod(X1, X2)
activate(X) -> X





Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
AFS
       →DP Problem 2
AFS
       →DP Problem 3
Remaining Obligation(s)




The following remains to be proven:
Dependency Pair:

FACT(X) -> FACT(p(X))


Rules:


fact(X) -> if(zero(X), ns(0), nprod(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))
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
s(X) -> ns(X)
activate(ns(X)) -> s(X)
activate(nprod(X1, X2)) -> prod(X1, X2)
activate(X) -> X




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