YES We show the termination of the TRS R: cond(true(),x,y,z) -> cond(and(gr(x,z),gr(y,z)),p(x),p(y),z) and(true(),true()) -> true() and(x,false()) -> false() and(false(),x) -> false() gr(|0|(),|0|()) -> false() 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: cond#(true(),x,y,z) -> cond#(and(gr(x,z),gr(y,z)),p(x),p(y),z) p2: cond#(true(),x,y,z) -> and#(gr(x,z),gr(y,z)) p3: cond#(true(),x,y,z) -> gr#(x,z) p4: cond#(true(),x,y,z) -> gr#(y,z) p5: cond#(true(),x,y,z) -> p#(x) p6: cond#(true(),x,y,z) -> p#(y) p7: gr#(s(x),s(y)) -> gr#(x,y) and R consists of: r1: cond(true(),x,y,z) -> cond(and(gr(x,z),gr(y,z)),p(x),p(y),z) r2: and(true(),true()) -> true() r3: and(x,false()) -> false() r4: and(false(),x) -> false() r5: gr(|0|(),|0|()) -> false() r6: gr(|0|(),x) -> false() r7: gr(s(x),|0|()) -> true() r8: gr(s(x),s(y)) -> gr(x,y) r9: p(|0|()) -> |0|() r10: p(s(x)) -> x The estimated dependency graph contains the following SCCs: {p1} {p7} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: cond#(true(),x,y,z) -> cond#(and(gr(x,z),gr(y,z)),p(x),p(y),z) and R consists of: r1: cond(true(),x,y,z) -> cond(and(gr(x,z),gr(y,z)),p(x),p(y),z) r2: and(true(),true()) -> true() r3: and(x,false()) -> false() r4: and(false(),x) -> false() r5: gr(|0|(),|0|()) -> false() r6: gr(|0|(),x) -> false() r7: gr(s(x),|0|()) -> true() r8: gr(s(x),s(y)) -> gr(x,y) r9: p(|0|()) -> |0|() r10: p(s(x)) -> x The set of usable rules consists of r2, r3, r4, r5, r6, r7, r8, r9, r10 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: cond#_A(x1,x2,x3,x4) = max{x1 - 10, x2 + 8, x3 + 11} true_A = 22 and_A(x1,x2) = max{20, x1 + 1, x2 + 4} gr_A(x1,x2) = max{13, x1 + 8} p_A(x1) = max{0, x1 - 1} false_A = 0 |0|_A = 0 s_A(x1) = x1 + 23 precedence: cond# = and = gr = p > true = false = |0| = s partial status: pi(cond#) = [2] pi(true) = [] pi(and) = [1, 2] pi(gr) = [1] pi(p) = [] pi(false) = [] pi(|0|) = [] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: cond#_A(x1,x2,x3,x4) = 0 true_A = 4 and_A(x1,x2) = max{x1 + 14, x2 + 14} gr_A(x1,x2) = x1 + 11 p_A(x1) = 2 false_A = 13 |0|_A = 3 s_A(x1) = x1 + 5 precedence: |0| > cond# = true = and = gr = p = false = s partial status: pi(cond#) = [] pi(true) = [] pi(and) = [1, 2] pi(gr) = [] pi(p) = [] pi(false) = [] pi(|0|) = [] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. 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: cond(true(),x,y,z) -> cond(and(gr(x,z),gr(y,z)),p(x),p(y),z) r2: and(true(),true()) -> true() r3: and(x,false()) -> false() r4: and(false(),x) -> false() r5: gr(|0|(),|0|()) -> false() r6: gr(|0|(),x) -> false() r7: gr(s(x),|0|()) -> true() r8: gr(s(x),s(y)) -> gr(x,y) r9: p(|0|()) -> |0|() r10: p(s(x)) -> x The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: gr#_A(x1,x2) = max{2, x1 - 1, x2 + 1} s_A(x1) = max{1, x1} precedence: gr# = s partial status: pi(gr#) = [2] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: gr#_A(x1,x2) = 0 s_A(x1) = max{2, x1} precedence: gr# = s partial status: pi(gr#) = [] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.