YES We show the termination of the TRS R: p(|0|()) -> |0|() p(s(x)) -> x le(|0|(),y) -> true() le(s(x),|0|()) -> false() le(s(x),s(y)) -> le(x,y) minus(x,y) -> if(le(x,y),x,y) if(true(),x,y) -> |0|() if(false(),x,y) -> s(minus(p(x),y)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: le#(s(x),s(y)) -> le#(x,y) p2: minus#(x,y) -> if#(le(x,y),x,y) p3: minus#(x,y) -> le#(x,y) p4: if#(false(),x,y) -> minus#(p(x),y) p5: if#(false(),x,y) -> p#(x) and R consists of: r1: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: le(|0|(),y) -> true() r4: le(s(x),|0|()) -> false() r5: le(s(x),s(y)) -> le(x,y) r6: minus(x,y) -> if(le(x,y),x,y) r7: if(true(),x,y) -> |0|() r8: if(false(),x,y) -> s(minus(p(x),y)) The estimated dependency graph contains the following SCCs: {p2, p4} {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: if#(false(),x,y) -> minus#(p(x),y) p2: minus#(x,y) -> if#(le(x,y),x,y) and R consists of: r1: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: le(|0|(),y) -> true() r4: le(s(x),|0|()) -> false() r5: le(s(x),s(y)) -> le(x,y) r6: minus(x,y) -> if(le(x,y),x,y) r7: if(true(),x,y) -> |0|() r8: if(false(),x,y) -> s(minus(p(x),y)) The set of usable rules consists of r1, r2, r3, r4, r5 Take the reduction pair: max/plus interpretations on natural numbers: if#_A(x1,x2,x3) = max{x1, x2 + 2} false_A = 3 minus#_A(x1,x2) = x1 + 3 p_A(x1) = max{0, x1 - 1} le_A(x1,x2) = max{0, x1 - 1} |0|_A = 0 s_A(x1) = max{4, x1 + 1} true_A = 0 The next rules are strictly ordered: p2 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: if#(false(),x,y) -> minus#(p(x),y) and R consists of: r1: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: le(|0|(),y) -> true() r4: le(s(x),|0|()) -> false() r5: le(s(x),s(y)) -> le(x,y) r6: minus(x,y) -> if(le(x,y),x,y) r7: if(true(),x,y) -> |0|() r8: if(false(),x,y) -> s(minus(p(x),y)) The estimated dependency graph contains the following SCCs: (no SCCs) -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: le#(s(x),s(y)) -> le#(x,y) and R consists of: r1: p(|0|()) -> |0|() r2: p(s(x)) -> x r3: le(|0|(),y) -> true() r4: le(s(x),|0|()) -> false() r5: le(s(x),s(y)) -> le(x,y) r6: minus(x,y) -> if(le(x,y),x,y) r7: if(true(),x,y) -> |0|() r8: if(false(),x,y) -> s(minus(p(x),y)) The set of usable rules consists of (no rules) Take the reduction pair: max/plus interpretations on natural numbers: le#_A(x1,x2) = max{x1 + 1, x2 + 1} s_A(x1) = x1 + 1 The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.