The rewrite relation of the following TRS is considered.
is_empty(nil) | → | true | (1) |
is_empty(cons(x,l)) | → | false | (2) |
hd(cons(x,l)) | → | x | (3) |
tl(cons(x,l)) | → | l | (4) |
append(l1,l2) | → | ifappend(l1,l2,is_empty(l1)) | (5) |
ifappend(l1,l2,true) | → | l2 | (6) |
ifappend(l1,l2,false) | → | cons(hd(l1),append(tl(l1),l2)) | (7) |
The TRS is overlay and locally confluent:
10Hence, it suffices to show innermost termination in the following.
append#(l1,l2) | → | ifappend#(l1,l2,is_empty(l1)) | (8) |
append#(l1,l2) | → | is_empty#(l1) | (9) |
ifappend#(l1,l2,false) | → | hd#(l1) | (10) |
ifappend#(l1,l2,false) | → | append#(tl(l1),l2) | (11) |
ifappend#(l1,l2,false) | → | tl#(l1) | (12) |
The dependency pairs are split into 1 component.
ifappend#(l1,l2,false) | → | append#(tl(l1),l2) | (11) |
append#(l1,l2) | → | ifappend#(l1,l2,is_empty(l1)) | (8) |
We restrict the rewrite rules to the following usable rules of the DP problem.
is_empty(nil) | → | true | (1) |
is_empty(cons(x,l)) | → | false | (2) |
tl(cons(x,l)) | → | l | (4) |
We restrict the innermost strategy to the following left hand sides.
is_empty(nil) |
is_empty(cons(x0,x1)) |
tl(cons(x0,x1)) |
[ifappend#(x1, x2, x3)] | = | 0 + 1 · x1 + 0 · x2 + 1/4 · x3 |
[false] | = | 4 |
[append#(x1, x2)] | = | 1/2 + 2 · x1 + 0 · x2 |
[tl(x1)] | = | 1/4 + 1/2 · x1 |
[is_empty(x1)] | = | 1/4 + 4 · x1 |
[cons(x1, x2)] | = | 2 + 0 · x1 + 2 · x2 |
[nil] | = | 2 |
[true] | = | 2 |
append#(l1,l2) | → | ifappend#(l1,l2,is_empty(l1)) | (8) |
We restrict the rewrite rules to the following usable rules of the DP problem.
tl(cons(x,l)) | → | l | (4) |
We restrict the innermost strategy to the following left hand sides.
tl(cons(x0,x1)) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
ifappend#(l1,l2,false) | → | append#(tl(l1),l2) | (11) |
2 | ≥ | 2 |
As there is no critical graph in the transitive closure, there are no infinite chains.