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

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

p(0) -> 0
p(s(X)) -> X
leq(0, Y) -> true
leq(s(X), 0) -> false
leq(s(X), s(Y)) -> leq(X, Y)


   R
RRRI
       →TRS2
Dependency Pair Analysis



R contains the following Dependency Pairs:

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

Furthermore, R contains one SCC.


   R
RRRI
       →TRS2
DPs
           →DP Problem 1
Modular Removal of Rules


Dependency Pair:

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


Rules:


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





We have the following set of usable rules: none
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(p(x1))=  x1  

We have the following set D of usable symbols: {DIFF, p}
No Dependency Pairs can be deleted.
8 non usable rules have been deleted.

The result of this processor delivers one new DP problem.



   R
RRRI
       →TRS2
DPs
           →DP Problem 1
MRR
             ...
               →DP Problem 2
Non-Overlappingness Check


Dependency Pair:

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


Rule:

none





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
RRRI
       →TRS2
DPs
           →DP Problem 1
MRR
             ...
               →DP Problem 3
Non Termination


Dependency Pair:

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


Rule:

none


Strategy:

innermost




Found an infinite P-chain over R:
P =

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

R = none

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

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

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