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, >G) base order 1: max/plus interpretation on natural numbers: cond1#_A(x1,x2,x3,x4) = max{18, x2 + 4, x3 - 9, x4 + 17} true_A = 19 cond2#_A(x1,x2,x3,x4) = max{18, x1 - 15, x2, x3 - 9, x4 + 17} gr_A(x1,x2) = x2 + 16 false_A = 6 p_A(x1) = max{8, x1 - 9} |0|_A = 7 s_A(x1) = x1 + 22 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: cond1#_A(x1,x2,x3,x4) = max{1, x4 - 1} true_A = 3 cond2#_A(x1,x2,x3,x4) = max{1, x4 - 1} gr_A(x1,x2) = max{1, x1 - 30} false_A = 1 p_A(x1) = max{17, x1 - 14} |0|_A = 2 s_A(x1) = max{33, x1 + 31} cond1#!_A(x1,x2,x3,x4) = max{29, x1 + 28, x2 + 12} true!_A = 33 cond2#!_A(x1,x2,x3,x4) = max{30, x2 - 1} gr!_A(x1,x2) = max{11, x1 - 1, x2 + 2} false!_A = 12 p!_A(x1) = 9 |0|!_A = 34 s!_A(x1) = max{34, x1 + 1} partial status: pi(cond1#) = [] pi(true) = [] pi(cond2#) = [2] pi(gr) = [] pi(false) = [] pi(p) = [] pi(|0|) = [] pi(s) = [1] The following rules are removed: p1, p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: 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 estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: 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, >G) base order 1: max/plus interpretation on natural numbers: cond2#_A(x1,x2,x3,x4) = max{x1 + 17, x3 + 12} true_A = 6 gr_A(x1,x2) = max{5, x1 - 18} p_A(x1) = max{10, x1 - 13} |0|_A = 9 false_A = 1 s_A(x1) = max{25, x1 + 14} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: cond2#_A(x1,x2,x3,x4) = max{0, x1 - 13, x2 - 6, x3 - 31, x4 - 6} true_A = 0 gr_A(x1,x2) = max{8, x1 - 18, x2 - 1} p_A(x1) = max{30, x1 - 2} |0|_A = 0 false_A = 1 s_A(x1) = max{17, x1 + 2} cond2#!_A(x1,x2,x3,x4) = max{5, x1 + 4, x3 + 1} true!_A = 4 gr!_A(x1,x2) = max{3, x1 - 66, x2 - 13} p!_A(x1) = max{6, x1 + 2} |0|!_A = 5 false!_A = 1 s!_A(x1) = 5 partial status: pi(cond2#) = [] pi(true) = [] pi(gr) = [] pi(p) = [] pi(|0|) = [] pi(false) = [] 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: 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 (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: gr#_A(x1,x2) = 0 s_A(x1) = max{4, x1 - 12} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: gr#_A(x1,x2) = max{x1, x2} s_A(x1) = max{6, x1 + 1} gr#!_A(x1,x2) = max{3, x1 - 2, x2 - 21} s!_A(x1) = max{2, x1 - 20} partial status: pi(gr#) = [] pi(s) = [] The following rules are removed: p1 Then no dependency pair remains.