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: 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!): max/plus interpretation on natural numbers: cond1#_A(x1,x2) = max{1, x1 - 80, x2 - 32} true_A = 45 cond2#_A(x1,x2) = max{1, x2 - 32} even_A(x1) = x1 + 14 false_A = 48 neq_A(x1,x2) = max{48, x1 - 32, x2 - 59} |0|_A = 31 p_A(x1) = max{33, x1 - 32} div2_A(x1) = max{31, x1 - 9} s_A(x1) = x1 + 58 y_A = 17 cond1#!_A(x1,x2) = max{30, x1 - 58, x2} true!_A = 25 cond2#!_A(x1,x2) = max{29, x1 - 14, x2 - 9} even!_A(x1) = max{9, x1 - 5} false!_A = 8 neq!_A(x1,x2) = max{28, x1 - 32, x2 - 5} |0|!_A = 24 p!_A(x1) = max{23, x1 - 8} div2!_A(x1) = 9 s!_A(x1) = max{28, x1 + 10} y!_A = 11 2. 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() = 0 cond2#_A(x1,x2) = 0 even_A(x1) = x1 + 1 false_A() = 8 neq_A(x1,x2) = 8 |0|_A() = 7 p_A(x1) = x1 div2_A(x1) = 7 s_A(x1) = x1 y_A() = 1 cond1#!_A(x1,x2) = 7 true!_A() = 12 cond2#!_A(x1,x2) = 7 even!_A(x1) = 6 false!_A() = 5 neq!_A(x1,x2) = 1 |0|!_A() = 8 p!_A(x1) = 9 div2!_A(x1) = 9 s!_A(x1) = 7 y!_A() = 0 partial status: pi(cond1#) = [] pi(true) = [] pi(cond2#) = [] pi(even) = [] 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, r8, r9, r10, 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!): max/plus interpretation on natural numbers: cond1#_A(x1,x2) = max{1, x1 - 27, x2 - 8} true_A = 25 cond2#_A(x1,x2) = max{1, x2 - 16} even_A(x1) = 25 neq_A(x1,x2) = max{12, x1 + 11} |0|_A = 3 div2_A(x1) = max{6, x1 - 8} false_A = 14 s_A(x1) = x1 + 14 cond1#!_A(x1,x2) = max{x1 - 13, x2 + 5} true!_A = 13 cond2#!_A(x1,x2) = max{12, x2 + 5} even!_A(x1) = x1 + 10 neq!_A(x1,x2) = x2 + 31 |0|!_A = 17 div2!_A(x1) = max{34, x1 + 30} false!_A = 1 s!_A(x1) = x1 + 53 2. 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() = 6 cond2#_A(x1,x2) = 0 even_A(x1) = x1 + 2 neq_A(x1,x2) = x1 + 1 |0|_A() = 4 div2_A(x1) = x1 + 1 false_A() = 1 s_A(x1) = x1 + 5 cond1#!_A(x1,x2) = x2 + 4 true!_A() = 6 cond2#!_A(x1,x2) = x1 + 1 even!_A(x1) = x1 + 3 neq!_A(x1,x2) = 3 |0|!_A() = 5 div2!_A(x1) = 8 false!_A() = 3 s!_A(x1) = 4 partial status: pi(cond1#) = [] pi(true) = [] pi(cond2#) = [] pi(even) = [1] pi(neq) = [1, 2] pi(|0|) = [] pi(div2) = [1] pi(false) = [] pi(s) = [1] 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!): max/plus interpretation on natural numbers: even#_A(x1) = 0 s_A(x1) = max{13, x1 + 11} even#!_A(x1) = max{7, x1 - 14} s!_A(x1) = x1 + 6 2. 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 + 2 even#!_A(x1) = 3 s!_A(x1) = 4 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 r7, r9 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!): max/plus interpretation on natural numbers: div2#_A(x1) = 0 s_A(x1) = max{25, x1 - 28} neq_A(x1,x2) = max{18, x2 - 1} y_A = 0 even_A(x1) = max{21, x1 - 26} |0|_A = 17 false_A = 19 div2#!_A(x1) = x1 + 58 s!_A(x1) = x1 + 87 neq!_A(x1,x2) = max{15, x2 - 12} y!_A = 14 even!_A(x1) = max{102, x1 - 26} |0|!_A = 3 false!_A = 103 2. 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 + 2 neq_A(x1,x2) = x1 + 1 y_A() = 1 even_A(x1) = x1 + 1 |0|_A() = 2 false_A() = 5 div2#!_A(x1) = 7 s!_A(x1) = 8 neq!_A(x1,x2) = 1 y!_A() = 0 even!_A(x1) = x1 + 1 |0|!_A() = 7 false!_A() = 6 partial status: pi(div2#) = [1] pi(s) = [1] pi(neq) = [] pi(y) = [] pi(even) = [1] pi(|0|) = [] pi(false) = [] The following rules are removed: p1 Then no dependency pair remains.