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