YES TRS: sum(cons(s(n),x),cons(m,y)) -> sum(cons(n,x),cons(s(m),y)) sum(cons(0(),x),y) -> sum(x,y) sum(nil(),y) -> y empty(nil()) -> true() empty(cons(n,x)) -> false() tail(nil()) -> nil() tail(cons(n,x)) -> x head(cons(n,x)) -> n weight(x) -> if(empty(x),empty(tail(x)),x) if(true(),b,x) -> weight_undefined_error() if(false(),b,x) -> if2(b,x) if2(true(),x) -> head(x) if2(false(),x) -> weight(sum(x,cons(0(),tail(tail(x))))) max/plus interpretations on N: sum_A(x1,x2) = max{35, -11, 1 + x2} sum#_A(x1,x2) = max{1, 46, 19 + x2} cons_A(x1,x2) = max{0, 26 + x1, 13 + x2} cons#_A(x1,x2) = max{0, 31, 29 + x2} s_A(x1) = max{1, 1} s#_A(x1) = max{20, -1 + x1} 0_A = 0 0#_A = 29 nil_A = 13 nil#_A = 10 empty_A(x1) = max{35, 21 + x1} empty#_A(x1) = max{11, 13} true_A = 35 true#_A = 9 false_A = 47 false#_A = 30 tail_A(x1) = max{14, -13 + x1} tail#_A(x1) = max{0, 11} head_A(x1) = max{21, -26 + x1} head#_A(x1) = max{0, 0} weight_A(x1) = max{21, -14 + x1} weight#_A(x1) = max{38, 12 + x1} if_A(x1,x2,x3) = max{20, -14, 21, -14 + x3} if#_A(x1,x2,x3) = max{37, 1, 3 + x2, 7 + x3} weight_undefined_error_A = 21 weight_undefined_error#_A = 8 if2_A(x1,x2) = max{21, -26, -26 + x2} if2#_A(x1,x2) = max{2, x1, 6 + x2} precedence: tail = if2 > sum = head = weight > nil = empty > true = false > cons = 0 = weight_undefined_error > s = if