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 r7, r8, r9, r10, r11, r12, r13, r14, r15 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: cond1#_A(x1,x2) = 0 true_A() = 2 cond2#_A(x1,x2) = 0 even_A(x1) = x1 + 1 false_A() = 5 neq_A(x1,x2) = 1 |0|_A() = 1 p_A(x1) = x1 div2_A(x1) = x1 s_A(x1) = x1 + 3 y_A() = 1 cond1#!_A(x1,x2) = x2 + 3 true!_A() = 5 cond2#!_A(x1,x2) = x2 + 3 even!_A(x1) = x1 + 3 false!_A() = 2 neq!_A(x1,x2) = x1 + 3 |0|!_A() = 6 p!_A(x1) = 0 div2!_A(x1) = 2 s!_A(x1) = 7 y!_A() = 0 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: cond1#_A(x1,x2) = 1 true_A = 15 cond2#_A(x1,x2) = 1 even_A(x1) = max{17, x1 - 16} false_A = 34 neq_A(x1,x2) = max{x1 + 15, x2 + 19} |0|_A = 15 p_A(x1) = max{15, x1 - 34} div2_A(x1) = x1 s_A(x1) = max{36, x1 + 35} y_A = 62 cond1#!_A(x1,x2) = x2 + 33 true!_A = 50 cond2#!_A(x1,x2) = max{x1 + 15, x2 + 33} even!_A(x1) = x1 + 34 false!_A = 24 neq!_A(x1,x2) = max{51, x2 - 12} |0|!_A = 23 p!_A(x1) = 22 div2!_A(x1) = 1 s!_A(x1) = max{25, x1 - 9} y!_A = 52 partial status: pi(cond1#) = [] pi(true) = [] pi(cond2#) = [] pi(even) = [1] pi(false) = [] pi(neq) = [] pi(|0|) = [] pi(p) = [1] pi(div2) = [1] 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, r6, r11, r12, r13 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: cond1#_A(x1,x2) = 0 true_A() = 7 cond2#_A(x1,x2) = 0 even_A(x1) = x1 + 1 neq_A(x1,x2) = x1 + 4 |0|_A() = 5 div2_A(x1) = 5 false_A() = 5 s_A(x1) = 3 cond1#!_A(x1,x2) = 0 true!_A() = 5 cond2#!_A(x1,x2) = 0 even!_A(x1) = x1 + 4 neq!_A(x1,x2) = x1 + 1 |0|!_A() = 6 div2!_A(x1) = x1 + 4 false!_A() = 2 s!_A(x1) = 8 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: cond1#_A(x1,x2) = max{35, x1 + 1, x2 - 1} true_A = 33 cond2#_A(x1,x2) = max{35, x2 - 6} even_A(x1) = x1 + 8 neq_A(x1,x2) = max{1, x1 - 7} |0|_A = 6 div2_A(x1) = max{27, x1 - 5} false_A = 1 s_A(x1) = x1 + 40 cond1#!_A(x1,x2) = max{33, x1 + 2, x2 + 6} true!_A = 50 cond2#!_A(x1,x2) = max{34, x2 + 4} even!_A(x1) = x1 + 7 neq!_A(x1,x2) = max{85, x1 + 45, x2 + 76} |0|!_A = 84 div2!_A(x1) = max{85, x1 + 5} false!_A = 18 s!_A(x1) = max{19, x1 - 11} partial status: pi(cond1#) = [] pi(true) = [] pi(cond2#) = [] pi(even) = [1] pi(neq) = [1, 2] pi(|0|) = [] pi(div2) = [1] 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: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: even#_A(x1) = x1 s_A(x1) = x1 + 1 even#!_A(x1) = x1 + 3 s!_A(x1) = 2 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: even#_A(x1) = 0 s_A(x1) = max{2, x1 - 2} even#!_A(x1) = 0 s!_A(x1) = x1 + 7 partial status: pi(even#) = [1] 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: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: div2#_A(x1) = x1 s_A(x1) = x1 + 1 div2#!_A(x1) = 2 s!_A(x1) = 3 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: div2#_A(x1) = x1 s_A(x1) = x1 + 3 div2#!_A(x1) = x1 + 5 s!_A(x1) = max{9, x1 + 6} partial status: pi(div2#) = [] pi(s) = [1] The following rules are removed: p1 Then no dependency pair remains.