YES We show the termination of the relative TRS R/S: R: +(|0|(),y) -> y +(s(x),y) -> s(+(x,y)) sum1(nil()) -> |0|() sum1(cons(x,y)) -> +(x,sum1(y)) sum2(nil(),z) -> z sum2(cons(x,y),z) -> sum2(y,+(x,z)) 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: +#(s(x),y) -> +#(x,y) p2: sum1#(cons(x,y)) -> +#(x,sum1(y)) p3: sum1#(cons(x,y)) -> sum1#(y) p4: sum2#(cons(x,y),z) -> sum2#(y,+(x,z)) p5: sum2#(cons(x,y),z) -> +#(x,z) p6: tests#(s(x)) -> test#(rands(rand(|0|()),nil())) p7: tests#(s(x)) -> rands#(rand(|0|()),nil()) p8: test#(done(y)) -> eq#(f(y),g(y)) p9: rands#(s(x),y) -> rands#(x,|::|(rand(|0|()),y)) and R consists of: r1: +(|0|(),y) -> y r2: +(s(x),y) -> s(+(x,y)) r3: sum1(nil()) -> |0|() r4: sum1(cons(x,y)) -> +(x,sum1(y)) r5: sum2(nil(),z) -> z r6: sum2(cons(x,y),z) -> sum2(y,+(x,z)) r7: tests(|0|()) -> true() r8: tests(s(x)) -> and(test(rands(rand(|0|()),nil())),x) r9: test(done(y)) -> eq(f(y),g(y)) r10: eq(x,x) -> true() r11: rands(|0|(),y) -> done(y) r12: rands(s(x),y) -> rands(x,|::|(rand(|0|()),y)) r13: rand(x) -> x r14: rand(x) -> rand(s(x)) The estimated dependency graph contains the following SCCs: {p4} {p3} {p1} {p9} -- Reduction pair. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: sum2#(cons(x,y),z) -> sum2#(y,+(x,z)) and R consists of: r1: +(|0|(),y) -> y r2: +(s(x),y) -> s(+(x,y)) r3: sum1(nil()) -> |0|() r4: sum1(cons(x,y)) -> +(x,sum1(y)) r5: sum2(nil(),z) -> z r6: sum2(cons(x,y),z) -> sum2(y,+(x,z)) r7: tests(|0|()) -> true() r8: tests(s(x)) -> and(test(rands(rand(|0|()),nil())),x) r9: test(done(y)) -> eq(f(y),g(y)) r10: eq(x,x) -> true() r11: rands(|0|(),y) -> done(y) r12: rands(s(x),y) -> rands(x,|::|(rand(|0|()),y)) r13: rand(x) -> x r14: rand(x) -> rand(s(x)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14 Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: sum2#_A(x1,x2) = x1 + 5 cons_A(x1,x2) = max{x1, x2 + 1} +_A(x1,x2) = max{x1 + 6, x2} |0|_A = 4 s_A(x1) = x1 sum1_A(x1) = x1 + 7 nil_A = 12 sum2_A(x1,x2) = max{x1 + 10, x2 + 4} tests_A(x1) = x1 + 11 true_A = 3 and_A(x1,x2) = max{x1 - 26, x2 + 11} test_A(x1) = x1 + 8 rands_A(x1,x2) = max{x1 + 19, x2 + 16} rand_A(x1) = x1 + 6 done_A(x1) = x1 + 15 eq_A(x1,x2) = max{x1 + 6, x2 + 4} f_A(x1) = x1 + 16 g_A(x1) = x1 + 16 |::|_A(x1,x2) = max{3, x1 - 9} precedence: sum2# = cons = + = |0| = sum1 = nil = sum2 = tests = true > |::| > s = and = test = rands = rand = done = eq = f = g partial status: pi(sum2#) = [] pi(cons) = [1, 2] pi(+) = [2] pi(|0|) = [] pi(s) = [] pi(sum1) = [] pi(nil) = [] pi(sum2) = [] pi(tests) = [1] pi(true) = [] pi(and) = [] pi(test) = [] pi(rands) = [] pi(rand) = [1] pi(done) = [1] pi(eq) = [1, 2] pi(f) = [] pi(g) = [] pi(|::|) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: sum1#(cons(x,y)) -> sum1#(y) and R consists of: r1: +(|0|(),y) -> y r2: +(s(x),y) -> s(+(x,y)) r3: sum1(nil()) -> |0|() r4: sum1(cons(x,y)) -> +(x,sum1(y)) r5: sum2(nil(),z) -> z r6: sum2(cons(x,y),z) -> sum2(y,+(x,z)) r7: tests(|0|()) -> true() r8: tests(s(x)) -> and(test(rands(rand(|0|()),nil())),x) r9: test(done(y)) -> eq(f(y),g(y)) r10: eq(x,x) -> true() r11: rands(|0|(),y) -> done(y) r12: rands(s(x),y) -> rands(x,|::|(rand(|0|()),y)) r13: rand(x) -> x r14: rand(x) -> rand(s(x)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14 Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: sum1#_A(x1) = x1 + 3 cons_A(x1,x2) = max{x1 + 2, x2 + 2} +_A(x1,x2) = max{x1 + 6, x2} |0|_A = 47 s_A(x1) = 44 sum1_A(x1) = x1 + 31 nil_A = 17 sum2_A(x1,x2) = max{x1 + 9, x2 + 5} tests_A(x1) = 45 true_A = 5 and_A(x1,x2) = max{45, x1 + 2} test_A(x1) = x1 + 10 rands_A(x1,x2) = max{33, x2 + 16} rand_A(x1) = max{90, x1 + 45} done_A(x1) = x1 + 3 eq_A(x1,x2) = max{x1 + 6, x2 + 8} f_A(x1) = max{4, x1 + 2} g_A(x1) = max{2, x1 + 1} |::|_A(x1,x2) = max{15, x1 - 75} precedence: sum1# = cons = + = |0| = s = sum1 = nil = sum2 = tests = true = and = test = rands = rand = done = eq = f = g = |::| partial status: pi(sum1#) = [] pi(cons) = [2] pi(+) = [2] pi(|0|) = [] pi(s) = [] pi(sum1) = [] pi(nil) = [] pi(sum2) = [1, 2] pi(tests) = [] pi(true) = [] pi(and) = [] pi(test) = [] pi(rands) = [] pi(rand) = [] pi(done) = [1] pi(eq) = [1, 2] pi(f) = [] pi(g) = [] pi(|::|) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: +#(s(x),y) -> +#(x,y) and R consists of: r1: +(|0|(),y) -> y r2: +(s(x),y) -> s(+(x,y)) r3: sum1(nil()) -> |0|() r4: sum1(cons(x,y)) -> +(x,sum1(y)) r5: sum2(nil(),z) -> z r6: sum2(cons(x,y),z) -> sum2(y,+(x,z)) r7: tests(|0|()) -> true() r8: tests(s(x)) -> and(test(rands(rand(|0|()),nil())),x) r9: test(done(y)) -> eq(f(y),g(y)) r10: eq(x,x) -> true() r11: rands(|0|(),y) -> done(y) r12: rands(s(x),y) -> rands(x,|::|(rand(|0|()),y)) r13: rand(x) -> x r14: rand(x) -> rand(s(x)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14 Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: +#_A(x1,x2) = max{13, x1 + 1} s_A(x1) = max{12, x1} +_A(x1,x2) = max{x1 + 15, x2} |0|_A = 2 sum1_A(x1) = x1 + 14 nil_A = 0 cons_A(x1,x2) = max{x1 + 15, x2 + 15} sum2_A(x1,x2) = max{x1 + 14, x2 + 14} tests_A(x1) = max{57, x1 + 27} true_A = 1 and_A(x1,x2) = max{x1 + 1, x2 - 1} test_A(x1) = max{13, x1 + 4} rands_A(x1,x2) = max{x1 + 30, x2 + 40} rand_A(x1) = max{22, x1 + 1} done_A(x1) = x1 + 22 eq_A(x1,x2) = max{23, x1 + 5, x2 + 5} f_A(x1) = x1 + 21 g_A(x1) = x1 + 21 |::|_A(x1,x2) = max{1, x1 - 20, x2} precedence: +# = + > s = |0| = nil > sum1 = cons = sum2 = tests = true = and = test = rands = rand = done = eq = f = g = |::| partial status: pi(+#) = [1] pi(s) = [1] pi(+) = [1, 2] pi(|0|) = [] pi(sum1) = [1] pi(nil) = [] pi(cons) = [2] pi(sum2) = [1, 2] pi(tests) = [1] pi(true) = [] pi(and) = [] pi(test) = [] pi(rands) = [] pi(rand) = [] pi(done) = [1] pi(eq) = [] pi(f) = [] pi(g) = [1] pi(|::|) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- 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: +(|0|(),y) -> y r2: +(s(x),y) -> s(+(x,y)) r3: sum1(nil()) -> |0|() r4: sum1(cons(x,y)) -> +(x,sum1(y)) r5: sum2(nil(),z) -> z r6: sum2(cons(x,y),z) -> sum2(y,+(x,z)) r7: tests(|0|()) -> true() r8: tests(s(x)) -> and(test(rands(rand(|0|()),nil())),x) r9: test(done(y)) -> eq(f(y),g(y)) r10: eq(x,x) -> true() r11: rands(|0|(),y) -> done(y) r12: rands(s(x),y) -> rands(x,|::|(rand(|0|()),y)) r13: rand(x) -> x r14: rand(x) -> rand(s(x)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14 Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: rands#_A(x1,x2) = max{x1 + 42, x2 + 38} s_A(x1) = max{11, x1} |::|_A(x1,x2) = max{1, x1 - 34} rand_A(x1) = max{37, x1 + 12} |0|_A = 25 +_A(x1,x2) = max{x1 + 10, x2} sum1_A(x1) = max{26, x1 + 2} nil_A = 1 cons_A(x1,x2) = max{x1 + 8, x2 + 25} sum2_A(x1,x2) = max{x1 + 11, x2 + 8} tests_A(x1) = x1 + 93 true_A = 1 and_A(x1,x2) = max{x1 + 44, x2 + 93} test_A(x1) = 4 rands_A(x1,x2) = max{12, x2 + 9} done_A(x1) = x1 + 9 eq_A(x1,x2) = max{3, x1 + 2, x2 - 2} f_A(x1) = 1 g_A(x1) = 5 precedence: rands# > + = sum1 > s = |::| = rand = |0| = nil = cons = sum2 = tests = true = and = test = rands = done = eq = f = g partial status: pi(rands#) = [1] pi(s) = [1] pi(|::|) = [] pi(rand) = [] pi(|0|) = [] pi(+) = [1, 2] pi(sum1) = [1] pi(nil) = [] pi(cons) = [2] pi(sum2) = [1, 2] pi(tests) = [1] pi(true) = [] pi(and) = [] pi(test) = [] pi(rands) = [] 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.