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, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: g#_A(x1) = x1 s_A(x1) = x1 + 7 f#_A(x1) = x1 + 4 g_A(x1) = x1 + 1 f_A(x1) = x1 + 11 minus_A(x1,x2) = x1 + 1 |0|_A() = 1 g#!_A(x1) = x1 s!_A(x1) = 10 f#!_A(x1) = x1 + 5 g!_A(x1) = 8 f!_A(x1) = 11 minus!_A(x1,x2) = 7 |0|!_A() = 9 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: g#_A(x1) = max{0, x1 - 23} s_A(x1) = max{22, x1 + 11} f#_A(x1) = max{0, x1 - 23} g_A(x1) = x1 + 2 f_A(x1) = max{12, x1 + 11} minus_A(x1,x2) = max{23, x1 + 2, x2 - 15} |0|_A = 22 g#!_A(x1) = max{5, x1 - 13} s!_A(x1) = 3 f#!_A(x1) = max{4, x1 - 5} g!_A(x1) = 1 f!_A(x1) = max{7, x1 - 23} minus!_A(x1,x2) = max{2, x1 - 33} |0|!_A = 2 partial status: pi(g#) = [1] pi(s) = [1] pi(f#) = [1] pi(g) = [1] pi(f) = [1] pi(minus) = [1] pi(|0|) = [] The following rules are removed: p1, p2, p3, p4 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, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: minus#_A(x1,x2) = x1 + x2 s_A(x1) = x1 + 1 minus#!_A(x1,x2) = x1 + x2 + 2 s!_A(x1) = 1 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: minus#_A(x1,x2) = 0 s_A(x1) = max{8, x1 - 21} minus#!_A(x1,x2) = max{5, x1 - 37} s!_A(x1) = max{4, x1 - 36} partial status: pi(minus#) = [] pi(s) = [] The following rules are removed: p1 Then no dependency pair remains.