The rewrite relation of the following TRS is considered.
minus(x,0) |
→ |
x |
(1) |
minus(s(x),s(y)) |
→ |
minus(x,y) |
(2) |
quot(0,s(y)) |
→ |
0 |
(3) |
quot(s(x),s(y)) |
→ |
s(quot(minus(x,y),s(y))) |
(4) |
app(nil,y) |
→ |
y |
(5) |
app(add(n,x),y) |
→ |
add(n,app(x,y)) |
(6) |
reverse(nil) |
→ |
nil |
(7) |
reverse(add(n,x)) |
→ |
app(reverse(x),add(n,nil)) |
(8) |
shuffle(nil) |
→ |
nil |
(9) |
shuffle(add(n,x)) |
→ |
add(n,shuffle(reverse(x))) |
(10) |
concat(leaf,y) |
→ |
y |
(11) |
concat(cons(u,v),y) |
→ |
cons(u,concat(v,y)) |
(12) |
less_leaves(x,leaf) |
→ |
false |
(13) |
less_leaves(leaf,cons(w,z)) |
→ |
true |
(14) |
less_leaves(cons(u,v),cons(w,z)) |
→ |
less_leaves(concat(u,v),concat(w,z)) |
(15) |
The evaluation strategy is innermost.
|
originates from |
|
minus#(s(z0),s(z1)) |
→ |
c1(minus#(z0,z1)) |
(19) |
|
originates from |
minus(s(z0),s(z1)) |
→ |
minus(z0,z1) |
(18) |
|
|
originates from |
|
quot#(s(z0),s(z1)) |
→ |
c3(quot#(minus(z0,z1),s(z1)),minus#(z0,z1)) |
(23) |
|
originates from |
quot(s(z0),s(z1)) |
→ |
s(quot(minus(z0,z1),s(z1))) |
(22) |
|
|
originates from |
|
app#(add(z0,z1),z2) |
→ |
c5(app#(z1,z2)) |
(27) |
|
originates from |
app(add(z0,z1),z2) |
→ |
add(z0,app(z1,z2)) |
(26) |
|
|
originates from |
|
reverse#(add(z0,z1)) |
→ |
c7(app#(reverse(z1),add(z0,nil)),reverse#(z1)) |
(30) |
|
originates from |
reverse(add(z0,z1)) |
→ |
app(reverse(z1),add(z0,nil)) |
(29) |
|
|
originates from |
|
shuffle#(add(z0,z1)) |
→ |
c9(shuffle#(reverse(z1)),reverse#(z1)) |
(33) |
|
originates from |
shuffle(add(z0,z1)) |
→ |
add(z0,shuffle(reverse(z1))) |
(32) |
|
concat#(leaf,z0) |
→ |
c10 |
(35) |
|
originates from |
concat(leaf,z0) |
→ |
z0 |
(34) |
|
concat#(cons(z0,z1),z2) |
→ |
c11(concat#(z1,z2)) |
(37) |
|
originates from |
concat(cons(z0,z1),z2) |
→ |
cons(z0,concat(z1,z2)) |
(36) |
|
less_leaves#(z0,leaf) |
→ |
c12 |
(39) |
|
originates from |
less_leaves(z0,leaf) |
→ |
false |
(38) |
|
less_leaves#(leaf,cons(z0,z1)) |
→ |
c13 |
(41) |
|
originates from |
less_leaves(leaf,cons(z0,z1)) |
→ |
true |
(40) |
|
less_leaves#(cons(z0,z1),cons(z2,z3)) |
→ |
c14(less_leaves#(concat(z0,z1),concat(z2,z3)),concat#(z0,z1),concat#(z2,z3)) |
(43) |
|
originates from |
less_leaves(cons(z0,z1),cons(z2,z3)) |
→ |
less_leaves(concat(z0,z1),concat(z2,z3)) |
(42) |
|
Moreover, we add the following terms to the innermost strategy.
quot(0,s(z0)) |
→ |
0 |
(20) |
quot(s(z0),s(z1)) |
→ |
s(quot(minus(z0,z1),s(z1))) |
(22) |
shuffle(nil) |
→ |
nil |
(9) |
shuffle(add(z0,z1)) |
→ |
add(z0,shuffle(reverse(z1))) |
(32) |
less_leaves(z0,leaf) |
→ |
false |
(38) |
less_leaves(leaf,cons(z0,z1)) |
→ |
true |
(40) |
less_leaves(cons(z0,z1),cons(z2,z3)) |
→ |
less_leaves(concat(z0,z1),concat(z2,z3)) |
(42) |
minus#(z0,0) |
→ |
c |
(17) |
minus#(s(z0),s(z1)) |
→ |
c1(minus#(z0,z1)) |
(19) |
quot#(0,s(z0)) |
→ |
c2 |
(21) |
quot#(s(z0),s(z1)) |
→ |
c3(quot#(minus(z0,z1),s(z1)),minus#(z0,z1)) |
(23) |
app#(nil,z0) |
→ |
c4 |
(25) |
app#(add(z0,z1),z2) |
→ |
c5(app#(z1,z2)) |
(27) |
reverse#(nil) |
→ |
c6 |
(28) |
reverse#(add(z0,z1)) |
→ |
c7(app#(reverse(z1),add(z0,nil)),reverse#(z1)) |
(30) |
shuffle#(nil) |
→ |
c8 |
(31) |
shuffle#(add(z0,z1)) |
→ |
c9(shuffle#(reverse(z1)),reverse#(z1)) |
(33) |
concat#(leaf,z0) |
→ |
c10 |
(35) |
concat#(cons(z0,z1),z2) |
→ |
c11(concat#(z1,z2)) |
(37) |
less_leaves#(z0,leaf) |
→ |
c12 |
(39) |
less_leaves#(leaf,cons(z0,z1)) |
→ |
c13 |
(41) |
less_leaves#(cons(z0,z1),cons(z2,z3)) |
→ |
c14(less_leaves#(concat(z0,z1),concat(z2,z3)),concat#(z0,z1),concat#(z2,z3)) |
(43) |
minus#(z0,0) |
→ |
c |
(17) |
minus#(s(z0),s(z1)) |
→ |
c1(minus#(z0,z1)) |
(19) |
quot#(0,s(z0)) |
→ |
c2 |
(21) |
quot#(s(z0),s(z1)) |
→ |
c3(quot#(minus(z0,z1),s(z1)),minus#(z0,z1)) |
(23) |
app#(nil,z0) |
→ |
c4 |
(25) |
app#(add(z0,z1),z2) |
→ |
c5(app#(z1,z2)) |
(27) |
reverse#(nil) |
→ |
c6 |
(28) |
reverse#(add(z0,z1)) |
→ |
c7(app#(reverse(z1),add(z0,nil)),reverse#(z1)) |
(30) |
shuffle#(nil) |
→ |
c8 |
(31) |
shuffle#(add(z0,z1)) |
→ |
c9(shuffle#(reverse(z1)),reverse#(z1)) |
(33) |
concat#(leaf,z0) |
→ |
c10 |
(35) |
concat#(cons(z0,z1),z2) |
→ |
c11(concat#(z1,z2)) |
(37) |
less_leaves#(z0,leaf) |
→ |
c12 |
(39) |
less_leaves#(leaf,cons(z0,z1)) |
→ |
c13 |
(41) |
less_leaves#(cons(z0,z1),cons(z2,z3)) |
→ |
c14(less_leaves#(concat(z0,z1),concat(z2,z3)),concat#(z0,z1),concat#(z2,z3)) |
(43) |
concat(leaf,z0) |
→ |
z0 |
(34) |
concat(cons(z0,z1),z2) |
→ |
cons(z0,concat(z1,z2)) |
(36) |
minus(s(z0),s(z1)) |
→ |
minus(z0,z1) |
(18) |
minus(z0,0) |
→ |
z0 |
(16) |
minus#(z0,0) |
→ |
c |
(17) |
minus#(s(z0),s(z1)) |
→ |
c1(minus#(z0,z1)) |
(19) |
quot#(0,s(z0)) |
→ |
c2 |
(21) |
quot#(s(z0),s(z1)) |
→ |
c3(quot#(minus(z0,z1),s(z1)),minus#(z0,z1)) |
(23) |
app#(nil,z0) |
→ |
c4 |
(25) |
app#(add(z0,z1),z2) |
→ |
c5(app#(z1,z2)) |
(27) |
reverse#(nil) |
→ |
c6 |
(28) |
reverse#(add(z0,z1)) |
→ |
c7(app#(reverse(z1),add(z0,nil)),reverse#(z1)) |
(30) |
shuffle#(nil) |
→ |
c8 |
(31) |
shuffle#(add(z0,z1)) |
→ |
c9(shuffle#(reverse(z1)),reverse#(z1)) |
(33) |
concat#(leaf,z0) |
→ |
c10 |
(35) |
concat#(cons(z0,z1),z2) |
→ |
c11(concat#(z1,z2)) |
(37) |
less_leaves#(z0,leaf) |
→ |
c12 |
(39) |
less_leaves#(leaf,cons(z0,z1)) |
→ |
c13 |
(41) |
less_leaves#(cons(z0,z1),cons(z2,z3)) |
→ |
c14(less_leaves#(concat(z0,z1),concat(z2,z3)),concat#(z0,z1),concat#(z2,z3)) |
(43) |
reverse(nil) |
→ |
nil |
(7) |
app(add(z0,z1),z2) |
→ |
add(z0,app(z1,z2)) |
(26) |
concat(leaf,z0) |
→ |
z0 |
(34) |
app(nil,z0) |
→ |
z0 |
(24) |
reverse(add(z0,z1)) |
→ |
app(reverse(z1),add(z0,nil)) |
(29) |
concat(cons(z0,z1),z2) |
→ |
cons(z0,concat(z1,z2)) |
(36) |
minus(s(z0),s(z1)) |
→ |
minus(z0,z1) |
(18) |
minus(z0,0) |
→ |
z0 |
(16) |
minus#(z0,0) |
→ |
c |
(17) |
minus#(s(z0),s(z1)) |
→ |
c1(minus#(z0,z1)) |
(19) |
quot#(0,s(z0)) |
→ |
c2 |
(21) |
quot#(s(z0),s(z1)) |
→ |
c3(quot#(minus(z0,z1),s(z1)),minus#(z0,z1)) |
(23) |
app#(nil,z0) |
→ |
c4 |
(25) |
app#(add(z0,z1),z2) |
→ |
c5(app#(z1,z2)) |
(27) |
reverse#(nil) |
→ |
c6 |
(28) |
reverse#(add(z0,z1)) |
→ |
c7(app#(reverse(z1),add(z0,nil)),reverse#(z1)) |
(30) |
shuffle#(nil) |
→ |
c8 |
(31) |
shuffle#(add(z0,z1)) |
→ |
c9(shuffle#(reverse(z1)),reverse#(z1)) |
(33) |
concat#(leaf,z0) |
→ |
c10 |
(35) |
concat#(cons(z0,z1),z2) |
→ |
c11(concat#(z1,z2)) |
(37) |
less_leaves#(z0,leaf) |
→ |
c12 |
(39) |
less_leaves#(leaf,cons(z0,z1)) |
→ |
c13 |
(41) |
less_leaves#(cons(z0,z1),cons(z2,z3)) |
→ |
c14(less_leaves#(concat(z0,z1),concat(z2,z3)),concat#(z0,z1),concat#(z2,z3)) |
(43) |
reverse(nil) |
→ |
nil |
(7) |
app(add(z0,z1),z2) |
→ |
add(z0,app(z1,z2)) |
(26) |
app(nil,z0) |
→ |
z0 |
(24) |
reverse(add(z0,z1)) |
→ |
app(reverse(z1),add(z0,nil)) |
(29) |
minus(s(z0),s(z1)) |
→ |
minus(z0,z1) |
(18) |
minus(z0,0) |
→ |
z0 |
(16) |
minus#(z0,0) |
→ |
c |
(17) |
minus#(s(z0),s(z1)) |
→ |
c1(minus#(z0,z1)) |
(19) |
quot#(0,s(z0)) |
→ |
c2 |
(21) |
quot#(s(z0),s(z1)) |
→ |
c3(quot#(minus(z0,z1),s(z1)),minus#(z0,z1)) |
(23) |
app#(nil,z0) |
→ |
c4 |
(25) |
app#(add(z0,z1),z2) |
→ |
c5(app#(z1,z2)) |
(27) |
reverse#(nil) |
→ |
c6 |
(28) |
reverse#(add(z0,z1)) |
→ |
c7(app#(reverse(z1),add(z0,nil)),reverse#(z1)) |
(30) |
shuffle#(nil) |
→ |
c8 |
(31) |
shuffle#(add(z0,z1)) |
→ |
c9(shuffle#(reverse(z1)),reverse#(z1)) |
(33) |
concat#(leaf,z0) |
→ |
c10 |
(35) |
concat#(cons(z0,z1),z2) |
→ |
c11(concat#(z1,z2)) |
(37) |
less_leaves#(z0,leaf) |
→ |
c12 |
(39) |
less_leaves#(leaf,cons(z0,z1)) |
→ |
c13 |
(41) |
less_leaves#(cons(z0,z1),cons(z2,z3)) |
→ |
c14(less_leaves#(concat(z0,z1),concat(z2,z3)),concat#(z0,z1),concat#(z2,z3)) |
(43) |
reverse(nil) |
→ |
nil |
(7) |
app(add(z0,z1),z2) |
→ |
add(z0,app(z1,z2)) |
(26) |
concat(leaf,z0) |
→ |
z0 |
(34) |
app(nil,z0) |
→ |
z0 |
(24) |
reverse(add(z0,z1)) |
→ |
app(reverse(z1),add(z0,nil)) |
(29) |
concat(cons(z0,z1),z2) |
→ |
cons(z0,concat(z1,z2)) |
(36) |
minus(s(z0),s(z1)) |
→ |
minus(z0,z1) |
(18) |
minus(z0,0) |
→ |
z0 |
(16) |
minus#(z0,0) |
→ |
c |
(17) |
minus#(s(z0),s(z1)) |
→ |
c1(minus#(z0,z1)) |
(19) |
quot#(0,s(z0)) |
→ |
c2 |
(21) |
quot#(s(z0),s(z1)) |
→ |
c3(quot#(minus(z0,z1),s(z1)),minus#(z0,z1)) |
(23) |
app#(nil,z0) |
→ |
c4 |
(25) |
app#(add(z0,z1),z2) |
→ |
c5(app#(z1,z2)) |
(27) |
reverse#(nil) |
→ |
c6 |
(28) |
reverse#(add(z0,z1)) |
→ |
c7(app#(reverse(z1),add(z0,nil)),reverse#(z1)) |
(30) |
shuffle#(nil) |
→ |
c8 |
(31) |
shuffle#(add(z0,z1)) |
→ |
c9(shuffle#(reverse(z1)),reverse#(z1)) |
(33) |
concat#(leaf,z0) |
→ |
c10 |
(35) |
concat#(cons(z0,z1),z2) |
→ |
c11(concat#(z1,z2)) |
(37) |
less_leaves#(z0,leaf) |
→ |
c12 |
(39) |
less_leaves#(leaf,cons(z0,z1)) |
→ |
c13 |
(41) |
less_leaves#(cons(z0,z1),cons(z2,z3)) |
→ |
c14(less_leaves#(concat(z0,z1),concat(z2,z3)),concat#(z0,z1),concat#(z2,z3)) |
(43) |
minus(s(z0),s(z1)) |
→ |
minus(z0,z1) |
(18) |
minus(z0,0) |
→ |
z0 |
(16) |
minus#(z0,0) |
→ |
c |
(17) |
minus#(s(z0),s(z1)) |
→ |
c1(minus#(z0,z1)) |
(19) |
quot#(0,s(z0)) |
→ |
c2 |
(21) |
quot#(s(z0),s(z1)) |
→ |
c3(quot#(minus(z0,z1),s(z1)),minus#(z0,z1)) |
(23) |
app#(nil,z0) |
→ |
c4 |
(25) |
app#(add(z0,z1),z2) |
→ |
c5(app#(z1,z2)) |
(27) |
reverse#(nil) |
→ |
c6 |
(28) |
reverse#(add(z0,z1)) |
→ |
c7(app#(reverse(z1),add(z0,nil)),reverse#(z1)) |
(30) |
shuffle#(nil) |
→ |
c8 |
(31) |
shuffle#(add(z0,z1)) |
→ |
c9(shuffle#(reverse(z1)),reverse#(z1)) |
(33) |
concat#(leaf,z0) |
→ |
c10 |
(35) |
concat#(cons(z0,z1),z2) |
→ |
c11(concat#(z1,z2)) |
(37) |
less_leaves#(z0,leaf) |
→ |
c12 |
(39) |
less_leaves#(leaf,cons(z0,z1)) |
→ |
c13 |
(41) |
less_leaves#(cons(z0,z1),cons(z2,z3)) |
→ |
c14(less_leaves#(concat(z0,z1),concat(z2,z3)),concat#(z0,z1),concat#(z2,z3)) |
(43) |
concat(leaf,z0) |
→ |
z0 |
(34) |
concat(cons(z0,z1),z2) |
→ |
cons(z0,concat(z1,z2)) |
(36) |
minus#(z0,0) |
→ |
c |
(17) |
minus#(s(z0),s(z1)) |
→ |
c1(minus#(z0,z1)) |
(19) |
quot#(0,s(z0)) |
→ |
c2 |
(21) |
quot#(s(z0),s(z1)) |
→ |
c3(quot#(minus(z0,z1),s(z1)),minus#(z0,z1)) |
(23) |
app#(nil,z0) |
→ |
c4 |
(25) |
app#(add(z0,z1),z2) |
→ |
c5(app#(z1,z2)) |
(27) |
reverse#(nil) |
→ |
c6 |
(28) |
reverse#(add(z0,z1)) |
→ |
c7(app#(reverse(z1),add(z0,nil)),reverse#(z1)) |
(30) |
shuffle#(nil) |
→ |
c8 |
(31) |
shuffle#(add(z0,z1)) |
→ |
c9(shuffle#(reverse(z1)),reverse#(z1)) |
(33) |
concat#(leaf,z0) |
→ |
c10 |
(35) |
concat#(cons(z0,z1),z2) |
→ |
c11(concat#(z1,z2)) |
(37) |
less_leaves#(z0,leaf) |
→ |
c12 |
(39) |
less_leaves#(leaf,cons(z0,z1)) |
→ |
c13 |
(41) |
less_leaves#(cons(z0,z1),cons(z2,z3)) |
→ |
c14(less_leaves#(concat(z0,z1),concat(z2,z3)),concat#(z0,z1),concat#(z2,z3)) |
(43) |
reverse(nil) |
→ |
nil |
(7) |
app(add(z0,z1),z2) |
→ |
add(z0,app(z1,z2)) |
(26) |
app(nil,z0) |
→ |
z0 |
(24) |
reverse(add(z0,z1)) |
→ |
app(reverse(z1),add(z0,nil)) |
(29) |
minus(s(z0),s(z1)) |
→ |
minus(z0,z1) |
(18) |
minus(z0,0) |
→ |
z0 |
(16) |
minus#(z0,0) |
→ |
c |
(17) |
minus#(s(z0),s(z1)) |
→ |
c1(minus#(z0,z1)) |
(19) |
quot#(0,s(z0)) |
→ |
c2 |
(21) |
quot#(s(z0),s(z1)) |
→ |
c3(quot#(minus(z0,z1),s(z1)),minus#(z0,z1)) |
(23) |
app#(nil,z0) |
→ |
c4 |
(25) |
app#(add(z0,z1),z2) |
→ |
c5(app#(z1,z2)) |
(27) |
reverse#(nil) |
→ |
c6 |
(28) |
reverse#(add(z0,z1)) |
→ |
c7(app#(reverse(z1),add(z0,nil)),reverse#(z1)) |
(30) |
shuffle#(nil) |
→ |
c8 |
(31) |
shuffle#(add(z0,z1)) |
→ |
c9(shuffle#(reverse(z1)),reverse#(z1)) |
(33) |
concat#(leaf,z0) |
→ |
c10 |
(35) |
concat#(cons(z0,z1),z2) |
→ |
c11(concat#(z1,z2)) |
(37) |
less_leaves#(z0,leaf) |
→ |
c12 |
(39) |
less_leaves#(leaf,cons(z0,z1)) |
→ |
c13 |
(41) |
less_leaves#(cons(z0,z1),cons(z2,z3)) |
→ |
c14(less_leaves#(concat(z0,z1),concat(z2,z3)),concat#(z0,z1),concat#(z2,z3)) |
(43) |
reverse(nil) |
→ |
nil |
(7) |
app(add(z0,z1),z2) |
→ |
add(z0,app(z1,z2)) |
(26) |
app(nil,z0) |
→ |
z0 |
(24) |
reverse(add(z0,z1)) |
→ |
app(reverse(z1),add(z0,nil)) |
(29) |
minus(s(z0),s(z1)) |
→ |
minus(z0,z1) |
(18) |
minus(z0,0) |
→ |
z0 |
(16) |
minus#(z0,0) |
→ |
c |
(17) |
minus#(s(z0),s(z1)) |
→ |
c1(minus#(z0,z1)) |
(19) |
quot#(0,s(z0)) |
→ |
c2 |
(21) |
quot#(s(z0),s(z1)) |
→ |
c3(quot#(minus(z0,z1),s(z1)),minus#(z0,z1)) |
(23) |
app#(nil,z0) |
→ |
c4 |
(25) |
app#(add(z0,z1),z2) |
→ |
c5(app#(z1,z2)) |
(27) |
reverse#(nil) |
→ |
c6 |
(28) |
reverse#(add(z0,z1)) |
→ |
c7(app#(reverse(z1),add(z0,nil)),reverse#(z1)) |
(30) |
shuffle#(nil) |
→ |
c8 |
(31) |
shuffle#(add(z0,z1)) |
→ |
c9(shuffle#(reverse(z1)),reverse#(z1)) |
(33) |
concat#(leaf,z0) |
→ |
c10 |
(35) |
concat#(cons(z0,z1),z2) |
→ |
c11(concat#(z1,z2)) |
(37) |
less_leaves#(z0,leaf) |
→ |
c12 |
(39) |
less_leaves#(leaf,cons(z0,z1)) |
→ |
c13 |
(41) |
less_leaves#(cons(z0,z1),cons(z2,z3)) |
→ |
c14(less_leaves#(concat(z0,z1),concat(z2,z3)),concat#(z0,z1),concat#(z2,z3)) |
(43) |
reverse(nil) |
→ |
nil |
(7) |
app(add(z0,z1),z2) |
→ |
add(z0,app(z1,z2)) |
(26) |
app(nil,z0) |
→ |
z0 |
(24) |
reverse(add(z0,z1)) |
→ |
app(reverse(z1),add(z0,nil)) |
(29) |
There are no rules in the TRS R. Hence, R/S has complexity O(1).