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: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: rands#_A(x1,x2) = x1 + ((1,0),(1,1)) x2 + (5,2) s_A(x1) = x1 + (0,6) |::|_A(x1,x2) = x2 + (0,1) rand_A(x1) = ((1,0),(0,0)) x1 + (1,7) |0|_A() = (3,9) tests_A(x1) = x1 + (7,10) true_A() = (1,1) and_A(x1,x2) = (0,0) test_A(x1) = (6,7) rands_A(x1,x2) = ((1,0),(1,1)) x1 + x2 + (2,4) nil_A() = (0,0) done_A(x1) = (4,3) eq_A(x1,x2) = (2,2) f_A(x1) = (5,4) g_A(x1) = x1 + (1,4) precedence: rands# = s = |::| = rand = |0| = tests = true = and = test = rands = nil = done = eq = f = g partial status: pi(rands#) = [] pi(s) = [] pi(|::|) = [] pi(rand) = [] pi(|0|) = [] pi(tests) = [] pi(true) = [] pi(and) = [] pi(test) = [] pi(rands) = [] pi(nil) = [] pi(done) = [] pi(eq) = [] pi(f) = [] pi(g) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: rands#_A(x1,x2) = x1 s_A(x1) = ((1,0),(1,1)) x1 + (5,4) |::|_A(x1,x2) = ((1,0),(1,1)) x2 + (4,6) rand_A(x1) = (1,1) |0|_A() = (3,5) tests_A(x1) = x1 true_A() = (1,4) and_A(x1,x2) = (0,0) test_A(x1) = (4,3) rands_A(x1,x2) = ((1,0),(1,1)) x1 + ((1,0),(1,1)) x2 + (4,1) nil_A() = (1,1) done_A(x1) = (2,2) eq_A(x1,x2) = (3,5) f_A(x1) = (1,1) g_A(x1) = (1,1) precedence: test > rands > g > |::| > and > done > tests > eq > f > |0| > true > rands# = s = rand = nil partial status: pi(rands#) = [] pi(s) = [] pi(|::|) = [] pi(rand) = [] pi(|0|) = [] pi(tests) = [] pi(true) = [] pi(and) = [] pi(test) = [] pi(rands) = [] pi(nil) = [] pi(done) = [] pi(eq) = [] pi(f) = [] pi(g) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.