YES We show the termination of R/S, where R is minus(x,0) -> x minus(s(x),s(y)) -> minus(x,y) quot(0,s(y)) -> 0 quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) plus(0,y) -> y plus(s(x),y) -> s(plus(x,y)) minus(minus(x,y),z) -> minus(x,plus(y,z)) app(nil,k) -> k app(l,nil) -> l app(cons(x,l),k) -> cons(x,app(l,k)) sum(cons(x,nil)) -> cons(x,nil) sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) and S is: rand(x) -> x rand(x) -> rand(s(x)) Since R almost dominates S and S is non-duplicating, it is enough to show finiteness of (P, Q). Here P consists of the dependency pairs minus#(s(x),s(y)) -> minus#(x,y) quot#(s(x),s(y)) -> quot#(minus(x,y),s(y)) quot#(s(x),s(y)) -> minus#(x,y) plus#(s(x),y) -> plus#(x,y) minus#(minus(x,y),z) -> minus#(x,plus(y,z)) minus#(minus(x,y),z) -> plus#(y,z) app#(cons(x,l),k) -> app#(l,k) sum#(cons(x,cons(y,l))) -> sum#(cons(plus(x,y),l)) sum#(cons(x,cons(y,l))) -> plus#(x,y) sum#(app(l,cons(x,cons(y,k)))) -> sum#(app(l,sum(cons(x,cons(y,k))))) sum#(app(l,cons(x,cons(y,k)))) -> app#(l,sum(cons(x,cons(y,k)))) sum#(app(l,cons(x,cons(y,k)))) -> sum#(cons(x,cons(y,k))) and Q consists of the rules: minus(x,0) -> x minus(s(x),s(y)) -> minus(x,y) quot(0,s(y)) -> 0 quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) plus(0,y) -> y plus(s(x),y) -> s(plus(x,y)) minus(minus(x,y),z) -> minus(x,plus(y,z)) app(nil,k) -> k app(l,nil) -> l app(cons(x,l),k) -> cons(x,app(l,k)) sum(cons(x,nil)) -> cons(x,nil) sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) rand(x) -> x rand(x) -> rand(s(x)) The weakly monotone algebra (N^2, >_lex) with minus#_A((x1,y1),(x2,y2)) = (1, 1) s_A((x1,y1)) = (x1, 1) quot#_A((x1,y1),(x2,y2)) = (x2 + 2, 2) minus_A((x1,y1),(x2,y2)) = (x1 + x2 + 2, 0) plus#_A((x1,y1),(x2,y2)) = (0, 0) plus_A((x1,y1),(x2,y2)) = (x1 + x2 + 1, y1 + y2) app#_A((x1,y1),(x2,y2)) = (x2, 0) cons_A((x1,y1),(x2,y2)) = (1, 1) sum#_A((x1,y1)) = (3, 1) app_A((x1,y1),(x2,y2)) = (x1 + x2 + 1, y2 + 1) sum_A((x1,y1)) = (2, 2) 0_A = (1, 2) quot_A((x1,y1),(x2,y2)) = (2, 1) nil_A = (0, 0) rand_A((x1,y1)) = (x1 + 1, 0) strictly orients the following dependency pairs: quot#(s(x),s(y)) -> minus#(x,y) minus#(minus(x,y),z) -> plus#(y,z) sum#(cons(x,cons(y,l))) -> plus#(x,y) sum#(app(l,cons(x,cons(y,k)))) -> app#(l,sum(cons(x,cons(y,k)))) We remove them from the set of dependency pairs. The weakly monotone algebra (N^2, >_lex) with minus#_A((x1,y1),(x2,y2)) = (0, 0) s_A((x1,y1)) = (x1, 2) quot#_A((x1,y1),(x2,y2)) = (0, 0) minus_A((x1,y1),(x2,y2)) = (x1 + x2 + 2, 1) plus#_A((x1,y1),(x2,y2)) = (0, 0) plus_A((x1,y1),(x2,y2)) = (x1 + x2 + 1, y1 + y2 + 1) app#_A((x1,y1),(x2,y2)) = (x1, y1) cons_A((x1,y1),(x2,y2)) = (x1 + x2 + 2, y1 + y2 + 2) sum#_A((x1,y1)) = (0, 0) app_A((x1,y1),(x2,y2)) = (x1 + x2 + 1, y1 + y2 + 1) sum_A((x1,y1)) = (x1, y1) 0_A = (1, 3) quot_A((x1,y1),(x2,y2)) = (2, 2) nil_A = (1, 1) rand_A((x1,y1)) = (x1 + 1, 0) strictly orients the following dependency pairs: app#(cons(x,l),k) -> app#(l,k) We remove them from the set of dependency pairs. The weakly monotone algebra (N^2, >_lex) with minus#_A((x1,y1),(x2,y2)) = (x1 + x2, y1 + y2) s_A((x1,y1)) = (x1, y1) quot#_A((x1,y1),(x2,y2)) = (0, 0) minus_A((x1,y1),(x2,y2)) = (x1 + x2 + 2, y1 + y2 + 1) plus#_A((x1,y1),(x2,y2)) = (x1, y1) plus_A((x1,y1),(x2,y2)) = (x1 + x2 + 1, y1 + y2 + 2) sum#_A((x1,y1)) = (x1, y1) cons_A((x1,y1),(x2,y2)) = (x1 + x2 + 2, y1 + y2 + 1) app_A((x1,y1),(x2,y2)) = (x1 + x2 + 1, y1 + y2 + 1) sum_A((x1,y1)) = (x1, y1) 0_A = (1, 2) quot_A((x1,y1),(x2,y2)) = (2, 1) nil_A = (1, 1) rand_A((x1,y1)) = (x1 + 1, y1) strictly orients the following dependency pairs: minus#(minus(x,y),z) -> minus#(x,plus(y,z)) sum#(cons(x,cons(y,l))) -> sum#(cons(plus(x,y),l)) sum#(app(l,cons(x,cons(y,k)))) -> sum#(cons(x,cons(y,k))) We remove them from the set of dependency pairs. The weakly monotone algebra (N^2, >_lex) with minus#_A((x1,y1),(x2,y2)) = (0, 0) s_A((x1,y1)) = (x1, y1) quot#_A((x1,y1),(x2,y2)) = (0, 0) minus_A((x1,y1),(x2,y2)) = (x1 + x2 + 2, y1 + y2 + 1) plus#_A((x1,y1),(x2,y2)) = (x1, 0) sum#_A((x1,y1)) = (x1, y1) app_A((x1,y1),(x2,y2)) = (x1 + x2 + 1, y2 + 1) cons_A((x1,y1),(x2,y2)) = (x2 + 3, 1) sum_A((x1,y1)) = (5, 2) 0_A = (1, 2) quot_A((x1,y1),(x2,y2)) = (2, 1) plus_A((x1,y1),(x2,y2)) = (x1 + x2 + 1, y1 + y2 + 2) nil_A = (1, 1) rand_A((x1,y1)) = (x1 + 1, 0) strictly orients the following dependency pairs: sum#(app(l,cons(x,cons(y,k)))) -> sum#(app(l,sum(cons(x,cons(y,k))))) We remove them from the set of dependency pairs. The weakly monotone algebra (N^2, >_lex) with minus#_A((x1,y1),(x2,y2)) = (x1 + x2, y1 + y2) s_A((x1,y1)) = (x1, y1 + 1) quot#_A((x1,y1),(x2,y2)) = (x1, y1) minus_A((x1,y1),(x2,y2)) = (x1, y1) plus#_A((x1,y1),(x2,y2)) = (x1, y1) 0_A = (1, 0) quot_A((x1,y1),(x2,y2)) = (x1 + 1, y1 + 1) plus_A((x1,y1),(x2,y2)) = (x1 + x2, y1 + y2) app_A((x1,y1),(x2,y2)) = (x1 + x2 + 1, y1 + y2 + 1) nil_A = (1, 1) cons_A((x1,y1),(x2,y2)) = (x1 + x2 + 1, y1 + y2 + 1) sum_A((x1,y1)) = (x1, y1) rand_A((x1,y1)) = (x1 + 1, 0) strictly orients the following dependency pairs: minus#(s(x),s(y)) -> minus#(x,y) quot#(s(x),s(y)) -> quot#(minus(x,y),s(y)) plus#(s(x),y) -> plus#(x,y) We remove them from the set of dependency pairs. No dependency pair remains.