The rewrite relation of the following TRS is considered.
rev(nil) | → | nil | (1) |
rev(.(x,y)) | → | ++(rev(y),.(x,nil)) | (2) |
car(.(x,y)) | → | x | (3) |
cdr(.(x,y)) | → | y | (4) |
null(nil) | → | true | (5) |
null(.(x,y)) | → | false | (6) |
++(nil,y) | → | y | (7) |
++(.(x,y),z) | → | .(x,++(y,z)) | (8) |
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
rev#(nil) |
rev#(.(z0,z1)) |
car#(.(z0,z1)) |
cdr#(.(z0,z1)) |
null#(nil) |
null#(.(z0,z1)) |
++#(nil,z0) |
++#(.(z0,z1),z2) |
car(.(z0,z1)) | → | z0 | (12) |
cdr(.(z0,z1)) | → | z1 | (14) |
null(nil) | → | true | (5) |
null(.(z0,z1)) | → | false | (17) |
rev#(nil) | → | c | (9) |
car#(.(z0,z1)) | → | c2 | (13) |
cdr#(.(z0,z1)) | → | c3 | (15) |
null#(nil) | → | c4 | (16) |
null#(.(z0,z1)) | → | c5 | (18) |
[c] | = | 0 |
[c1(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c2] | = | 0 |
[c3] | = | 0 |
[c4] | = | 0 |
[c5] | = | 0 |
[c6] | = | 0 |
[c7(x1)] | = | 1 · x1 + 0 |
[rev(x1)] | = | 1 + 1 · x1 |
[++(x1, x2)] | = | 1 + 1 · x2 |
[rev#(x1)] | = | 1 |
[car#(x1)] | = | 1 · x1 + 0 |
[cdr#(x1)] | = | 1 · x1 + 0 |
[null#(x1)] | = | 1 + 1 · x1 |
[++#(x1, x2)] | = | 0 |
[nil] | = | 1 |
[.(x1, x2)] | = | 1 |
rev#(nil) | → | c | (9) |
rev#(.(z0,z1)) | → | c1(++#(rev(z1),.(z0,nil)),rev#(z1)) | (11) |
car#(.(z0,z1)) | → | c2 | (13) |
cdr#(.(z0,z1)) | → | c3 | (15) |
null#(nil) | → | c4 | (16) |
null#(.(z0,z1)) | → | c5 | (18) |
++#(nil,z0) | → | c6 | (20) |
++#(.(z0,z1),z2) | → | c7(++#(z1,z2)) | (22) |
rev#(.(z0,z1)) | → | c1(++#(rev(z1),.(z0,nil)),rev#(z1)) | (11) |
[c] | = | 0 |
[c1(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c2] | = | 0 |
[c3] | = | 0 |
[c4] | = | 0 |
[c5] | = | 0 |
[c6] | = | 0 |
[c7(x1)] | = | 1 · x1 + 0 |
[rev(x1)] | = | 3 |
[++(x1, x2)] | = | 3 |
[rev#(x1)] | = | 1 · x1 + 0 |
[car#(x1)] | = | 0 |
[cdr#(x1)] | = | 0 |
[null#(x1)] | = | 0 |
[++#(x1, x2)] | = | 0 |
[nil] | = | 0 |
[.(x1, x2)] | = | 2 + 1 · x1 + 1 · x2 |
rev#(nil) | → | c | (9) |
rev#(.(z0,z1)) | → | c1(++#(rev(z1),.(z0,nil)),rev#(z1)) | (11) |
car#(.(z0,z1)) | → | c2 | (13) |
cdr#(.(z0,z1)) | → | c3 | (15) |
null#(nil) | → | c4 | (16) |
null#(.(z0,z1)) | → | c5 | (18) |
++#(nil,z0) | → | c6 | (20) |
++#(.(z0,z1),z2) | → | c7(++#(z1,z2)) | (22) |
++#(nil,z0) | → | c6 | (20) |
[c] | = | 0 |
[c1(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c2] | = | 0 |
[c3] | = | 0 |
[c4] | = | 0 |
[c5] | = | 0 |
[c6] | = | 0 |
[c7(x1)] | = | 1 · x1 + 0 |
[rev(x1)] | = | 1 + 1 · x1 |
[++(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[rev#(x1)] | = | 1 · x1 + 0 |
[car#(x1)] | = | 0 |
[cdr#(x1)] | = | 0 |
[null#(x1)] | = | 0 |
[++#(x1, x2)] | = | 1 |
[nil] | = | 0 |
[.(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
rev#(nil) | → | c | (9) |
rev#(.(z0,z1)) | → | c1(++#(rev(z1),.(z0,nil)),rev#(z1)) | (11) |
car#(.(z0,z1)) | → | c2 | (13) |
cdr#(.(z0,z1)) | → | c3 | (15) |
null#(nil) | → | c4 | (16) |
null#(.(z0,z1)) | → | c5 | (18) |
++#(nil,z0) | → | c6 | (20) |
++#(.(z0,z1),z2) | → | c7(++#(z1,z2)) | (22) |
++#(.(z0,z1),z2) | → | c7(++#(z1,z2)) | (22) |
[c] | = | 0 |
[c1(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c2] | = | 0 |
[c3] | = | 0 |
[c4] | = | 0 |
[c5] | = | 0 |
[c6] | = | 0 |
[c7(x1)] | = | 1 · x1 + 0 |
[rev(x1)] | = | 1 · x1 + 0 |
[++(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[rev#(x1)] | = | 1 · x1 · x1 + 0 |
[car#(x1)] | = | 0 |
[cdr#(x1)] | = | 0 |
[null#(x1)] | = | 0 |
[++#(x1, x2)] | = | 1 · x1 + 0 |
[nil] | = | 0 |
[.(x1, x2)] | = | 2 + 1 · x1 + 1 · x2 |
rev#(nil) | → | c | (9) |
rev#(.(z0,z1)) | → | c1(++#(rev(z1),.(z0,nil)),rev#(z1)) | (11) |
car#(.(z0,z1)) | → | c2 | (13) |
cdr#(.(z0,z1)) | → | c3 | (15) |
null#(nil) | → | c4 | (16) |
null#(.(z0,z1)) | → | c5 | (18) |
++#(nil,z0) | → | c6 | (20) |
++#(.(z0,z1),z2) | → | c7(++#(z1,z2)) | (22) |
rev(.(z0,z1)) | → | ++(rev(z1),.(z0,nil)) | (10) |
++(.(z0,z1),z2) | → | .(z0,++(z1,z2)) | (21) |
rev(nil) | → | nil | (1) |
++(nil,z0) | → | z0 | (19) |
There are no rules in the TRS R. Hence, R/S has complexity O(1).