YES We show the termination of the relative TRS R/S: R: 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)) S: rand(x) -> x rand(x) -> rand(s(x)) -- SCC decomposition. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: tests#(s(x)) -> test#(rands(rand(|0|()),nil())) p2: tests#(s(x)) -> rands#(rand(|0|()),nil()) p3: test#(done(y)) -> eq#(f(y),g(y)) p4: rands#(s(x),y) -> rands#(x,|::|(rand(|0|()),y)) and R consists of: r1: tests(|0|()) -> true() r2: tests(s(x)) -> and(test(rands(rand(|0|()),nil())),x) r3: test(done(y)) -> eq(f(y),g(y)) r4: eq(x,x) -> true() r5: rands(|0|(),y) -> done(y) r6: rands(s(x),y) -> rands(x,|::|(rand(|0|()),y)) r7: rand(x) -> x r8: rand(x) -> rand(s(x)) The estimated dependency graph contains the following SCCs: {p4} -- Reduction pair. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: rands#(s(x),y) -> rands#(x,|::|(rand(|0|()),y)) and R consists of: r1: tests(|0|()) -> true() r2: tests(s(x)) -> and(test(rands(rand(|0|()),nil())),x) r3: test(done(y)) -> eq(f(y),g(y)) r4: eq(x,x) -> true() r5: rands(|0|(),y) -> done(y) r6: rands(s(x),y) -> rands(x,|::|(rand(|0|()),y)) r7: rand(x) -> x r8: rand(x) -> rand(s(x)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8 Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: rands#_A(x1,x2) = max{x1 + 7, x2 + 10} s_A(x1) = max{9, x1} |::|_A(x1,x2) = max{6, x1 - 27, x2} rand_A(x1) = max{33, x1 + 23} |0|_A = 6 tests_A(x1) = max{77, x1 + 32} true_A = 23 and_A(x1,x2) = max{x1 - 11, x2 + 32} test_A(x1) = x1 + 41 rands_A(x1,x2) = max{x1 + 14, x2 + 7} nil_A = 1 done_A(x1) = x1 + 7 eq_A(x1,x2) = max{x1 + 24, x2 + 24} f_A(x1) = max{22, x1 + 1} g_A(x1) = x1 + 6 precedence: rands# = s = |::| = |0| = tests = true = and = test = rands = nil = done = eq = f = g > rand partial status: pi(rands#) = [1] pi(s) = [1] pi(|::|) = [] pi(rand) = [] pi(|0|) = [] pi(tests) = [1] pi(true) = [] pi(and) = [] pi(test) = [1] pi(rands) = [1, 2] pi(nil) = [] pi(done) = [] pi(eq) = [2] pi(f) = [1] pi(g) = [1] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.