YES We show the termination of the TRS R: cond(true(),x,y) -> cond(gr(x,y),p(x),s(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),s(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),s(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),s(y)) and R consists of: r1: cond(true(),x,y) -> cond(gr(x,y),p(x),s(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: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: cond#_A(x1,x2,x3) = max{x1 - 3, x2 + 9} true_A = 20 gr_A(x1,x2) = max{4, x1 + 2} p_A(x1) = max{7, x1 - 15} s_A(x1) = max{34, x1 + 19} |0|_A = 6 false_A = 5 base order 2: precedence: cond# > gr > s > p > true > |0| > false partial status: pi(cond#) = [] pi(true) = [] pi(gr) = [1] pi(p) = [] pi(s) = [1] pi(|0|) = [] pi(false) = [] 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: cond(true(),x,y) -> cond(gr(x,y),p(x),s(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, r6 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: gr#_A(x1,x2) = max{x1 - 1, x2 + 7} s_A(x1) = max{12, x1 + 6} gr_A(x1,x2) = max{13, x1 - 13, x2 - 13} |0|_A = 2 false_A = 0 true_A = 1 p_A(x1) = max{3, x1 - 5} base order 2: precedence: gr# = gr > s > p > |0| > false = true partial status: pi(gr#) = [2] pi(s) = [1] pi(gr) = [] pi(|0|) = [] pi(false) = [] pi(true) = [] pi(p) = [] The following rules are removed: p1 Then no dependency pair remains.