The rewrite relation of the following TRS is considered.
duplicate(Cons(x,xs)) | → | Cons(x,Cons(x,duplicate(xs))) | (1) |
duplicate(Nil) | → | Nil | (2) |
goal(x) | → | duplicate(x) | (3) |
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
duplicate#(Cons(z0,z1)) |
duplicate#(Nil) |
goal#(z0) |
duplicate(Cons(z0,z1)) | → | Cons(z0,Cons(z0,duplicate(z1))) | (4) |
duplicate(Nil) | → | Nil | (2) |
goal(z0) | → | duplicate(z0) | (7) |
duplicate#(Cons(z0,z1)) | → | c(duplicate#(z1)) | (5) |
duplicate#(Nil) | → | c1 | (6) |
goal#(z0) | → | c2(duplicate#(z0)) | (8) |
[c(x1)] | = | 1 · x1 + 0 |
[c1] | = | 0 |
[c2(x1)] | = | 1 · x1 + 0 |
[duplicate#(x1)] | = | 1 · x1 + 0 |
[goal#(x1)] | = | 1 + 1 · x1 |
[Cons(x1, x2)] | = | 1 + 1 · x2 |
[Nil] | = | 1 |
duplicate#(Cons(z0,z1)) | → | c(duplicate#(z1)) | (5) |
duplicate#(Nil) | → | c1 | (6) |
goal#(z0) | → | c2(duplicate#(z0)) | (8) |
There are no rules in the TRS R. Hence, R/S has complexity O(1).