Term Rewriting System R:
[X, Y]
p(0) -> 0
p(s(X)) -> X
leq(0, Y) -> true
leq(s(X), 0) -> false
leq(s(X), s(Y)) -> leq(X, Y)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
diff(X, Y) -> if(leq(X, Y), n0, ns(diff(p(X), Y)))
0 -> n0
s(X) -> ns(X)
activate(n0) -> 0
activate(ns(X)) -> s(X)
activate(X) -> X

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

LEQ(s(X), s(Y)) -> LEQ(X, Y)
IF(true, X, Y) -> ACTIVATE(X)
IF(false, X, Y) -> ACTIVATE(Y)
DIFF(X, Y) -> IF(leq(X, Y), n0, ns(diff(p(X), Y)))
DIFF(X, Y) -> LEQ(X, Y)
DIFF(X, Y) -> DIFF(p(X), Y)
DIFF(X, Y) -> P(X)
ACTIVATE(n0) -> 0'
ACTIVATE(ns(X)) -> S(X)

Furthermore, R contains two SCCs.


   R
DPs
       →DP Problem 1
Size-Change Principle
       →DP Problem 2
MRR


Dependency Pair:

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


Rules:


p(0) -> 0
p(s(X)) -> X
leq(0, Y) -> true
leq(s(X), 0) -> false
leq(s(X), s(Y)) -> leq(X, Y)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
diff(X, Y) -> if(leq(X, Y), n0, ns(diff(p(X), Y)))
0 -> n0
s(X) -> ns(X)
activate(n0) -> 0
activate(ns(X)) -> s(X)
activate(X) -> X





We number the DPs as follows:
  1. LEQ(s(X), s(Y)) -> LEQ(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
Modular Removal of Rules


Dependency Pair:

DIFF(X, Y) -> DIFF(p(X), Y)


Rules:


p(0) -> 0
p(s(X)) -> X
leq(0, Y) -> true
leq(s(X), 0) -> false
leq(s(X), s(Y)) -> leq(X, Y)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
diff(X, Y) -> if(leq(X, Y), n0, ns(diff(p(X), Y)))
0 -> n0
s(X) -> ns(X)
activate(n0) -> 0
activate(ns(X)) -> s(X)
activate(X) -> X





We have the following set of usable rules:

p(0) -> 0
p(s(X)) -> X
0 -> n0
To remove rules and DPs from this DP problem we used the following monotonic and CE-compatible order: Polynomial ordering.
Polynomial interpretation:
  POL(DIFF(x1, x2))=  x1 + x2  
  POL(0)=  0  
  POL(s(x1))=  x1  
  POL(n__0)=  0  
  POL(p(x1))=  x1  

We have the following set D of usable symbols: {DIFF, 0, n0, p}
No Dependency Pairs can be deleted.
The following rules can be deleted as they contain symbols in their lhs which do not occur in D:

p(s(X)) -> X
10 non usable rules have been deleted.

The result of this processor delivers one new DP problem.



   R
DPs
       →DP Problem 1
SCP
       →DP Problem 2
MRR
           →DP Problem 3
Modular Removal of Rules


Dependency Pair:

DIFF(X, Y) -> DIFF(p(X), Y)


Rules:


p(0) -> 0
0 -> n0





We have the following set of usable rules:

p(0) -> 0
0 -> n0
To remove rules and DPs from this DP problem we used the following monotonic and CE-compatible order: Polynomial ordering.
Polynomial interpretation:
  POL(DIFF(x1, x2))=  1 + x1 + x2  
  POL(0)=  1  
  POL(n__0)=  0  
  POL(p(x1))=  x1  

We have the following set D of usable symbols: {DIFF, 0, n0, p}
No Dependency Pairs can be deleted.
The following rules can be deleted as the lhs is strictly greater than the corresponding rhs:

0 -> n0


The result of this processor delivers one new DP problem.



   R
DPs
       →DP Problem 1
SCP
       →DP Problem 2
MRR
           →DP Problem 3
MRR
             ...
               →DP Problem 4
Non-Overlappingness Check


Dependency Pair:

DIFF(X, Y) -> DIFF(p(X), Y)


Rule:


p(0) -> 0





R does not overlap into P. Moreover, R is locally confluent (all critical pairs are trivially joinable).Hence we can switch to innermost.
The transformation is resulting in one subcycle:


   R
DPs
       →DP Problem 1
SCP
       →DP Problem 2
MRR
           →DP Problem 3
MRR
             ...
               →DP Problem 5
Non Termination


Dependency Pair:

DIFF(X, Y) -> DIFF(p(X), Y)


Rule:


p(0) -> 0


Strategy:

innermost




Found an infinite P-chain over R:
P =

DIFF(X, Y) -> DIFF(p(X), Y)

R =

p(0) -> 0

s = DIFF(X, Y)
evaluates to t =DIFF(p(X), Y)

Thus, s starts an infinite chain as s matches t.

Non-Termination of R could be shown.
Duration:
0:01 minutes