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,l1) | (5) |
ifappend(l1,l2,nil) | → | l2 | (6) |
ifappend(l1,l2,cons(x,l)) | → | cons(x,append(l,l2)) | (7) |
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
is_empty#(nil) |
is_empty#(cons(z0,z1)) |
hd#(cons(z0,z1)) |
tl#(cons(z0,z1)) |
append#(z0,z1) |
ifappend#(z0,z1,nil) |
ifappend#(z0,z1,cons(z2,z3)) |
is_empty(nil) | → | true | (1) |
is_empty(cons(z0,z1)) | → | false | (9) |
hd(cons(z0,z1)) | → | z0 | (11) |
tl(cons(z0,z1)) | → | z1 | (13) |
append(z0,z1) | → | ifappend(z0,z1,z0) | (15) |
ifappend(z0,z1,nil) | → | z1 | (17) |
ifappend(z0,z1,cons(z2,z3)) | → | cons(z2,append(z3,z1)) | (19) |
is_empty#(nil) | → | c | (8) |
is_empty#(cons(z0,z1)) | → | c1 | (10) |
hd#(cons(z0,z1)) | → | c2 | (12) |
tl#(cons(z0,z1)) | → | c3 | (14) |
append#(z0,z1) | → | c4(ifappend#(z0,z1,z0)) | (16) |
ifappend#(z0,z1,nil) | → | c5 | (18) |
[c] | = | 0 |
[c1] | = | 0 |
[c2] | = | 0 |
[c3] | = | 0 |
[c4(x1)] | = | 1 · x1 + 0 |
[c5] | = | 0 |
[c6(x1)] | = | 1 · x1 + 0 |
[is_empty#(x1)] | = | 1 + 1 · x1 |
[hd#(x1)] | = | 1 · x1 + 0 |
[tl#(x1)] | = | 1 · x1 + 0 |
[append#(x1, x2)] | = | 1 + 1 · x1 |
[ifappend#(x1, x2, x3)] | = | 1 · x3 + 0 |
[nil] | = | 1 |
[cons(x1, x2)] | = | 1 + 1 · x2 |
is_empty#(nil) | → | c | (8) |
is_empty#(cons(z0,z1)) | → | c1 | (10) |
hd#(cons(z0,z1)) | → | c2 | (12) |
tl#(cons(z0,z1)) | → | c3 | (14) |
append#(z0,z1) | → | c4(ifappend#(z0,z1,z0)) | (16) |
ifappend#(z0,z1,nil) | → | c5 | (18) |
ifappend#(z0,z1,cons(z2,z3)) | → | c6(append#(z3,z1)) | (20) |
ifappend#(z0,z1,cons(z2,z3)) | → | c6(append#(z3,z1)) | (20) |
[c] | = | 0 |
[c1] | = | 0 |
[c2] | = | 0 |
[c3] | = | 0 |
[c4(x1)] | = | 1 · x1 + 0 |
[c5] | = | 0 |
[c6(x1)] | = | 1 · x1 + 0 |
[is_empty#(x1)] | = | 0 |
[hd#(x1)] | = | 0 |
[tl#(x1)] | = | 0 |
[append#(x1, x2)] | = | 1 + 1 · x1 |
[ifappend#(x1, x2, x3)] | = | 1 + 1 · x3 |
[nil] | = | 0 |
[cons(x1, x2)] | = | 1 + 1 · x2 |
is_empty#(nil) | → | c | (8) |
is_empty#(cons(z0,z1)) | → | c1 | (10) |
hd#(cons(z0,z1)) | → | c2 | (12) |
tl#(cons(z0,z1)) | → | c3 | (14) |
append#(z0,z1) | → | c4(ifappend#(z0,z1,z0)) | (16) |
ifappend#(z0,z1,nil) | → | c5 | (18) |
ifappend#(z0,z1,cons(z2,z3)) | → | c6(append#(z3,z1)) | (20) |
There are no rules in the TRS R. Hence, R/S has complexity O(1).