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