YES We show the termination of the TRS R: cond(true(),x,y) -> cond(gr(x,y),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: cond#(true(),x,y) -> cond#(gr(x,y),p(x),y) p2: cond#(true(),x,y) -> gr#(x,y) p3: cond#(true(),x,y) -> p#(x) p4: gr#(s(x),s(y)) -> gr#(x,y) and R consists of: r1: cond(true(),x,y) -> cond(gr(x,y),p(x),y) r2: gr(|0|(),x) -> false() r3: gr(s(x),|0|()) -> true() r4: gr(s(x),s(y)) -> gr(x,y) r5: p(|0|()) -> |0|() r6: p(s(x)) -> x The estimated dependency graph contains the following SCCs: {p1} {p4} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: cond#(true(),x,y) -> cond#(gr(x,y),p(x),y) and R consists of: r1: cond(true(),x,y) -> cond(gr(x,y),p(x),y) r2: gr(|0|(),x) -> false() r3: gr(s(x),|0|()) -> true() r4: gr(s(x),s(y)) -> gr(x,y) r5: p(|0|()) -> |0|() r6: p(s(x)) -> x The set of usable rules consists of r2, r3, r4, r5, r6 Take the reduction pair: lexicographic combination of reduction pairs: 1. max/plus interpretations on natural numbers: cond#_A(x1,x2,x3) = max{9, x1 - 1, x2} true_A = 11 gr_A(x1,x2) = x1 p_A(x1) = max{8, x1 - 1} |0|_A = 7 false_A = 6 s_A(x1) = max{13, x1 + 12} 2. max/plus interpretations on natural numbers: cond#_A(x1,x2,x3) = 0 true_A = 2 gr_A(x1,x2) = 1 p_A(x1) = 1 |0|_A = 0 false_A = 0 s_A(x1) = 0 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) -> cond(gr(x,y),p(x),y) r2: gr(|0|(),x) -> false() r3: gr(s(x),|0|()) -> true() r4: gr(s(x),s(y)) -> gr(x,y) r5: p(|0|()) -> |0|() r6: p(s(x)) -> x The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. max/plus interpretations on natural numbers: gr#_A(x1,x2) = max{x1, x2} s_A(x1) = max{2, x1 + 1} 2. max/plus interpretations on natural numbers: gr#_A(x1,x2) = 0 s_A(x1) = 0 The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.