YES We show the termination of R/S, where R is le(0,y) -> true le(s(x),0) -> false le(s(x),s(y)) -> le(x,y) pred(s(x)) -> x minus(x,0) -> x minus(x,s(y)) -> pred(minus(x,y)) gcd(0,y) -> y gcd(s(x),0) -> s(x) gcd(s(x),s(y)) -> if_gcd(le(y,x),s(x),s(y)) if_gcd(true,s(x),s(y)) -> gcd(minus(x,y),s(y)) if_gcd(false,s(x),s(y)) -> gcd(minus(y,x),s(x)) 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 le#(s(x),s(y)) -> le#(x,y) minus#(x,s(y)) -> pred#(minus(x,y)) minus#(x,s(y)) -> minus#(x,y) gcd#(s(x),s(y)) -> if_gcd#(le(y,x),s(x),s(y)) gcd#(s(x),s(y)) -> le#(y,x) if_gcd#(true,s(x),s(y)) -> gcd#(minus(x,y),s(y)) if_gcd#(true,s(x),s(y)) -> minus#(x,y) if_gcd#(false,s(x),s(y)) -> gcd#(minus(y,x),s(x)) if_gcd#(false,s(x),s(y)) -> minus#(y,x) and Q consists of the rules: le(0,y) -> true le(s(x),0) -> false le(s(x),s(y)) -> le(x,y) pred(s(x)) -> x minus(x,0) -> x minus(x,s(y)) -> pred(minus(x,y)) gcd(0,y) -> y gcd(s(x),0) -> s(x) gcd(s(x),s(y)) -> if_gcd(le(y,x),s(x),s(y)) if_gcd(true,s(x),s(y)) -> gcd(minus(x,y),s(y)) if_gcd(false,s(x),s(y)) -> gcd(minus(y,x),s(x)) rand(x) -> x rand(x) -> rand(s(x)) The weakly monotone algebra (N^3, >_lex) with le#_A((x1,y1,z1),(x2,y2,z2)) = (0, 0, 0) s_A((x1,y1,z1)) = (x1, y1 + 3, z1 + 1) minus#_A((x1,y1,z1),(x2,y2,z2)) = (x1 + 1, y1 + 5, z1 + 1) pred#_A((x1,y1,z1)) = (0, 0, 0) minus_A((x1,y1,z1),(x2,y2,z2)) = (x1, y1 + 1, z1 + 1) gcd#_A((x1,y1,z1),(x2,y2,z2)) = (x1 + x2 + 2, y1 + y2 + 1, z1) if_gcd#_A((x1,y1,z1),(x2,y2,z2),(x3,y3,z3)) = (x2 + x3 + 2, y2 + y3, 2) le_A((x1,y1,z1),(x2,y2,z2)) = (2, 2, 1) true_A = (1, 1, 1) false_A = (1, 1, 1) 0_A = (1, 1, 1) pred_A((x1,y1,z1)) = (x1, y1, z1) gcd_A((x1,y1,z1),(x2,y2,z2)) = (x1 + x2, 4, 1) if_gcd_A((x1,y1,z1),(x2,y2,z2),(x3,y3,z3)) = (x2 + x3, 4, 1) rand_A((x1,y1,z1)) = (x1 + 1, 1, 0) strictly orients the following dependency pairs: minus#(x,s(y)) -> pred#(minus(x,y)) gcd#(s(x),s(y)) -> if_gcd#(le(y,x),s(x),s(y)) gcd#(s(x),s(y)) -> le#(y,x) if_gcd#(true,s(x),s(y)) -> gcd#(minus(x,y),s(y)) if_gcd#(true,s(x),s(y)) -> minus#(x,y) if_gcd#(false,s(x),s(y)) -> gcd#(minus(y,x),s(x)) if_gcd#(false,s(x),s(y)) -> minus#(y,x) We remove them from the set of dependency pairs. The weakly monotone algebra (N^3, >_lex) with le#_A((x1,y1,z1),(x2,y2,z2)) = (0, 0, 0) s_A((x1,y1,z1)) = (x1, y1 + 4, z1) minus#_A((x1,y1,z1),(x2,y2,z2)) = (x2, y2, z2) le_A((x1,y1,z1),(x2,y2,z2)) = (1, 2, 1) 0_A = (1, 1, 1) true_A = (1, 1, 1) false_A = (1, 1, 1) pred_A((x1,y1,z1)) = (x1, y1, z1) minus_A((x1,y1,z1),(x2,y2,z2)) = (x1, y1 + 1, z1 + 1) gcd_A((x1,y1,z1),(x2,y2,z2)) = (x1 + x2 + 1, y1 + y2 + 3, 0) if_gcd_A((x1,y1,z1),(x2,y2,z2),(x3,y3,z3)) = (x1 + x2 + x3, y1 + y2 + y3, 0) rand_A((x1,y1,z1)) = (x1 + 1, 1, 0) strictly orients the following dependency pairs: minus#(x,s(y)) -> minus#(x,y) We remove them from the set of dependency pairs. The weakly monotone algebra (N^3, >_lex) with le#_A((x1,y1,z1),(x2,y2,z2)) = (x1, y1, z1) s_A((x1,y1,z1)) = (x1, y1 + 3, z1 + 1) le_A((x1,y1,z1),(x2,y2,z2)) = (x1 + 1, 2, 1) 0_A = (1, 1, 1) true_A = (1, 1, 1) false_A = (1, 1, 1) pred_A((x1,y1,z1)) = (x1, y1, z1) minus_A((x1,y1,z1),(x2,y2,z2)) = (x1, y1 + 1, z1 + 1) gcd_A((x1,y1,z1),(x2,y2,z2)) = (x1 + x2, y1 + y2 + 1, 0) if_gcd_A((x1,y1,z1),(x2,y2,z2),(x3,y3,z3)) = (x2 + x3, y2 + y3, 0) rand_A((x1,y1,z1)) = (x1 + 1, 1, 0) strictly orients the following dependency pairs: le#(s(x),s(y)) -> le#(x,y) We remove them from the set of dependency pairs. No dependency pair remains.