YES We show the termination of the TRS R: le(|0|(),Y) -> true() le(s(X),|0|()) -> false() le(s(X),s(Y)) -> le(X,Y) minus(|0|(),Y) -> |0|() minus(s(X),Y) -> ifMinus(le(s(X),Y),s(X),Y) ifMinus(true(),s(X),Y) -> |0|() ifMinus(false(),s(X),Y) -> s(minus(X,Y)) quot(|0|(),s(Y)) -> |0|() quot(s(X),s(Y)) -> s(quot(minus(X,Y),s(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#(s(X),Y) -> ifMinus#(le(s(X),Y),s(X),Y) p3: minus#(s(X),Y) -> le#(s(X),Y) p4: ifMinus#(false(),s(X),Y) -> minus#(X,Y) p5: quot#(s(X),s(Y)) -> quot#(minus(X,Y),s(Y)) p6: quot#(s(X),s(Y)) -> minus#(X,Y) and R consists of: r1: le(|0|(),Y) -> true() r2: le(s(X),|0|()) -> false() r3: le(s(X),s(Y)) -> le(X,Y) r4: minus(|0|(),Y) -> |0|() r5: minus(s(X),Y) -> ifMinus(le(s(X),Y),s(X),Y) r6: ifMinus(true(),s(X),Y) -> |0|() r7: ifMinus(false(),s(X),Y) -> s(minus(X,Y)) r8: quot(|0|(),s(Y)) -> |0|() r9: quot(s(X),s(Y)) -> s(quot(minus(X,Y),s(Y))) The estimated dependency graph contains the following SCCs: {p5} {p2, p4} {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: quot#(s(X),s(Y)) -> quot#(minus(X,Y),s(Y)) and R consists of: r1: le(|0|(),Y) -> true() r2: le(s(X),|0|()) -> false() r3: le(s(X),s(Y)) -> le(X,Y) r4: minus(|0|(),Y) -> |0|() r5: minus(s(X),Y) -> ifMinus(le(s(X),Y),s(X),Y) r6: ifMinus(true(),s(X),Y) -> |0|() r7: ifMinus(false(),s(X),Y) -> s(minus(X,Y)) r8: quot(|0|(),s(Y)) -> |0|() r9: quot(s(X),s(Y)) -> s(quot(minus(X,Y),s(Y))) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7 Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: quot#_A(x1,x2) = max{7, x1 + 1} s_A(x1) = x1 + 12 minus_A(x1,x2) = x1 + 4 le_A(x1,x2) = max{16, x1 + 7} |0|_A = 0 true_A = 5 false_A = 15 ifMinus_A(x1,x2,x3) = max{11, x1 - 4, x2 + 4} precedence: s = minus = le = |0| = ifMinus > quot# = true = false partial status: pi(quot#) = [1] pi(s) = [] pi(minus) = [1] pi(le) = [1] pi(|0|) = [] pi(true) = [] pi(false) = [] pi(ifMinus) = [2] 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: ifMinus#(false(),s(X),Y) -> minus#(X,Y) p2: minus#(s(X),Y) -> ifMinus#(le(s(X),Y),s(X),Y) and R consists of: r1: le(|0|(),Y) -> true() r2: le(s(X),|0|()) -> false() r3: le(s(X),s(Y)) -> le(X,Y) r4: minus(|0|(),Y) -> |0|() r5: minus(s(X),Y) -> ifMinus(le(s(X),Y),s(X),Y) r6: ifMinus(true(),s(X),Y) -> |0|() r7: ifMinus(false(),s(X),Y) -> s(minus(X,Y)) r8: quot(|0|(),s(Y)) -> |0|() r9: quot(s(X),s(Y)) -> s(quot(minus(X,Y),s(Y))) The set of usable rules consists of r1, r2, r3 Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: ifMinus#_A(x1,x2,x3) = max{x1 + 2, x2 - 2} false_A = 1 s_A(x1) = max{15, x1 + 8} minus#_A(x1,x2) = x1 + 6 le_A(x1,x2) = 2 |0|_A = 0 true_A = 1 precedence: ifMinus# = false = s = le > minus# = |0| > true partial status: pi(ifMinus#) = [] pi(false) = [] pi(s) = [1] pi(minus#) = [] pi(le) = [] pi(|0|) = [] 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: ifMinus#(false(),s(X),Y) -> minus#(X,Y) and R consists of: r1: le(|0|(),Y) -> true() r2: le(s(X),|0|()) -> false() r3: le(s(X),s(Y)) -> le(X,Y) r4: minus(|0|(),Y) -> |0|() r5: minus(s(X),Y) -> ifMinus(le(s(X),Y),s(X),Y) r6: ifMinus(true(),s(X),Y) -> |0|() r7: ifMinus(false(),s(X),Y) -> s(minus(X,Y)) r8: quot(|0|(),s(Y)) -> |0|() r9: quot(s(X),s(Y)) -> s(quot(minus(X,Y),s(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: le(|0|(),Y) -> true() r2: le(s(X),|0|()) -> false() r3: le(s(X),s(Y)) -> le(X,Y) r4: minus(|0|(),Y) -> |0|() r5: minus(s(X),Y) -> ifMinus(le(s(X),Y),s(X),Y) r6: ifMinus(true(),s(X),Y) -> |0|() r7: ifMinus(false(),s(X),Y) -> s(minus(X,Y)) r8: quot(|0|(),s(Y)) -> |0|() r9: quot(s(X),s(Y)) -> s(quot(minus(X,Y),s(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.