The rewrite relation of the following TRS is considered.
p(0) | → | 0 | (1) |
p(s(x)) | → | x | (2) |
le(0,y) | → | true | (3) |
le(s(x),0) | → | false | (4) |
le(s(x),s(y)) | → | le(x,y) | (5) |
minus(x,0) | → | x | (6) |
minus(x,s(y)) | → | if(le(x,s(y)),0,p(minus(x,p(s(y))))) | (7) |
if(true,x,y) | → | x | (8) |
if(false,x,y) | → | y | (9) |
le#(s(x),s(y)) | → | le#(x,y) | (10) |
minus#(x,s(y)) | → | p#(s(y)) | (11) |
minus#(x,s(y)) | → | minus#(x,p(s(y))) | (12) |
minus#(x,s(y)) | → | p#(minus(x,p(s(y)))) | (13) |
minus#(x,s(y)) | → | le#(x,s(y)) | (14) |
minus#(x,s(y)) | → | if#(le(x,s(y)),0,p(minus(x,p(s(y))))) | (15) |
The dependency pairs are split into 2 components.
minus#(x,s(y)) | → | minus#(x,p(s(y))) | (12) |
[p(x1)] | = |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[minus#(x1, x2)] | = |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[s(x1)] | = |
|
p(s(x)) | → | x | (2) |
minus#(x,s(y)) | → | minus#(x,p(s(y))) | (12) |
There are no pairs anymore.
le#(s(x),s(y)) | → | le#(x,y) | (10) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
le#(s(x),s(y)) | → | le#(x,y) | (10) |
2 | > | 2 | |
1 | > | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.