The rewrite relation of the following TRS is considered.
shuffle(Cons(x,xs)) | → | Cons(x,shuffle(reverse(xs))) | (1) |
reverse(Cons(x,xs)) | → | append(reverse(xs),Cons(x,Nil)) | (2) |
append(Cons(x,xs),ys) | → | Cons(x,append(xs,ys)) | (3) |
shuffle(Nil) | → | Nil | (4) |
reverse(Nil) | → | Nil | (5) |
append(Nil,ys) | → | ys | (6) |
goal(xs) | → | shuffle(xs) | (7) |
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
shuffle#(Cons(z0,z1)) |
shuffle#(Nil) |
reverse#(Cons(z0,z1)) |
reverse#(Nil) |
append#(Cons(z0,z1),z2) |
append#(Nil,z0) |
goal#(z0) |
shuffle(Cons(z0,z1)) | → | Cons(z0,shuffle(reverse(z1))) | (8) |
shuffle(Nil) | → | Nil | (4) |
goal(z0) | → | shuffle(z0) | (18) |
goal#(z0) | → | c6(shuffle#(z0)) | (19) |
[c(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c1] | = | 0 |
[c2(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c3] | = | 0 |
[c4(x1)] | = | 1 · x1 + 0 |
[c5] | = | 0 |
[c6(x1)] | = | 1 · x1 + 0 |
[reverse(x1)] | = | 1 |
[append(x1, x2)] | = | 1 · x2 + 0 |
[shuffle#(x1)] | = | 0 |
[reverse#(x1)] | = | 0 |
[append#(x1, x2)] | = | 3 · x2 + 0 |
[goal#(x1)] | = | 1 |
[Cons(x1, x2)] | = | 0 |
[Nil] | = | 0 |
shuffle#(Cons(z0,z1)) | → | c(shuffle#(reverse(z1)),reverse#(z1)) | (9) |
shuffle#(Nil) | → | c1 | (10) |
reverse#(Cons(z0,z1)) | → | c2(append#(reverse(z1),Cons(z0,Nil)),reverse#(z1)) | (12) |
reverse#(Nil) | → | c3 | (13) |
append#(Cons(z0,z1),z2) | → | c4(append#(z1,z2)) | (15) |
append#(Nil,z0) | → | c5 | (17) |
goal#(z0) | → | c6(shuffle#(z0)) | (19) |
shuffle#(Nil) | → | c1 | (10) |
[c(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c1] | = | 0 |
[c2(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c3] | = | 0 |
[c4(x1)] | = | 1 · x1 + 0 |
[c5] | = | 0 |
[c6(x1)] | = | 1 · x1 + 0 |
[reverse(x1)] | = | 1 |
[append(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
[shuffle#(x1)] | = | 1 |
[reverse#(x1)] | = | 0 |
[append#(x1, x2)] | = | 0 |
[goal#(x1)] | = | 1 |
[Cons(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
[Nil] | = | 1 |
shuffle#(Cons(z0,z1)) | → | c(shuffle#(reverse(z1)),reverse#(z1)) | (9) |
shuffle#(Nil) | → | c1 | (10) |
reverse#(Cons(z0,z1)) | → | c2(append#(reverse(z1),Cons(z0,Nil)),reverse#(z1)) | (12) |
reverse#(Nil) | → | c3 | (13) |
append#(Cons(z0,z1),z2) | → | c4(append#(z1,z2)) | (15) |
append#(Nil,z0) | → | c5 | (17) |
goal#(z0) | → | c6(shuffle#(z0)) | (19) |
reverse#(Nil) | → | c3 | (13) |
[c(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c1] | = | 0 |
[c2(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c3] | = | 0 |
[c4(x1)] | = | 1 · x1 + 0 |
[c5] | = | 0 |
[c6(x1)] | = | 1 · x1 + 0 |
[reverse(x1)] | = | 1 · x1 + 0 |
[append(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[shuffle#(x1)] | = | 1 + 1 · x1 |
[reverse#(x1)] | = | 1 |
[append#(x1, x2)] | = | 0 |
[goal#(x1)] | = | 1 + 1 · x1 |
[Cons(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
[Nil] | = | 0 |
shuffle#(Cons(z0,z1)) | → | c(shuffle#(reverse(z1)),reverse#(z1)) | (9) |
shuffle#(Nil) | → | c1 | (10) |
reverse#(Cons(z0,z1)) | → | c2(append#(reverse(z1),Cons(z0,Nil)),reverse#(z1)) | (12) |
reverse#(Nil) | → | c3 | (13) |
append#(Cons(z0,z1),z2) | → | c4(append#(z1,z2)) | (15) |
append#(Nil,z0) | → | c5 | (17) |
goal#(z0) | → | c6(shuffle#(z0)) | (19) |
append(Cons(z0,z1),z2) | → | Cons(z0,append(z1,z2)) | (14) |
reverse(Cons(z0,z1)) | → | append(reverse(z1),Cons(z0,Nil)) | (11) |
reverse(Nil) | → | Nil | (5) |
append(Nil,z0) | → | z0 | (16) |
shuffle#(Cons(z0,z1)) | → | c(shuffle#(reverse(z1)),reverse#(z1)) | (9) |
[c(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c1] | = | 0 |
[c2(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c3] | = | 0 |
[c4(x1)] | = | 1 · x1 + 0 |
[c5] | = | 0 |
[c6(x1)] | = | 1 · x1 + 0 |
[reverse(x1)] | = | 1 · x1 + 0 |
[append(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[shuffle#(x1)] | = | 3 + 2 · x1 |
[reverse#(x1)] | = | 1 |
[append#(x1, x2)] | = | 0 |
[goal#(x1)] | = | 3 + 2 · x1 |
[Cons(x1, x2)] | = | 2 + 1 · x1 + 1 · x2 |
[Nil] | = | 0 |
shuffle#(Cons(z0,z1)) | → | c(shuffle#(reverse(z1)),reverse#(z1)) | (9) |
shuffle#(Nil) | → | c1 | (10) |
reverse#(Cons(z0,z1)) | → | c2(append#(reverse(z1),Cons(z0,Nil)),reverse#(z1)) | (12) |
reverse#(Nil) | → | c3 | (13) |
append#(Cons(z0,z1),z2) | → | c4(append#(z1,z2)) | (15) |
append#(Nil,z0) | → | c5 | (17) |
goal#(z0) | → | c6(shuffle#(z0)) | (19) |
append(Cons(z0,z1),z2) | → | Cons(z0,append(z1,z2)) | (14) |
reverse(Cons(z0,z1)) | → | append(reverse(z1),Cons(z0,Nil)) | (11) |
reverse(Nil) | → | Nil | (5) |
append(Nil,z0) | → | z0 | (16) |
reverse#(Cons(z0,z1)) | → | c2(append#(reverse(z1),Cons(z0,Nil)),reverse#(z1)) | (12) |
append#(Nil,z0) | → | c5 | (17) |
[c(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c1] | = | 0 |
[c2(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c3] | = | 0 |
[c4(x1)] | = | 1 · x1 + 0 |
[c5] | = | 0 |
[c6(x1)] | = | 1 · x1 + 0 |
[reverse(x1)] | = | 1 · x1 + 0 |
[append(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[shuffle#(x1)] | = | 2 + 2 · x1 · x1 |
[reverse#(x1)] | = | 2 · x1 + 0 |
[append#(x1, x2)] | = | 1 + 1 · x2 |
[goal#(x1)] | = | 2 + 1 · x1 + 2 · x1 · x1 |
[Cons(x1, x2)] | = | 2 + 1 · x2 |
[Nil] | = | 0 |
shuffle#(Cons(z0,z1)) | → | c(shuffle#(reverse(z1)),reverse#(z1)) | (9) |
shuffle#(Nil) | → | c1 | (10) |
reverse#(Cons(z0,z1)) | → | c2(append#(reverse(z1),Cons(z0,Nil)),reverse#(z1)) | (12) |
reverse#(Nil) | → | c3 | (13) |
append#(Cons(z0,z1),z2) | → | c4(append#(z1,z2)) | (15) |
append#(Nil,z0) | → | c5 | (17) |
goal#(z0) | → | c6(shuffle#(z0)) | (19) |
append(Cons(z0,z1),z2) | → | Cons(z0,append(z1,z2)) | (14) |
reverse(Cons(z0,z1)) | → | append(reverse(z1),Cons(z0,Nil)) | (11) |
reverse(Nil) | → | Nil | (5) |
append(Nil,z0) | → | z0 | (16) |
append#(Cons(z0,z1),z2) | → | c4(append#(z1,z2)) | (15) |
[c(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c1] | = | 0 |
[c2(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c3] | = | 0 |
[c4(x1)] | = | 1 · x1 + 0 |
[c5] | = | 0 |
[c6(x1)] | = | 1 · x1 + 0 |
[reverse(x1)] | = | 1 · x1 + 0 |
[append(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[shuffle#(x1)] | = | 1 + 1 · x1 · x1 + 1 · x1 · x1 · x1 |
[reverse#(x1)] | = | 1 + 1 · x1 · x1 |
[append#(x1, x2)] | = | 1 · x1 + 0 |
[goal#(x1)] | = | 1 + 1 · x1 · x1 + 1 · x1 · x1 · x1 |
[Cons(x1, x2)] | = | 1 + 1 · x2 |
[Nil] | = | 0 |
shuffle#(Cons(z0,z1)) | → | c(shuffle#(reverse(z1)),reverse#(z1)) | (9) |
shuffle#(Nil) | → | c1 | (10) |
reverse#(Cons(z0,z1)) | → | c2(append#(reverse(z1),Cons(z0,Nil)),reverse#(z1)) | (12) |
reverse#(Nil) | → | c3 | (13) |
append#(Cons(z0,z1),z2) | → | c4(append#(z1,z2)) | (15) |
append#(Nil,z0) | → | c5 | (17) |
goal#(z0) | → | c6(shuffle#(z0)) | (19) |
append(Cons(z0,z1),z2) | → | Cons(z0,append(z1,z2)) | (14) |
reverse(Cons(z0,z1)) | → | append(reverse(z1),Cons(z0,Nil)) | (11) |
reverse(Nil) | → | Nil | (5) |
append(Nil,z0) | → | z0 | (16) |
There are no rules in the TRS R. Hence, R/S has complexity O(1).