YES We show the termination of R/S, where R is tests(0) -> true tests(s(x)) -> and(test(rands(rand(0),nil)),x) test(done(y)) -> eq(f(y),g(y)) eq(x,x) -> true rands(0,y) -> done(y) rands(s(x),y) -> rands(x,::(rand(0),y)) 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 tests#(s(x)) -> test#(rands(rand(0),nil)) tests#(s(x)) -> rands#(rand(0),nil) test#(done(y)) -> eq#(f(y),g(y)) rands#(s(x),y) -> rands#(x,::(rand(0),y)) and Q consists of the rules: tests(0) -> true tests(s(x)) -> and(test(rands(rand(0),nil)),x) test(done(y)) -> eq(f(y),g(y)) eq(x,x) -> true rands(0,y) -> done(y) rands(s(x),y) -> rands(x,::(rand(0),y)) rand(x) -> x rand(x) -> rand(s(x)) The weakly monotone algebra (N^2, >_lex) with tests#_A((x1,y1)) = (2, 0) s_A((x1,y1)) = (x1, y1 + 1) test#_A((x1,y1)) = (1, 1) rands_A((x1,y1),(x2,y2)) = (x1 + x2 + 1, y1 + y2) rand_A((x1,y1)) = (x1 + 1, 1) 0_A = (1, 1) nil_A = (1, 1) rands#_A((x1,y1),(x2,y2)) = (1, 1) done_A((x1,y1)) = (1, 2) eq#_A((x1,y1),(x2,y2)) = (0, 0) f_A((x1,y1)) = (x1 + 1, y1 + 1) g_A((x1,y1)) = (x1 + 1, y1 + 1) ::_A((x1,y1),(x2,y2)) = (x2, y2 + 1) tests_A((x1,y1)) = (x1 + 1, y1) true_A = (0, 3) and_A((x1,y1),(x2,y2)) = (0, 2) test_A((x1,y1)) = (2, 1) eq_A((x1,y1),(x2,y2)) = (1, 2) strictly orients the following dependency pairs: tests#(s(x)) -> test#(rands(rand(0),nil)) tests#(s(x)) -> rands#(rand(0),nil) test#(done(y)) -> eq#(f(y),g(y)) We remove them from the set of dependency pairs. The weakly monotone algebra (N^2, >_lex) with rands#_A((x1,y1),(x2,y2)) = (x1, y1) s_A((x1,y1)) = (x1, y1 + 1) ::_A((x1,y1),(x2,y2)) = (x2 + 1, y2 + 1) rand_A((x1,y1)) = (x1 + 1, 1) 0_A = (1, 1) tests_A((x1,y1)) = (x1 + 4, 0) true_A = (0, 3) and_A((x1,y1),(x2,y2)) = (x1, 1) test_A((x1,y1)) = (x1 + 1, 1) rands_A((x1,y1),(x2,y2)) = (2, 1) nil_A = (1, 1) done_A((x1,y1)) = (1, 2) eq_A((x1,y1),(x2,y2)) = (1, 2) f_A((x1,y1)) = (1, 1) g_A((x1,y1)) = (1, 1) strictly orients the following dependency pairs: rands#(s(x),y) -> rands#(x,::(rand(0),y)) We remove them from the set of dependency pairs. No dependency pair remains.