YES We show the termination of the TRS R: cond(true(),x) -> cond(and(even(x),gr(x,|0|())),p(x)) and(x,false()) -> false() and(false(),x) -> false() and(true(),true()) -> true() even(|0|()) -> true() even(s(|0|())) -> false() even(s(s(x))) -> even(x) 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) -> cond#(and(even(x),gr(x,|0|())),p(x)) p2: cond#(true(),x) -> and#(even(x),gr(x,|0|())) p3: cond#(true(),x) -> even#(x) p4: cond#(true(),x) -> gr#(x,|0|()) p5: cond#(true(),x) -> p#(x) p6: even#(s(s(x))) -> even#(x) p7: gr#(s(x),s(y())) -> gr#(x,y()) and R consists of: r1: cond(true(),x) -> cond(and(even(x),gr(x,|0|())),p(x)) r2: and(x,false()) -> false() r3: and(false(),x) -> false() r4: and(true(),true()) -> true() r5: even(|0|()) -> true() r6: even(s(|0|())) -> false() r7: even(s(s(x))) -> even(x) r8: gr(|0|(),x) -> false() r9: gr(s(x),|0|()) -> true() r10: gr(s(x),s(y())) -> gr(x,y()) r11: p(|0|()) -> |0|() r12: p(s(x)) -> x The estimated dependency graph contains the following SCCs: {p1} {p6} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: cond#(true(),x) -> cond#(and(even(x),gr(x,|0|())),p(x)) and R consists of: r1: cond(true(),x) -> cond(and(even(x),gr(x,|0|())),p(x)) r2: and(x,false()) -> false() r3: and(false(),x) -> false() r4: and(true(),true()) -> true() r5: even(|0|()) -> true() r6: even(s(|0|())) -> false() r7: even(s(s(x))) -> even(x) r8: gr(|0|(),x) -> false() r9: gr(s(x),|0|()) -> true() r10: gr(s(x),s(y())) -> gr(x,y()) r11: p(|0|()) -> |0|() r12: p(s(x)) -> x The set of usable rules consists of r2, r3, r4, r5, r6, r7, r8, r9, r11, r12 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: cond#_A(x1,x2) = max{1, x2 - 1} true_A = 35 and_A(x1,x2) = max{29, x2 + 15} even_A(x1) = x1 + 69 gr_A(x1,x2) = max{16, x1 - 34} |0|_A = 0 p_A(x1) = max{2, x1 - 58} false_A = 16 s_A(x1) = max{69, x1 + 68} cond#!_A(x1,x2) = max{x1 + 25, x2 + 57} true!_A = 53 and!_A(x1,x2) = max{61, x1 + 46} even!_A(x1) = max{135, x1 + 67} gr!_A(x1,x2) = max{66, x1 - 1, x2 + 61} |0|!_A = 64 p!_A(x1) = max{66, x1 + 2} false!_A = 63 s!_A(x1) = max{134, x1 - 70} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: cond#_A(x1,x2) = max{54, x1 + 6, x2 + 52} true_A = 12 and_A(x1,x2) = max{46, x2 - 1} even_A(x1) = x1 + 20 gr_A(x1,x2) = max{14, x2 - 6} |0|_A = 0 p_A(x1) = max{2, x1 - 33} false_A = 5 s_A(x1) = x1 + 33 cond#!_A(x1,x2) = x1 + 18 true!_A = 10 and!_A(x1,x2) = max{3, x1 - 1, x2 - 11} even!_A(x1) = x1 + 33 gr!_A(x1,x2) = max{5, x1 - 5, x2 - 3} |0|!_A = 31 p!_A(x1) = max{33, x1 - 1} false!_A = 3 s!_A(x1) = max{5, x1 - 4} partial status: pi(cond#) = [] pi(true) = [] pi(and) = [1, 2] pi(even) = [1] pi(gr) = [1, 2] pi(|0|) = [] pi(p) = [1] 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: even#(s(s(x))) -> even#(x) and R consists of: r1: cond(true(),x) -> cond(and(even(x),gr(x,|0|())),p(x)) r2: and(x,false()) -> false() r3: and(false(),x) -> false() r4: and(true(),true()) -> true() r5: even(|0|()) -> true() r6: even(s(|0|())) -> false() r7: even(s(s(x))) -> even(x) r8: gr(|0|(),x) -> false() r9: gr(s(x),|0|()) -> true() r10: gr(s(x),s(y())) -> gr(x,y()) r11: p(|0|()) -> |0|() r12: 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: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: even#_A(x1) = x1 s_A(x1) = max{7, x1} even#!_A(x1) = max{2, x1 - 10} s!_A(x1) = max{2, x1 - 10} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: even#_A(x1) = x1 s_A(x1) = max{17, x1 + 9} even#!_A(x1) = max{5, x1 - 19} s!_A(x1) = max{6, x1 - 19} partial status: pi(even#) = [1] pi(s) = [1] The following rules are removed: p1 Then no dependency pair remains.