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