The rewrite relation of the following TRS is considered.
bsort(nil) | → | nil | (1) |
bsort(.(x,y)) | → | last(.(bubble(.(x,y)),bsort(butlast(bubble(.(x,y)))))) | (2) |
bubble(nil) | → | nil | (3) |
bubble(.(x,nil)) | → | .(x,nil) | (4) |
bubble(.(x,.(y,z))) | → | if(<=(x,y),.(y,bubble(.(x,z))),.(x,bubble(.(y,z)))) | (5) |
last(nil) | → | 0 | (6) |
last(.(x,nil)) | → | x | (7) |
last(.(x,.(y,z))) | → | last(.(y,z)) | (8) |
butlast(nil) | → | nil | (9) |
butlast(.(x,nil)) | → | nil | (10) |
butlast(.(x,.(y,z))) | → | .(x,butlast(.(y,z))) | (11) |
bsort#(.(x,y)) | → | butlast#(bubble(.(x,y))) | (12) |
bsort#(.(x,y)) | → | bsort#(butlast(bubble(.(x,y)))) | (13) |
bsort#(.(x,y)) | → | bubble#(.(x,y)) | (14) |
bsort#(.(x,y)) | → | last#(.(bubble(.(x,y)),bsort(butlast(bubble(.(x,y)))))) | (15) |
bubble#(.(x,.(y,z))) | → | bubble#(.(y,z)) | (16) |
bubble#(.(x,.(y,z))) | → | bubble#(.(x,z)) | (17) |
last#(.(x,.(y,z))) | → | last#(.(y,z)) | (18) |
butlast#(.(x,.(y,z))) | → | butlast#(.(y,z)) | (19) |
The dependency pairs are split into 4 components.
bsort#(.(x,y)) | → | bsort#(butlast(bubble(.(x,y)))) | (13) |
[butlast(x1)] | = | -1 · x1 + 0 |
[bubble(x1)] | = | -∞ · x1 + 1 |
[nil] | = | 0 |
[if(x1, x2, x3)] | = | -∞ · x1 + -∞ · x2 + -5 · x3 + 0 |
[bsort#(x1)] | = | 0 · x1 + 0 |
[<=(x1, x2)] | = | 0 · x1 + 1 · x2 + 2 |
[.(x1, x2)] | = | -∞ · x1 + 1 · x2 + 1 |
bubble(.(x,nil)) | → | .(x,nil) | (4) |
bubble(.(x,.(y,z))) | → | if(<=(x,y),.(y,bubble(.(x,z))),.(x,bubble(.(y,z)))) | (5) |
butlast(nil) | → | nil | (9) |
butlast(.(x,nil)) | → | nil | (10) |
butlast(.(x,.(y,z))) | → | .(x,butlast(.(y,z))) | (11) |
bsort#(.(x,y)) | → | bsort#(butlast(bubble(.(x,y)))) | (13) |
There are no pairs anymore.
butlast#(.(x,.(y,z))) | → | butlast#(.(y,z)) | (19) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
butlast#(.(x,.(y,z))) | → | butlast#(.(y,z)) | (19) |
1 | > | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
bubble#(.(x,.(y,z))) | → | bubble#(.(y,z)) | (16) |
bubble#(.(x,.(y,z))) | → | bubble#(.(x,z)) | (17) |
[bubble#(x1)] | = | 0 · x1 + -∞ |
[.(x1, x2)] | = | -∞ · x1 + 2 · x2 + -3 |
bubble#(.(x,.(y,z))) | → | bubble#(.(y,z)) | (16) |
prec(bubble#) | = | 0 | stat(bubble#) | = | lex | |
prec(.) | = | 0 | stat(.) | = | lex |
π(bubble#) | = | [1] |
π(.) | = | [2] |
bubble#(.(x,.(y,z))) | → | bubble#(.(x,z)) | (17) |
There are no pairs anymore.
last#(.(x,.(y,z))) | → | last#(.(y,z)) | (18) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
last#(.(x,.(y,z))) | → | last#(.(y,z)) | (18) |
1 | > | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.