YES We show the termination of the relative TRS R/S: R: minus(x,|0|()) -> x minus(s(x),s(y)) -> minus(x,y) f(|0|()) -> s(|0|()) f(s(x)) -> minus(s(x),g(f(x))) g(|0|()) -> |0|() g(s(x)) -> minus(s(x),f(g(x))) 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: minus#(s(x),s(y)) -> minus#(x,y) p2: f#(s(x)) -> minus#(s(x),g(f(x))) p3: f#(s(x)) -> g#(f(x)) p4: f#(s(x)) -> f#(x) p5: g#(s(x)) -> minus#(s(x),f(g(x))) p6: g#(s(x)) -> f#(g(x)) p7: g#(s(x)) -> g#(x) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: f(|0|()) -> s(|0|()) r4: f(s(x)) -> minus(s(x),g(f(x))) r5: g(|0|()) -> |0|() r6: g(s(x)) -> minus(s(x),f(g(x))) r7: rand(x) -> x r8: rand(x) -> rand(s(x)) The estimated dependency graph contains the following SCCs: {p3, p4, p6, p7} {p1} -- Reduction pair. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: g#(s(x)) -> g#(x) p2: g#(s(x)) -> f#(g(x)) p3: f#(s(x)) -> f#(x) p4: f#(s(x)) -> g#(f(x)) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: f(|0|()) -> s(|0|()) r4: f(s(x)) -> minus(s(x),g(f(x))) r5: g(|0|()) -> |0|() r6: g(s(x)) -> minus(s(x),f(g(x))) 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: g#_A(x1) = x1 + (0,1) s_A(x1) = ((1,0),(1,1)) x1 + (0,6) f#_A(x1) = x1 + (0,3) g_A(x1) = ((1,0),(1,1)) x1 + (0,2) f_A(x1) = ((1,0),(1,1)) x1 + (0,7) minus_A(x1,x2) = x1 + (0,1) |0|_A() = (1,0) rand_A(x1) = ((1,0),(0,0)) x1 + (1,1) precedence: f = rand > s > f# > g# > g > minus = |0| partial status: pi(g#) = [1] pi(s) = [1] pi(f#) = [] pi(g) = [] pi(f) = [1] pi(minus) = [] pi(|0|) = [] pi(rand) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: g#_A(x1) = ((1,0),(1,1)) x1 + (1,2) s_A(x1) = ((0,0),(1,0)) x1 + (4,1) f#_A(x1) = (3,6) g_A(x1) = (0,0) f_A(x1) = x1 + (1,2) minus_A(x1,x2) = (0,0) |0|_A() = (5,7) rand_A(x1) = (0,0) precedence: s > rand > g = minus > f# = f = |0| > g# partial status: pi(g#) = [1] pi(s) = [] pi(f#) = [] pi(g) = [] pi(f) = [1] pi(minus) = [] pi(|0|) = [] pi(rand) = [] The next rules are strictly ordered: p1, p4 We remove them from the problem. -- SCC decomposition. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: g#(s(x)) -> f#(g(x)) p2: f#(s(x)) -> f#(x) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: f(|0|()) -> s(|0|()) r4: f(s(x)) -> minus(s(x),g(f(x))) r5: g(|0|()) -> |0|() r6: g(s(x)) -> minus(s(x),f(g(x))) r7: rand(x) -> x r8: rand(x) -> rand(s(x)) The estimated dependency graph contains the following SCCs: {p2} -- Reduction pair. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: f#(s(x)) -> f#(x) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: f(|0|()) -> s(|0|()) r4: f(s(x)) -> minus(s(x),g(f(x))) r5: g(|0|()) -> |0|() r6: g(s(x)) -> minus(s(x),f(g(x))) 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: f#_A(x1) = x1 + (1,2) s_A(x1) = x1 + (0,1) minus_A(x1,x2) = ((1,0),(0,0)) x1 + (1,2) |0|_A() = (1,1) f_A(x1) = x1 + (2,2) g_A(x1) = x1 + (2,2) rand_A(x1) = ((1,0),(0,0)) x1 + (1,2) precedence: s = minus = |0| = f = g = rand > f# partial status: pi(f#) = [1] pi(s) = [] pi(minus) = [] pi(|0|) = [] pi(f) = [] pi(g) = [] pi(rand) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: f#_A(x1) = (0,0) s_A(x1) = (0,2) minus_A(x1,x2) = (0,0) |0|_A() = (1,1) f_A(x1) = (2,3) g_A(x1) = (2,3) rand_A(x1) = (0,0) precedence: f# = s > minus = |0| = f = g = rand partial status: pi(f#) = [] pi(s) = [] pi(minus) = [] pi(|0|) = [] pi(f) = [] pi(g) = [] pi(rand) = [] 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: minus#(s(x),s(y)) -> minus#(x,y) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: f(|0|()) -> s(|0|()) r4: f(s(x)) -> minus(s(x),g(f(x))) r5: g(|0|()) -> |0|() r6: g(s(x)) -> minus(s(x),f(g(x))) 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: minus#_A(x1,x2) = x2 s_A(x1) = x1 + (0,5) minus_A(x1,x2) = x1 + (1,1) |0|_A() = (1,1) f_A(x1) = x1 + (2,2) g_A(x1) = ((1,0),(1,1)) x1 + (2,2) rand_A(x1) = ((1,0),(0,0)) x1 + (1,0) precedence: minus# > s = f = g > minus = |0| = rand partial status: pi(minus#) = [2] pi(s) = [1] pi(minus) = [1] pi(|0|) = [] pi(f) = [] pi(g) = [1] pi(rand) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: minus#_A(x1,x2) = (0,0) s_A(x1) = (3,3) minus_A(x1,x2) = (1,1) |0|_A() = (1,1) f_A(x1) = (4,4) g_A(x1) = (2,2) rand_A(x1) = (0,0) precedence: s > minus > rand > minus# = |0| = f = g partial status: pi(minus#) = [] pi(s) = [] pi(minus) = [] pi(|0|) = [] pi(f) = [] pi(g) = [] pi(rand) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.