The rewrite relation of the following TRS is considered.
sum(cons(s(n),x),cons(m,y)) | → | sum(cons(n,x),cons(s(m),y)) | (1) |
sum(cons(0,x),y) | → | sum(x,y) | (2) |
sum(nil,y) | → | y | (3) |
empty(nil) | → | true | (4) |
empty(cons(n,x)) | → | false | (5) |
tail(nil) | → | nil | (6) |
tail(cons(n,x)) | → | x | (7) |
head(cons(n,x)) | → | n | (8) |
weight(x) | → | if(empty(x),empty(tail(x)),x) | (9) |
if(true,b,x) | → | weight_undefined_error | (10) |
if(false,b,x) | → | if2(b,x) | (11) |
if2(true,x) | → | head(x) | (12) |
if2(false,x) | → | weight(sum(x,cons(0,tail(tail(x))))) | (13) |
sum#(cons(s(n),x),cons(m,y)) | → | sum#(cons(n,x),cons(s(m),y)) | (14) |
sum#(cons(0,x),y) | → | sum#(x,y) | (15) |
weight#(x) | → | tail#(x) | (16) |
weight#(x) | → | empty#(tail(x)) | (17) |
weight#(x) | → | empty#(x) | (18) |
weight#(x) | → | if#(empty(x),empty(tail(x)),x) | (19) |
if#(false,b,x) | → | if2#(b,x) | (20) |
if2#(true,x) | → | head#(x) | (21) |
if2#(false,x) | → | tail#(x) | (22) |
if2#(false,x) | → | tail#(tail(x)) | (23) |
if2#(false,x) | → | sum#(x,cons(0,tail(tail(x)))) | (24) |
if2#(false,x) | → | weight#(sum(x,cons(0,tail(tail(x))))) | (25) |
The dependency pairs are split into 2 components.
if2#(false,x) | → | weight#(sum(x,cons(0,tail(tail(x))))) | (25) |
weight#(x) | → | if#(empty(x),empty(tail(x)),x) | (19) |
if#(false,b,x) | → | if2#(b,x) | (20) |
[weight#(x1)] | = | 1 · x1 + 2 |
[nil] | = | 0 |
[tail(x1)] | = | -1 · x1 + 0 |
[cons(x1, x2)] | = | -5 · x1 + 1 · x2 + 1 |
[0] | = | 3 |
[if#(x1, x2, x3)] | = | -8 · x1 + -1 · x2 + 0 · x3 + -∞ |
[empty(x1)] | = | 2 · x1 + -∞ |
[s(x1)] | = | -∞ · x1 + 6 |
[false] | = | 3 |
[if2#(x1, x2)] | = | -1 · x1 + 0 · x2 + -∞ |
[true] | = | 2 |
[sum(x1, x2)] | = | -∞ · x1 + 0 · x2 + 0 |
tail(nil) | → | nil | (6) |
tail(cons(n,x)) | → | x | (7) |
sum(cons(s(n),x),cons(m,y)) | → | sum(cons(n,x),cons(s(m),y)) | (1) |
sum(cons(0,x),y) | → | sum(x,y) | (2) |
sum(nil,y) | → | y | (3) |
empty(nil) | → | true | (4) |
empty(cons(n,x)) | → | false | (5) |
weight#(x) | → | if#(empty(x),empty(tail(x)),x) | (19) |
The dependency pairs are split into 0 components.
sum#(cons(s(n),x),cons(m,y)) | → | sum#(cons(n,x),cons(s(m),y)) | (14) |
sum#(cons(0,x),y) | → | sum#(x,y) | (15) |
π(sum#) | = | { 1, 1 } |
π(sum) | = | { 2, 2 } |
π(cons) | = | { 2, 2 } |
sum#(cons(0,x),y) | → | sum#(x,y) | (15) |
π(sum#) | = | { 1 } |
π(cons) | = | { 1 } |
sum#(cons(s(n),x),cons(m,y)) | → | sum#(cons(n,x),cons(s(m),y)) | (14) |
There are no pairs anymore.