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))) app(nil,y) -> y app(add(n,x),y) -> add(n,app(x,y)) reverse(nil) -> nil reverse(add(n,x)) -> app(reverse(x),add(n,nil)) shuffle(nil) -> nil shuffle(add(n,x)) -> add(n,shuffle(reverse(x))) concat(leaf,y) -> y concat(cons(u,v),y) -> cons(u,concat(v,y)) less_leaves(x,leaf) -> false less_leaves(leaf,cons(w,z)) -> true less_leaves(cons(u,v),cons(w,z)) -> less_leaves(concat(u,v),concat(w,z)) 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) app#(add(n,x),y) -> app#(x,y) reverse#(add(n,x)) -> app#(reverse(x),add(n,nil)) reverse#(add(n,x)) -> reverse#(x) shuffle#(add(n,x)) -> shuffle#(reverse(x)) shuffle#(add(n,x)) -> reverse#(x) concat#(cons(u,v),y) -> concat#(v,y) less_leaves#(cons(u,v),cons(w,z)) -> less_leaves#(concat(u,v),concat(w,z)) less_leaves#(cons(u,v),cons(w,z)) -> concat#(u,v) less_leaves#(cons(u,v),cons(w,z)) -> concat#(w,z) 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))) app(nil,y) -> y app(add(n,x),y) -> add(n,app(x,y)) reverse(nil) -> nil reverse(add(n,x)) -> app(reverse(x),add(n,nil)) shuffle(nil) -> nil shuffle(add(n,x)) -> add(n,shuffle(reverse(x))) concat(leaf,y) -> y concat(cons(u,v),y) -> cons(u,concat(v,y)) less_leaves(x,leaf) -> false less_leaves(leaf,cons(w,z)) -> true less_leaves(cons(u,v),cons(w,z)) -> less_leaves(concat(u,v),concat(w,z)) rand(x) -> x rand(x) -> rand(s(x)) 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)) = (1, 1) minus_A((x1,y1),(x2,y2)) = (x1 + 1, y1 + 1) app#_A((x1,y1),(x2,y2)) = (0, 0) add_A((x1,y1),(x2,y2)) = (x2, 2) reverse#_A((x1,y1)) = (1, 1) reverse_A((x1,y1)) = (3, 1) nil_A = (1, 3) shuffle#_A((x1,y1)) = (2, 2) concat#_A((x1,y1),(x2,y2)) = (0, 0) cons_A((x1,y1),(x2,y2)) = (x1 + 1, y1 + 1) less_leaves#_A((x1,y1),(x2,y2)) = (1, 1) concat_A((x1,y1),(x2,y2)) = (x1 + x2 + 1, y1 + 1) 0_A = (1, 2) quot_A((x1,y1),(x2,y2)) = (2, 1) app_A((x1,y1),(x2,y2)) = (x2 + 1, 2) shuffle_A((x1,y1)) = (2, 2) leaf_A = (1, 1) less_leaves_A((x1,y1),(x2,y2)) = (1, 0) false_A = (0, 1) true_A = (0, 1) rand_A((x1,y1)) = (x1 + 1, y1) strictly orients the following dependency pairs: quot#(s(x),s(y)) -> minus#(x,y) reverse#(add(n,x)) -> app#(reverse(x),add(n,nil)) shuffle#(add(n,x)) -> reverse#(x) less_leaves#(cons(u,v),cons(w,z)) -> concat#(u,v) less_leaves#(cons(u,v),cons(w,z)) -> concat#(w,z) 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, 1) quot#_A((x1,y1),(x2,y2)) = (0, 0) minus_A((x1,y1),(x2,y2)) = (x1 + x2 + 1, 2) app#_A((x1,y1),(x2,y2)) = (0, 0) add_A((x1,y1),(x2,y2)) = (0, 2) reverse#_A((x1,y1)) = (0, 0) shuffle#_A((x1,y1)) = (0, 0) reverse_A((x1,y1)) = (2, 1) concat#_A((x1,y1),(x2,y2)) = (x1, 0) cons_A((x1,y1),(x2,y2)) = (x1 + x2 + 2, 1) less_leaves#_A((x1,y1),(x2,y2)) = (x1 + x2, y2) concat_A((x1,y1),(x2,y2)) = (x1 + x2 + 1, y1 + y2 + 2) 0_A = (1, 2) quot_A((x1,y1),(x2,y2)) = (2, 1) app_A((x1,y1),(x2,y2)) = (x1 + x2, y1) nil_A = (1, 0) shuffle_A((x1,y1)) = (x1 + 1, 1) leaf_A = (1, 1) less_leaves_A((x1,y1),(x2,y2)) = (x1 + x2, 0) false_A = (0, 1) true_A = (0, 1) rand_A((x1,y1)) = (x1 + 1, 0) strictly orients the following dependency pairs: concat#(cons(u,v),y) -> concat#(v,y) less_leaves#(cons(u,v),cons(w,z)) -> less_leaves#(concat(u,v),concat(w,z)) 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) app#_A((x1,y1),(x2,y2)) = (0, 0) add_A((x1,y1),(x2,y2)) = (1, 2) reverse#_A((x1,y1)) = (0, 0) shuffle#_A((x1,y1)) = (0, 0) reverse_A((x1,y1)) = (x1 + 1, 3) 0_A = (0, 1) quot_A((x1,y1),(x2,y2)) = (x1 + 1, y1) app_A((x1,y1),(x2,y2)) = (x2 + 1, 2) nil_A = (1, 0) shuffle_A((x1,y1)) = (2, 1) concat_A((x1,y1),(x2,y2)) = (x1 + x2 + 1, y1 + y2 + 1) leaf_A = (1, 1) cons_A((x1,y1),(x2,y2)) = (x1 + x2 + 2, y1 + 1) less_leaves_A((x1,y1),(x2,y2)) = (x1 + x2, 0) false_A = (0, 1) true_A = (0, 1) 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)) We remove them from the set of dependency pairs. The weakly monotone algebra (N^2, >_lex) with app#_A((x1,y1),(x2,y2)) = (x1, y1) add_A((x1,y1),(x2,y2)) = (x2, y2 + 1) reverse#_A((x1,y1)) = (x1, y1) shuffle#_A((x1,y1)) = (x1, y1) reverse_A((x1,y1)) = (x1, y1) minus_A((x1,y1),(x2,y2)) = (x1 + 1, y1 + 1) 0_A = (1, 2) s_A((x1,y1)) = (x1, y1) quot_A((x1,y1),(x2,y2)) = (x2 + 2, y2 + 1) app_A((x1,y1),(x2,y2)) = (x1 + x2, y1 + y2) nil_A = (0, 0) shuffle_A((x1,y1)) = (x1 + 1, y1 + 1) concat_A((x1,y1),(x2,y2)) = (x1 + x2 + 1, y1 + y2 + 1) leaf_A = (1, 1) cons_A((x1,y1),(x2,y2)) = (x1 + x2 + 2, y1 + 1) less_leaves_A((x1,y1),(x2,y2)) = (x1 + x2, 0) false_A = (0, 1) true_A = (0, 1) rand_A((x1,y1)) = (x1 + 1, y1) strictly orients the following dependency pairs: app#(add(n,x),y) -> app#(x,y) reverse#(add(n,x)) -> reverse#(x) shuffle#(add(n,x)) -> shuffle#(reverse(x)) We remove them from the set of dependency pairs. No dependency pair remains.