The rewrite relation of the following TRS is considered.
| eq(0,0) | → | true | (1) |
| eq(0,s(X)) | → | false | (2) |
| eq(s(X),0) | → | false | (3) |
| eq(s(X),s(Y)) | → | eq(X,Y) | (4) |
| rm(N,nil) | → | nil | (5) |
| rm(N,add(M,X)) | → | ifrm(eq(N,M),N,add(M,X)) | (6) |
| ifrm(true,N,add(M,X)) | → | rm(N,X) | (7) |
| ifrm(false,N,add(M,X)) | → | add(M,rm(N,X)) | (8) |
| purge(nil) | → | nil | (9) |
| purge(add(N,X)) | → | add(N,purge(rm(N,X))) | (10) |
| eq#(s(X),s(Y)) | → | eq#(X,Y) | (11) |
| rm#(N,add(M,X)) | → | eq#(N,M) | (12) |
| rm#(N,add(M,X)) | → | ifrm#(eq(N,M),N,add(M,X)) | (13) |
| ifrm#(true,N,add(M,X)) | → | rm#(N,X) | (14) |
| ifrm#(false,N,add(M,X)) | → | rm#(N,X) | (15) |
| purge#(add(N,X)) | → | rm#(N,X) | (16) |
| purge#(add(N,X)) | → | purge#(rm(N,X)) | (17) |
The dependency pairs are split into 3 components.
| purge#(add(N,X)) | → | purge#(rm(N,X)) | (17) |
| π(purge#) | = | { 1 } |
| π(ifrm) | = | { 3, 3 } |
| π(add) | = | { 1, 2, 2 } |
| π(rm) | = | { 2, 2 } |
| π(s) | = | { 1 } |
| purge#(add(N,X)) | → | purge#(rm(N,X)) | (17) |
There are no pairs anymore.
| rm#(N,add(M,X)) | → | ifrm#(eq(N,M),N,add(M,X)) | (13) |
| ifrm#(true,N,add(M,X)) | → | rm#(N,X) | (14) |
| ifrm#(false,N,add(M,X)) | → | rm#(N,X) | (15) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
| rm#(N,add(M,X)) | → | ifrm#(eq(N,M),N,add(M,X)) | (13) |
| 2 | ≥ | 3 | |
| 1 | ≥ | 2 | |
| ifrm#(true,N,add(M,X)) | → | rm#(N,X) | (14) |
| 3 | > | 2 | |
| 2 | ≥ | 1 | |
| ifrm#(false,N,add(M,X)) | → | rm#(N,X) | (15) |
| 3 | > | 2 | |
| 2 | ≥ | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
| eq#(s(X),s(Y)) | → | eq#(X,Y) | (11) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
| eq#(s(X),s(Y)) | → | eq#(X,Y) | (11) |
| 2 | > | 2 | |
| 1 | > | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.