YES We show the termination of the TRS R: -(x,|0|()) -> x -(s(x),s(y)) -> -(x,y) p(s(x)) -> x f(s(x),y) -> f(p(-(s(x),y)),p(-(y,s(x)))) f(x,s(y)) -> f(p(-(x,s(y))),p(-(s(y),x))) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: -#(s(x),s(y)) -> -#(x,y) p2: f#(s(x),y) -> f#(p(-(s(x),y)),p(-(y,s(x)))) p3: f#(s(x),y) -> p#(-(s(x),y)) p4: f#(s(x),y) -> -#(s(x),y) p5: f#(s(x),y) -> p#(-(y,s(x))) p6: f#(s(x),y) -> -#(y,s(x)) p7: f#(x,s(y)) -> f#(p(-(x,s(y))),p(-(s(y),x))) p8: f#(x,s(y)) -> p#(-(x,s(y))) p9: f#(x,s(y)) -> -#(x,s(y)) p10: f#(x,s(y)) -> p#(-(s(y),x)) p11: f#(x,s(y)) -> -#(s(y),x) and R consists of: r1: -(x,|0|()) -> x r2: -(s(x),s(y)) -> -(x,y) r3: p(s(x)) -> x r4: f(s(x),y) -> f(p(-(s(x),y)),p(-(y,s(x)))) r5: f(x,s(y)) -> f(p(-(x,s(y))),p(-(s(y),x))) The estimated dependency graph contains the following SCCs: {p2, p7} {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: f#(x,s(y)) -> f#(p(-(x,s(y))),p(-(s(y),x))) p2: f#(s(x),y) -> f#(p(-(s(x),y)),p(-(y,s(x)))) and R consists of: r1: -(x,|0|()) -> x r2: -(s(x),s(y)) -> -(x,y) r3: p(s(x)) -> x r4: f(s(x),y) -> f(p(-(s(x),y)),p(-(y,s(x)))) r5: f(x,s(y)) -> f(p(-(x,s(y))),p(-(s(y),x))) The set of usable rules consists of r1, r2, r3 Take the reduction pair: lexicographic combination of reduction pairs: 1. max/plus interpretations on natural numbers: f#_A(x1,x2) = max{x1 + 1, x2 + 6} s_A(x1) = x1 + 9 p_A(x1) = max{4, x1 - 8} -_A(x1,x2) = max{10, x1 + 1} |0|_A = 0 2. max/plus interpretations on natural numbers: f#_A(x1,x2) = 0 s_A(x1) = 0 p_A(x1) = 0 -_A(x1,x2) = 0 |0|_A = 0 The next rules are strictly ordered: p1 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: f#(s(x),y) -> f#(p(-(s(x),y)),p(-(y,s(x)))) and R consists of: r1: -(x,|0|()) -> x r2: -(s(x),s(y)) -> -(x,y) r3: p(s(x)) -> x r4: f(s(x),y) -> f(p(-(s(x),y)),p(-(y,s(x)))) r5: f(x,s(y)) -> f(p(-(x,s(y))),p(-(s(y),x))) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: f#(s(x),y) -> f#(p(-(s(x),y)),p(-(y,s(x)))) and R consists of: r1: -(x,|0|()) -> x r2: -(s(x),s(y)) -> -(x,y) r3: p(s(x)) -> x r4: f(s(x),y) -> f(p(-(s(x),y)),p(-(y,s(x)))) r5: f(x,s(y)) -> f(p(-(x,s(y))),p(-(s(y),x))) The set of usable rules consists of r1, r2, r3 Take the reduction pair: lexicographic combination of reduction pairs: 1. max/plus interpretations on natural numbers: f#_A(x1,x2) = max{1, x1 - 4, x2} s_A(x1) = max{7, x1 + 6} p_A(x1) = max{0, x1 - 5} -_A(x1,x2) = max{2, x1 + 1, x2 - 3} |0|_A = 0 2. max/plus interpretations on natural numbers: f#_A(x1,x2) = 0 s_A(x1) = 0 p_A(x1) = 0 -_A(x1,x2) = 0 |0|_A = 0 The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: -#(s(x),s(y)) -> -#(x,y) and R consists of: r1: -(x,|0|()) -> x r2: -(s(x),s(y)) -> -(x,y) r3: p(s(x)) -> x r4: f(s(x),y) -> f(p(-(s(x),y)),p(-(y,s(x)))) r5: f(x,s(y)) -> f(p(-(x,s(y))),p(-(s(y),x))) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. max/plus interpretations on natural numbers: -#_A(x1,x2) = max{x1, x2} s_A(x1) = max{2, x1 + 1} 2. max/plus interpretations on natural numbers: -#_A(x1,x2) = 0 s_A(x1) = 0 The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.