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: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: quot#_A(x1,x2) = x1 + 2 s_A(x1) = x1 + 9 minus_A(x1,x2) = x1 + 4 le_A(x1,x2) = max{14, x1 + 6, x2 + 10} |0|_A = 8 true_A = 7 false_A = 0 ifMinus_A(x1,x2,x3) = max{6, x2 + 4} precedence: quot# = minus = |0| > le = true = false = ifMinus > s partial status: pi(quot#) = [1] pi(s) = [1] pi(minus) = [1] pi(le) = [1, 2] pi(|0|) = [] pi(true) = [] pi(false) = [] pi(ifMinus) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: quot#_A(x1,x2) = max{0, x1 - 9} s_A(x1) = max{9, x1 + 4} minus_A(x1,x2) = x1 + 4 le_A(x1,x2) = max{x1 + 14, x2 - 5} |0|_A = 2 true_A = 15 false_A = 3 ifMinus_A(x1,x2,x3) = 0 precedence: quot# = s = minus = le = |0| = true = false = ifMinus partial status: pi(quot#) = [] pi(s) = [1] pi(minus) = [1] pi(le) = [1] pi(|0|) = [] pi(true) = [] pi(false) = [] pi(ifMinus) = [] 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: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: ifMinus#_A(x1,x2,x3) = max{x2 + 1, x3 + 8} false_A = 5 s_A(x1) = x1 + 6 minus#_A(x1,x2) = max{x1 + 1, x2 + 8} le_A(x1,x2) = max{x1 + 5, x2 - 7} |0|_A = 13 true_A = 14 precedence: ifMinus# = s = minus# = le = |0| > false = true partial status: pi(ifMinus#) = [2] pi(false) = [] pi(s) = [1] pi(minus#) = [1] pi(le) = [] pi(|0|) = [] pi(true) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: ifMinus#_A(x1,x2,x3) = max{1, x2} false_A = 7 s_A(x1) = x1 + 8 minus#_A(x1,x2) = x1 le_A(x1,x2) = 1 |0|_A = 0 true_A = 2 precedence: true > ifMinus# = false = s = minus# = le = |0| partial status: pi(ifMinus#) = [] pi(false) = [] pi(s) = [1] pi(minus#) = [1] pi(le) = [] pi(|0|) = [] pi(true) = [] The next rules are strictly ordered: p1, p2 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: 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: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: le#_A(x1,x2) = max{2, x1 - 1, x2 + 1} s_A(x1) = max{1, x1} precedence: le# = s partial status: pi(le#) = [2] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: le#_A(x1,x2) = 0 s_A(x1) = max{2, x1} precedence: le# = s partial status: pi(le#) = [] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.