The rewrite relation of the following TRS is considered.
| sort(nil) | → | nil | (1) |
| sort(cons(x,y)) | → | insert(x,sort(y)) | (2) |
| insert(x,nil) | → | cons(x,nil) | (3) |
| insert(x,cons(v,w)) | → | choose(x,cons(v,w),x,v) | (4) |
| choose(x,cons(v,w),y,0) | → | cons(x,cons(v,w)) | (5) |
| choose(x,cons(v,w),0,s(z)) | → | cons(v,insert(x,w)) | (6) |
| choose(x,cons(v,w),s(y),s(z)) | → | choose(x,cons(v,w),y,z) | (7) |
| sort#(cons(x,y)) | → | sort#(y) | (8) |
| sort#(cons(x,y)) | → | insert#(x,sort(y)) | (9) |
| insert#(x,cons(v,w)) | → | choose#(x,cons(v,w),x,v) | (10) |
| choose#(x,cons(v,w),0,s(z)) | → | insert#(x,w) | (11) |
| choose#(x,cons(v,w),s(y),s(z)) | → | choose#(x,cons(v,w),y,z) | (12) |
The dependency pairs are split into 2 components.
| sort#(cons(x,y)) | → | sort#(y) | (8) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
| sort#(cons(x,y)) | → | sort#(y) | (8) |
| 1 | > | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
| choose#(x,cons(v,w),s(y),s(z)) | → | choose#(x,cons(v,w),y,z) | (12) |
| choose#(x,cons(v,w),0,s(z)) | → | insert#(x,w) | (11) |
| insert#(x,cons(v,w)) | → | choose#(x,cons(v,w),x,v) | (10) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
| choose#(x,cons(v,w),s(y),s(z)) | → | choose#(x,cons(v,w),y,z) | (12) |
| 4 | > | 4 | |
| 3 | > | 3 | |
| 2 | ≥ | 2 | |
| 1 | ≥ | 1 | |
| choose#(x,cons(v,w),0,s(z)) | → | insert#(x,w) | (11) |
| 2 | > | 2 | |
| 1 | ≥ | 1 | |
| insert#(x,cons(v,w)) | → | choose#(x,cons(v,w),x,v) | (10) |
| 2 | > | 4 | |
| 2 | ≥ | 2 | |
| 1 | ≥ | 3 | |
| 1 | ≥ | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.