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: weighted path order base order: max/plus interpretations on natural numbers: if#_A(x1,x2,x3) = max{x1, x2 + 5} false_A = 10 minus#_A(x1,x2) = x1 + 5 p_A(x1) = max{4, x1 - 1} le_A(x1,x2) = max{5, x1 + 4} |0|_A = 3 s_A(x1) = x1 + 11 true_A = 6 precedence: p > false = minus# = le > if# > |0| = s = true partial status: pi(if#) = [] pi(false) = [] pi(minus#) = [] pi(p) = [] pi(le) = [] pi(|0|) = [] pi(s) = [1] pi(true) = [] 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: weighted path order base order: max/plus interpretations on natural numbers: le#_A(x1,x2) = max{0, x1 - 2, x2 - 2} s_A(x1) = max{3, x1 + 1} precedence: le# = s partial status: pi(le#) = [] pi(s) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.