The rewrite relation of the following TRS is considered.
f(empty,l) | → | l | (1) |
f(cons(x,k),l) | → | g(k,l,cons(x,k)) | (2) |
g(a,b,c) | → | f(a,cons(b,c)) | (3) |
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
f#(empty,z0) |
f#(cons(z0,z1),z2) |
g#(z0,z1,z2) |
f(empty,z0) | → | z0 | (4) |
f(cons(z0,z1),z2) | → | g(z1,z2,cons(z0,z1)) | (6) |
g(z0,z1,z2) | → | f(z0,cons(z1,z2)) | (8) |
f#(empty,z0) | → | c | (5) |
[c] | = | 0 |
[c1(x1)] | = | 1 · x1 + 0 |
[c2(x1)] | = | 1 · x1 + 0 |
[f#(x1, x2)] | = | 2 · x1 + 0 |
[g#(x1, x2, x3)] | = | 2 · x1 + 0 |
[empty] | = | 3 |
[cons(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
f#(empty,z0) | → | c | (5) |
f#(cons(z0,z1),z2) | → | c1(g#(z1,z2,cons(z0,z1))) | (7) |
g#(z0,z1,z2) | → | c2(f#(z0,cons(z1,z2))) | (9) |
f#(cons(z0,z1),z2) | → | c1(g#(z1,z2,cons(z0,z1))) | (7) |
g#(z0,z1,z2) | → | c2(f#(z0,cons(z1,z2))) | (9) |
[c] | = | 0 |
[c1(x1)] | = | 1 · x1 + 0 |
[c2(x1)] | = | 1 · x1 + 0 |
[f#(x1, x2)] | = | 2 · x1 + 0 |
[g#(x1, x2, x3)] | = | 3 + 2 · x1 |
[empty] | = | 0 |
[cons(x1, x2)] | = | 2 + 1 · x1 + 1 · x2 |
f#(empty,z0) | → | c | (5) |
f#(cons(z0,z1),z2) | → | c1(g#(z1,z2,cons(z0,z1))) | (7) |
g#(z0,z1,z2) | → | c2(f#(z0,cons(z1,z2))) | (9) |
There are no rules in the TRS R. Hence, R/S has complexity O(1).