YES We show the termination of the TRS R: minus(n__0(),Y) -> |0|() minus(n__s(X),n__s(Y)) -> minus(activate(X),activate(Y)) geq(X,n__0()) -> true() geq(n__0(),n__s(Y)) -> false() geq(n__s(X),n__s(Y)) -> geq(activate(X),activate(Y)) div(|0|(),n__s(Y)) -> |0|() div(s(X),n__s(Y)) -> if(geq(X,activate(Y)),n__s(div(minus(X,activate(Y)),n__s(activate(Y)))),n__0()) if(true(),X,Y) -> activate(X) if(false(),X,Y) -> activate(Y) |0|() -> n__0() s(X) -> n__s(X) activate(n__0()) -> |0|() activate(n__s(X)) -> s(X) activate(X) -> X -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: minus#(n__0(),Y) -> |0|#() p2: minus#(n__s(X),n__s(Y)) -> minus#(activate(X),activate(Y)) p3: minus#(n__s(X),n__s(Y)) -> activate#(X) p4: minus#(n__s(X),n__s(Y)) -> activate#(Y) p5: geq#(n__s(X),n__s(Y)) -> geq#(activate(X),activate(Y)) p6: geq#(n__s(X),n__s(Y)) -> activate#(X) p7: geq#(n__s(X),n__s(Y)) -> activate#(Y) p8: div#(s(X),n__s(Y)) -> if#(geq(X,activate(Y)),n__s(div(minus(X,activate(Y)),n__s(activate(Y)))),n__0()) p9: div#(s(X),n__s(Y)) -> geq#(X,activate(Y)) p10: div#(s(X),n__s(Y)) -> activate#(Y) p11: div#(s(X),n__s(Y)) -> div#(minus(X,activate(Y)),n__s(activate(Y))) p12: div#(s(X),n__s(Y)) -> minus#(X,activate(Y)) p13: if#(true(),X,Y) -> activate#(X) p14: if#(false(),X,Y) -> activate#(Y) p15: activate#(n__0()) -> |0|#() p16: activate#(n__s(X)) -> s#(X) and R consists of: r1: minus(n__0(),Y) -> |0|() r2: minus(n__s(X),n__s(Y)) -> minus(activate(X),activate(Y)) r3: geq(X,n__0()) -> true() r4: geq(n__0(),n__s(Y)) -> false() r5: geq(n__s(X),n__s(Y)) -> geq(activate(X),activate(Y)) r6: div(|0|(),n__s(Y)) -> |0|() r7: div(s(X),n__s(Y)) -> if(geq(X,activate(Y)),n__s(div(minus(X,activate(Y)),n__s(activate(Y)))),n__0()) r8: if(true(),X,Y) -> activate(X) r9: if(false(),X,Y) -> activate(Y) r10: |0|() -> n__0() r11: s(X) -> n__s(X) r12: activate(n__0()) -> |0|() r13: activate(n__s(X)) -> s(X) r14: activate(X) -> X The estimated dependency graph contains the following SCCs: {p11} {p2} {p5} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: div#(s(X),n__s(Y)) -> div#(minus(X,activate(Y)),n__s(activate(Y))) and R consists of: r1: minus(n__0(),Y) -> |0|() r2: minus(n__s(X),n__s(Y)) -> minus(activate(X),activate(Y)) r3: geq(X,n__0()) -> true() r4: geq(n__0(),n__s(Y)) -> false() r5: geq(n__s(X),n__s(Y)) -> geq(activate(X),activate(Y)) r6: div(|0|(),n__s(Y)) -> |0|() r7: div(s(X),n__s(Y)) -> if(geq(X,activate(Y)),n__s(div(minus(X,activate(Y)),n__s(activate(Y)))),n__0()) r8: if(true(),X,Y) -> activate(X) r9: if(false(),X,Y) -> activate(Y) r10: |0|() -> n__0() r11: s(X) -> n__s(X) r12: activate(n__0()) -> |0|() r13: activate(n__s(X)) -> s(X) r14: activate(X) -> X The set of usable rules consists of r1, r2, r10, r11, r12, r13, r14 Take the reduction pair: matrix interpretations: carrier: N^1 order: standard order interpretations: div#_A(x1,x2) = x1 s_A(x1) = 2 n__s_A(x1) = 1 minus_A(x1,x2) = 1 activate_A(x1) = x1 + 1 |0|_A() = 1 n__0_A() = 1 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: minus#(n__s(X),n__s(Y)) -> minus#(activate(X),activate(Y)) and R consists of: r1: minus(n__0(),Y) -> |0|() r2: minus(n__s(X),n__s(Y)) -> minus(activate(X),activate(Y)) r3: geq(X,n__0()) -> true() r4: geq(n__0(),n__s(Y)) -> false() r5: geq(n__s(X),n__s(Y)) -> geq(activate(X),activate(Y)) r6: div(|0|(),n__s(Y)) -> |0|() r7: div(s(X),n__s(Y)) -> if(geq(X,activate(Y)),n__s(div(minus(X,activate(Y)),n__s(activate(Y)))),n__0()) r8: if(true(),X,Y) -> activate(X) r9: if(false(),X,Y) -> activate(Y) r10: |0|() -> n__0() r11: s(X) -> n__s(X) r12: activate(n__0()) -> |0|() r13: activate(n__s(X)) -> s(X) r14: activate(X) -> X The set of usable rules consists of r10, r11, r12, r13, r14 Take the monotone reduction pair: matrix interpretations: carrier: N^1 order: standard order interpretations: minus#_A(x1,x2) = x1 + x2 n__s_A(x1) = x1 + 1 activate_A(x1) = x1 |0|_A() = 0 n__0_A() = 0 s_A(x1) = x1 + 1 The next rules are strictly ordered: p1 r1, r2, r3, r4, r5, r6, r7, r8, r9 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: geq#(n__s(X),n__s(Y)) -> geq#(activate(X),activate(Y)) and R consists of: r1: minus(n__0(),Y) -> |0|() r2: minus(n__s(X),n__s(Y)) -> minus(activate(X),activate(Y)) r3: geq(X,n__0()) -> true() r4: geq(n__0(),n__s(Y)) -> false() r5: geq(n__s(X),n__s(Y)) -> geq(activate(X),activate(Y)) r6: div(|0|(),n__s(Y)) -> |0|() r7: div(s(X),n__s(Y)) -> if(geq(X,activate(Y)),n__s(div(minus(X,activate(Y)),n__s(activate(Y)))),n__0()) r8: if(true(),X,Y) -> activate(X) r9: if(false(),X,Y) -> activate(Y) r10: |0|() -> n__0() r11: s(X) -> n__s(X) r12: activate(n__0()) -> |0|() r13: activate(n__s(X)) -> s(X) r14: activate(X) -> X The set of usable rules consists of r10, r11, r12, r13, r14 Take the monotone reduction pair: matrix interpretations: carrier: N^1 order: standard order interpretations: geq#_A(x1,x2) = x1 + x2 n__s_A(x1) = x1 + 1 activate_A(x1) = x1 |0|_A() = 0 n__0_A() = 0 s_A(x1) = x1 + 1 The next rules are strictly ordered: p1 r1, r2, r3, r4, r5, r6, r7, r8, r9 We remove them from the problem. Then no dependency pair remains.