YES We show the termination of the TRS R: cond1(true(),x,y,z) -> cond2(gr(y,z),x,y,z) cond2(true(),x,y,z) -> cond2(gr(y,z),x,p(y),z) cond2(false(),x,y,z) -> cond1(gr(x,z),p(x),y,z) 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,z) -> cond2#(gr(y,z),x,y,z) p2: cond1#(true(),x,y,z) -> gr#(y,z) p3: cond2#(true(),x,y,z) -> cond2#(gr(y,z),x,p(y),z) p4: cond2#(true(),x,y,z) -> gr#(y,z) p5: cond2#(true(),x,y,z) -> p#(y) p6: cond2#(false(),x,y,z) -> cond1#(gr(x,z),p(x),y,z) p7: cond2#(false(),x,y,z) -> gr#(x,z) p8: cond2#(false(),x,y,z) -> p#(x) p9: gr#(s(x),s(y)) -> gr#(x,y) and R consists of: r1: cond1(true(),x,y,z) -> cond2(gr(y,z),x,y,z) r2: cond2(true(),x,y,z) -> cond2(gr(y,z),x,p(y),z) r3: cond2(false(),x,y,z) -> cond1(gr(x,z),p(x),y,z) 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,z) -> cond2#(gr(y,z),x,y,z) p2: cond2#(false(),x,y,z) -> cond1#(gr(x,z),p(x),y,z) p3: cond2#(true(),x,y,z) -> cond2#(gr(y,z),x,p(y),z) and R consists of: r1: cond1(true(),x,y,z) -> cond2(gr(y,z),x,y,z) r2: cond2(true(),x,y,z) -> cond2(gr(y,z),x,p(y),z) r3: cond2(false(),x,y,z) -> cond1(gr(x,z),p(x),y,z) 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, >MG) base order 1: max/plus interpretation on natural numbers: cond1#_A(x1,x2,x3,x4) = x3 + 9 true_A = 27 cond2#_A(x1,x2,x3,x4) = max{x1 - 4, x3 + 9} gr_A(x1,x2) = max{8, x1 + 2} false_A = 7 p_A(x1) = max{11, x1 - 10} |0|_A = 10 s_A(x1) = max{28, x1 + 26} base order 2: precedence: s > true > cond1# = cond2# = p > |0| > false > gr partial status: pi(cond1#) = [] pi(true) = [] pi(cond2#) = [] pi(gr) = [] pi(false) = [] pi(p) = [] pi(|0|) = [] pi(s) = [] The following rules are removed: p3 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: cond1#(true(),x,y,z) -> cond2#(gr(y,z),x,y,z) p2: cond2#(false(),x,y,z) -> cond1#(gr(x,z),p(x),y,z) and R consists of: r1: cond1(true(),x,y,z) -> cond2(gr(y,z),x,y,z) r2: cond2(true(),x,y,z) -> cond2(gr(y,z),x,p(y),z) r3: cond2(false(),x,y,z) -> cond1(gr(x,z),p(x),y,z) 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,z) -> cond2#(gr(y,z),x,y,z) p2: cond2#(false(),x,y,z) -> cond1#(gr(x,z),p(x),y,z) and R consists of: r1: cond1(true(),x,y,z) -> cond2(gr(y,z),x,y,z) r2: cond2(true(),x,y,z) -> cond2(gr(y,z),x,p(y),z) r3: cond2(false(),x,y,z) -> cond1(gr(x,z),p(x),y,z) 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, >MG) base order 1: max/plus interpretation on natural numbers: cond1#_A(x1,x2,x3,x4) = max{2, x1 - 7, x2 + 1} true_A = 13 cond2#_A(x1,x2,x3,x4) = max{5, x2 - 1} gr_A(x1,x2) = max{11, x1 - 3} false_A = 1 p_A(x1) = max{3, x1 - 7} |0|_A = 2 s_A(x1) = x1 + 16 base order 2: precedence: gr > cond2# = s > cond1# = p > true > |0| > false partial status: pi(cond1#) = [] pi(true) = [] pi(cond2#) = [] pi(gr) = [] pi(false) = [] pi(p) = [] pi(|0|) = [] pi(s) = [] The following rules are removed: p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: cond1#(true(),x,y,z) -> cond2#(gr(y,z),x,y,z) and R consists of: r1: cond1(true(),x,y,z) -> cond2(gr(y,z),x,y,z) r2: cond2(true(),x,y,z) -> cond2(gr(y,z),x,p(y),z) r3: cond2(false(),x,y,z) -> cond1(gr(x,z),p(x),y,z) 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: (no SCCs) -- 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,z) -> cond2(gr(y,z),x,y,z) r2: cond2(true(),x,y,z) -> cond2(gr(y,z),x,p(y),z) r3: cond2(false(),x,y,z) -> cond1(gr(x,z),p(x),y,z) 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, r8 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: gr#_A(x1,x2) = max{1, x1 - 8, x2 - 11} s_A(x1) = max{10, x1 + 7} gr_A(x1,x2) = max{11, x1 - 11, x2 - 11} |0|_A = 2 false_A = 1 p_A(x1) = max{3, x1 - 6} base order 2: precedence: gr# = gr = p > s > |0| > false partial status: pi(gr#) = [] pi(s) = [1] pi(gr) = [] pi(|0|) = [] pi(false) = [] pi(p) = [] The following rules are removed: p1 Then no dependency pair remains.