YES We show the termination of the TRS R: cond1(true(),x,y) -> cond2(gr(y,|0|()),x,y) cond2(true(),x,y) -> cond2(gr(y,|0|()),x,p(y)) cond2(false(),x,y) -> cond1(gr(x,|0|()),p(x),y) gr(|0|(),x) -> false() gr(s(x),|0|()) -> true() gr(s(x),s(y)) -> gr(x,y) p(|0|()) -> |0|() p(s(x)) -> x -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: cond1#(true(),x,y) -> cond2#(gr(y,|0|()),x,y) p2: cond1#(true(),x,y) -> gr#(y,|0|()) p3: cond2#(true(),x,y) -> cond2#(gr(y,|0|()),x,p(y)) p4: cond2#(true(),x,y) -> gr#(y,|0|()) p5: cond2#(true(),x,y) -> p#(y) p6: cond2#(false(),x,y) -> cond1#(gr(x,|0|()),p(x),y) p7: cond2#(false(),x,y) -> gr#(x,|0|()) p8: cond2#(false(),x,y) -> p#(x) p9: gr#(s(x),s(y)) -> gr#(x,y) and R consists of: r1: cond1(true(),x,y) -> cond2(gr(y,|0|()),x,y) r2: cond2(true(),x,y) -> cond2(gr(y,|0|()),x,p(y)) r3: cond2(false(),x,y) -> cond1(gr(x,|0|()),p(x),y) r4: gr(|0|(),x) -> false() r5: gr(s(x),|0|()) -> true() r6: gr(s(x),s(y)) -> gr(x,y) r7: p(|0|()) -> |0|() r8: p(s(x)) -> x The estimated dependency graph contains the following SCCs: {p1, p3, p6} {p9} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: cond1#(true(),x,y) -> cond2#(gr(y,|0|()),x,y) p2: cond2#(false(),x,y) -> cond1#(gr(x,|0|()),p(x),y) p3: cond2#(true(),x,y) -> cond2#(gr(y,|0|()),x,p(y)) and R consists of: r1: cond1(true(),x,y) -> cond2(gr(y,|0|()),x,y) r2: cond2(true(),x,y) -> cond2(gr(y,|0|()),x,p(y)) r3: cond2(false(),x,y) -> cond1(gr(x,|0|()),p(x),y) r4: gr(|0|(),x) -> false() r5: gr(s(x),|0|()) -> true() r6: gr(s(x),s(y)) -> gr(x,y) r7: p(|0|()) -> |0|() r8: p(s(x)) -> x The set of usable rules consists of r4, r5, r6, r7, r8 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,x3) = max{1, x2 - 20, x3 - 18} true_A = 29 cond2#_A(x1,x2,x3) = max{1, x2 - 20, x3 - 18} gr_A(x1,x2) = max{1, x1 - 14, x2 - 1} |0|_A = 4 false_A = 0 p_A(x1) = max{19, x1 - 13} s_A(x1) = max{43, x1 + 14} cond1#!_A(x1,x2,x3) = x3 + 5 true!_A = 2 cond2#!_A(x1,x2,x3) = max{x1 - 4, x3 + 5} gr!_A(x1,x2) = 3 |0|!_A = 11 false!_A = 3 p!_A(x1) = max{16, x1 + 6} s!_A(x1) = x1 + 4 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,x3) = 0 true_A() = 1 cond2#_A(x1,x2,x3) = 0 gr_A(x1,x2) = 1 |0|_A() = 1 false_A() = 1 p_A(x1) = x1 + 1 s_A(x1) = x1 + 1 cond1#!_A(x1,x2,x3) = 2 true!_A() = 0 cond2#!_A(x1,x2,x3) = 2 gr!_A(x1,x2) = 3 |0|!_A() = 1 false!_A() = 0 p!_A(x1) = 3 s!_A(x1) = 4 partial status: pi(cond1#) = [] pi(true) = [] pi(cond2#) = [] pi(gr) = [] pi(|0|) = [] pi(false) = [] pi(p) = [1] pi(s) = [1] The following rules are removed: p3 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: cond1#(true(),x,y) -> cond2#(gr(y,|0|()),x,y) p2: cond2#(false(),x,y) -> cond1#(gr(x,|0|()),p(x),y) and R consists of: r1: cond1(true(),x,y) -> cond2(gr(y,|0|()),x,y) r2: cond2(true(),x,y) -> cond2(gr(y,|0|()),x,p(y)) r3: cond2(false(),x,y) -> cond1(gr(x,|0|()),p(x),y) r4: gr(|0|(),x) -> false() r5: gr(s(x),|0|()) -> true() r6: gr(s(x),s(y)) -> gr(x,y) r7: p(|0|()) -> |0|() r8: 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,y) -> cond2#(gr(y,|0|()),x,y) p2: cond2#(false(),x,y) -> cond1#(gr(x,|0|()),p(x),y) and R consists of: r1: cond1(true(),x,y) -> cond2(gr(y,|0|()),x,y) r2: cond2(true(),x,y) -> cond2(gr(y,|0|()),x,p(y)) r3: cond2(false(),x,y) -> cond1(gr(x,|0|()),p(x),y) r4: gr(|0|(),x) -> false() r5: gr(s(x),|0|()) -> true() r6: gr(s(x),s(y)) -> gr(x,y) r7: p(|0|()) -> |0|() r8: p(s(x)) -> x The set of usable rules consists of r4, r5, r7, r8 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,x3) = max{1, x3} true_A = 11 cond2#_A(x1,x2,x3) = max{1, x1 - 2, x3} gr_A(x1,x2) = max{0, x1 - 6} |0|_A = 7 false_A = 1 p_A(x1) = max{7, x1 - 18} s_A(x1) = x1 + 18 cond1#!_A(x1,x2,x3) = max{x1 + 3, x2 + 5} true!_A = 16 cond2#!_A(x1,x2,x3) = max{13, x2 + 4} gr!_A(x1,x2) = max{15, x2 - 8} |0|!_A = 12 false!_A = 2 p!_A(x1) = 1 s!_A(x1) = x1 + 17 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,x3) = 0 true_A() = 0 cond2#_A(x1,x2,x3) = 0 gr_A(x1,x2) = x1 + 1 |0|_A() = 9 false_A() = 1 p_A(x1) = x1 + 3 s_A(x1) = x1 + 2 cond1#!_A(x1,x2,x3) = x1 + x2 + 6 true!_A() = 4 cond2#!_A(x1,x2,x3) = 5 gr!_A(x1,x2) = x1 + 3 |0|!_A() = 0 false!_A() = 11 p!_A(x1) = 11 s!_A(x1) = 2 partial status: pi(cond1#) = [] pi(true) = [] pi(cond2#) = [] pi(gr) = [1] pi(|0|) = [] pi(false) = [] pi(p) = [1] 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: gr#(s(x),s(y)) -> gr#(x,y) and R consists of: r1: cond1(true(),x,y) -> cond2(gr(y,|0|()),x,y) r2: cond2(true(),x,y) -> cond2(gr(y,|0|()),x,p(y)) r3: cond2(false(),x,y) -> cond1(gr(x,|0|()),p(x),y) r4: gr(|0|(),x) -> false() r5: gr(s(x),|0|()) -> true() r6: gr(s(x),s(y)) -> gr(x,y) r7: p(|0|()) -> |0|() r8: 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: gr#_A(x1,x2) = max{x1, x2} s_A(x1) = x1 gr#!_A(x1,x2) = max{4, x1 - 1, x2 - 1} s!_A(x1) = 3 2. marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: gr#_A(x1,x2) = x1 + x2 s_A(x1) = x1 + 1 gr#!_A(x1,x2) = x1 + x2 + 5 s!_A(x1) = 4 partial status: pi(gr#) = [] pi(s) = [1] The following rules are removed: p1 Then no dependency pair remains.