YES We show the termination of the TRS R: cond1(true(),x) -> cond2(even(x),x) cond2(true(),x) -> cond1(neq(x,|0|()),div2(x)) cond2(false(),x) -> cond1(neq(x,|0|()),p(x)) neq(|0|(),|0|()) -> false() neq(|0|(),s(x)) -> true() neq(s(x),|0|()) -> true() neq(s(x),s(y())) -> neq(x,y()) even(|0|()) -> true() even(s(|0|())) -> false() even(s(s(x))) -> even(x) div2(|0|()) -> |0|() div2(s(|0|())) -> |0|() div2(s(s(x))) -> s(div2(x)) p(|0|()) -> |0|() p(s(x)) -> x -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: cond1#(true(),x) -> cond2#(even(x),x) p2: cond1#(true(),x) -> even#(x) p3: cond2#(true(),x) -> cond1#(neq(x,|0|()),div2(x)) p4: cond2#(true(),x) -> neq#(x,|0|()) p5: cond2#(true(),x) -> div2#(x) p6: cond2#(false(),x) -> cond1#(neq(x,|0|()),p(x)) p7: cond2#(false(),x) -> neq#(x,|0|()) p8: cond2#(false(),x) -> p#(x) p9: neq#(s(x),s(y())) -> neq#(x,y()) p10: even#(s(s(x))) -> even#(x) p11: div2#(s(s(x))) -> div2#(x) and R consists of: r1: cond1(true(),x) -> cond2(even(x),x) r2: cond2(true(),x) -> cond1(neq(x,|0|()),div2(x)) r3: cond2(false(),x) -> cond1(neq(x,|0|()),p(x)) r4: neq(|0|(),|0|()) -> false() r5: neq(|0|(),s(x)) -> true() r6: neq(s(x),|0|()) -> true() r7: neq(s(x),s(y())) -> neq(x,y()) r8: even(|0|()) -> true() r9: even(s(|0|())) -> false() r10: even(s(s(x))) -> even(x) r11: div2(|0|()) -> |0|() r12: div2(s(|0|())) -> |0|() r13: div2(s(s(x))) -> s(div2(x)) r14: p(|0|()) -> |0|() r15: p(s(x)) -> x The estimated dependency graph contains the following SCCs: {p1, p3, p6} {p10} {p11} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: cond1#(true(),x) -> cond2#(even(x),x) p2: cond2#(false(),x) -> cond1#(neq(x,|0|()),p(x)) p3: cond2#(true(),x) -> cond1#(neq(x,|0|()),div2(x)) and R consists of: r1: cond1(true(),x) -> cond2(even(x),x) r2: cond2(true(),x) -> cond1(neq(x,|0|()),div2(x)) r3: cond2(false(),x) -> cond1(neq(x,|0|()),p(x)) r4: neq(|0|(),|0|()) -> false() r5: neq(|0|(),s(x)) -> true() r6: neq(s(x),|0|()) -> true() r7: neq(s(x),s(y())) -> neq(x,y()) r8: even(|0|()) -> true() r9: even(s(|0|())) -> false() r10: even(s(s(x))) -> even(x) r11: div2(|0|()) -> |0|() r12: div2(s(|0|())) -> |0|() r13: div2(s(s(x))) -> s(div2(x)) r14: p(|0|()) -> |0|() r15: p(s(x)) -> x The set of usable rules consists of r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: cond1#_A(x1,x2) = max{50, x1 + 5, x2 - 12} true_A = 47 cond2#_A(x1,x2) = max{52, x1 - 62, x2 - 20} even_A(x1) = max{49, x1 - 49} false_A = 35 neq_A(x1,x2) = max{47, x1 - 25, x2 - 31} |0|_A = 10 p_A(x1) = max{36, x1 - 23} div2_A(x1) = max{11, x1 - 9} s_A(x1) = x1 + 24 y_A = 6 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: cond1#_A(x1,x2) = max{0, x1 - 10, x2 - 18} true_A = 0 cond2#_A(x1,x2) = max{0, x1 - 9, x2 - 28} even_A(x1) = max{0, x1 - 28} false_A = 7 neq_A(x1,x2) = max{9, x1 - 30, x2 - 28} |0|_A = 17 p_A(x1) = max{17, x1 - 18} div2_A(x1) = max{17, x1 - 10} s_A(x1) = max{27, x1 + 18} y_A = 26 cond1#!_A(x1,x2) = max{0, x2 - 29} true!_A = 1 cond2#!_A(x1,x2) = max{0, x1 - 1, x2 - 32} even!_A(x1) = max{8, x1 - 37} false!_A = 4 neq!_A(x1,x2) = max{2, x2 - 83} |0|!_A = 1 p!_A(x1) = max{5, x1 - 68} div2!_A(x1) = max{2, x1 - 103} s!_A(x1) = max{3, x1 - 56} y!_A = 3 partial status: pi(cond1#) = [] pi(true) = [] pi(cond2#) = [] pi(even) = [] pi(false) = [] pi(neq) = [] pi(|0|) = [] pi(p) = [] pi(div2) = [] pi(s) = [1] pi(y) = [] The following rules are removed: p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: cond1#(true(),x) -> cond2#(even(x),x) p2: cond2#(true(),x) -> cond1#(neq(x,|0|()),div2(x)) and R consists of: r1: cond1(true(),x) -> cond2(even(x),x) r2: cond2(true(),x) -> cond1(neq(x,|0|()),div2(x)) r3: cond2(false(),x) -> cond1(neq(x,|0|()),p(x)) r4: neq(|0|(),|0|()) -> false() r5: neq(|0|(),s(x)) -> true() r6: neq(s(x),|0|()) -> true() r7: neq(s(x),s(y())) -> neq(x,y()) r8: even(|0|()) -> true() r9: even(s(|0|())) -> false() r10: even(s(s(x))) -> even(x) r11: div2(|0|()) -> |0|() r12: div2(s(|0|())) -> |0|() r13: div2(s(s(x))) -> s(div2(x)) r14: p(|0|()) -> |0|() r15: p(s(x)) -> x The estimated dependency graph contains the following SCCs: {p1, p2} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: cond1#(true(),x) -> cond2#(even(x),x) p2: cond2#(true(),x) -> cond1#(neq(x,|0|()),div2(x)) and R consists of: r1: cond1(true(),x) -> cond2(even(x),x) r2: cond2(true(),x) -> cond1(neq(x,|0|()),div2(x)) r3: cond2(false(),x) -> cond1(neq(x,|0|()),p(x)) r4: neq(|0|(),|0|()) -> false() r5: neq(|0|(),s(x)) -> true() r6: neq(s(x),|0|()) -> true() r7: neq(s(x),s(y())) -> neq(x,y()) r8: even(|0|()) -> true() r9: even(s(|0|())) -> false() r10: even(s(s(x))) -> even(x) r11: div2(|0|()) -> |0|() r12: div2(s(|0|())) -> |0|() r13: div2(s(s(x))) -> s(div2(x)) r14: p(|0|()) -> |0|() r15: p(s(x)) -> x The set of usable rules consists of r4, r5, r6, r11, r12, r13 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: cond1#_A(x1,x2) = max{41, x1 + 3, x2 + 27} true_A = 40 cond2#_A(x1,x2) = max{42, x2 + 26} even_A(x1) = 20 neq_A(x1,x2) = max{38, x1 + 22, x2 + 16} |0|_A = 11 div2_A(x1) = max{12, x1 - 10} false_A = 37 s_A(x1) = max{41, x1 + 21} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: cond1#_A(x1,x2) = max{46, x1 - 50, x2 + 7} true_A = 49 cond2#_A(x1,x2) = max{46, x2 - 11} even_A(x1) = 61 neq_A(x1,x2) = max{48, x1 + 39, x2 + 30} |0|_A = 10 div2_A(x1) = max{39, x1 - 18} false_A = 40 s_A(x1) = 18 cond1#!_A(x1,x2) = max{20, x1 - 20, x2 + 18} true!_A = 3 cond2#!_A(x1,x2) = 19 even!_A(x1) = 2 neq!_A(x1,x2) = max{2, x2 - 11} |0|!_A = 4 div2!_A(x1) = max{20, x1 - 19} false!_A = 6 s!_A(x1) = 5 partial status: pi(cond1#) = [] pi(true) = [] pi(cond2#) = [2] pi(even) = [] pi(neq) = [2] pi(|0|) = [] pi(div2) = [] pi(false) = [] pi(s) = [] The following rules are removed: p1, p2 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: even#(s(s(x))) -> even#(x) and R consists of: r1: cond1(true(),x) -> cond2(even(x),x) r2: cond2(true(),x) -> cond1(neq(x,|0|()),div2(x)) r3: cond2(false(),x) -> cond1(neq(x,|0|()),p(x)) r4: neq(|0|(),|0|()) -> false() r5: neq(|0|(),s(x)) -> true() r6: neq(s(x),|0|()) -> true() r7: neq(s(x),s(y())) -> neq(x,y()) r8: even(|0|()) -> true() r9: even(s(|0|())) -> false() r10: even(s(s(x))) -> even(x) r11: div2(|0|()) -> |0|() r12: div2(s(|0|())) -> |0|() r13: div2(s(s(x))) -> s(div2(x)) r14: p(|0|()) -> |0|() r15: p(s(x)) -> x The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: even#_A(x1) = max{1, x1 - 11} s_A(x1) = max{13, x1 + 5} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: even#_A(x1) = 0 s_A(x1) = max{9, x1 - 4} even#!_A(x1) = max{5, x1 - 10} s!_A(x1) = max{4, x1 - 11} partial status: pi(even#) = [] pi(s) = [1] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: div2#(s(s(x))) -> div2#(x) and R consists of: r1: cond1(true(),x) -> cond2(even(x),x) r2: cond2(true(),x) -> cond1(neq(x,|0|()),div2(x)) r3: cond2(false(),x) -> cond1(neq(x,|0|()),p(x)) r4: neq(|0|(),|0|()) -> false() r5: neq(|0|(),s(x)) -> true() r6: neq(s(x),|0|()) -> true() r7: neq(s(x),s(y())) -> neq(x,y()) r8: even(|0|()) -> true() r9: even(s(|0|())) -> false() r10: even(s(s(x))) -> even(x) r11: div2(|0|()) -> |0|() r12: div2(s(|0|())) -> |0|() r13: div2(s(s(x))) -> s(div2(x)) r14: p(|0|()) -> |0|() r15: p(s(x)) -> x The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: div2#_A(x1) = max{7, x1 - 7} s_A(x1) = max{15, x1 + 3} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: div2#_A(x1) = 0 s_A(x1) = max{10, x1 - 4} div2#!_A(x1) = max{9, x1 - 34} s!_A(x1) = max{8, x1 - 33} partial status: pi(div2#) = [] pi(s) = [1] The following rules are removed: p1 Then no dependency pair remains.