YES We show the termination of the TRS 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))) -- SCC decomposition. Consider the 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))) The estimated dependency graph contains the following SCCs: {p3, p4, p6, p7} {p1} -- Reduction pair. Consider the 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))) The set of usable rules consists of r1, r2, r3, r4, r5, r6 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: g#_A(x1) = max{1, x1 - 13} s_A(x1) = max{24, x1 + 15} f#_A(x1) = max{11, x1 - 22} g_A(x1) = max{21, x1} f_A(x1) = max{24, x1 + 5} minus_A(x1,x2) = max{23, x1, x2 - 25} |0|_A = 0 base order 2: precedence: |0| > f > g > s > g# = f# = minus partial status: pi(g#) = [] pi(s) = [1] pi(f#) = [] pi(g) = [1] pi(f) = [] pi(minus) = [1] pi(|0|) = [] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: g#(s(x)) -> f#(g(x)) p2: f#(s(x)) -> f#(x) p3: 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))) The estimated dependency graph contains the following SCCs: {p1, p2, p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: g#(s(x)) -> f#(g(x)) p2: f#(s(x)) -> g#(f(x)) p3: 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))) The set of usable rules consists of r1, r2, r3, r4, r5, r6 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: g#_A(x1) = max{9, x1 + 3} s_A(x1) = max{24, x1 + 8} f#_A(x1) = max{10, x1 + 5} g_A(x1) = max{18, x1 + 2} f_A(x1) = x1 + 9 minus_A(x1,x2) = max{26, x1 + 1, x2 - 28} |0|_A = 17 base order 2: precedence: f# > g# > s > f > g > minus = |0| partial status: pi(g#) = [1] pi(s) = [1] pi(f#) = [1] pi(g) = [] pi(f) = [] pi(minus) = [1] pi(|0|) = [] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: f#(s(x)) -> g#(f(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))) The estimated dependency graph contains the following SCCs: {p2} -- Reduction pair. Consider the 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))) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: f#_A(x1) = x1 + 1 s_A(x1) = max{6, x1 + 2} base order 2: precedence: s > f# partial status: pi(f#) = [1] pi(s) = [1] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the 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))) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: minus#_A(x1,x2) = max{x1 - 1, x2 + 3} s_A(x1) = max{5, x1 + 3} base order 2: precedence: minus# > s partial status: pi(minus#) = [2] pi(s) = [1] The following rules are removed: p1 Then no dependency pair remains.