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, r10, 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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: cond#_A(x1,x2) = 0 true_A() = 1 and_A(x1,x2) = x2 + 1 even_A(x1) = 1 gr_A(x1,x2) = x1 + 1 |0|_A() = 1 p_A(x1) = x1 + 1 false_A() = 1 s_A(x1) = x1 + 2 y_A() = 1 cond#!_A(x1,x2) = 4 true!_A() = 3 and!_A(x1,x2) = x2 + 1 even!_A(x1) = 2 gr!_A(x1,x2) = x1 + 2 |0|!_A() = 5 p!_A(x1) = 7 false!_A() = 0 s!_A(x1) = 6 y!_A() = 5 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: cond#_A(x1,x2) = max{1, x2 - 11} true_A = 27 and_A(x1,x2) = max{x1 - 21, x2 + 8} even_A(x1) = max{32, x1 + 21} gr_A(x1,x2) = max{1, x1 - 6} |0|_A = 5 p_A(x1) = max{12, x1 - 5} false_A = 1 s_A(x1) = x1 + 33 y_A = 8 cond#!_A(x1,x2) = max{14, x1 - 12, x2 + 1} true!_A = 18 and!_A(x1,x2) = 18 even!_A(x1) = 16 gr!_A(x1,x2) = max{58, x2 + 14} |0|!_A = 59 p!_A(x1) = max{60, x1 - 6} false!_A = 15 s!_A(x1) = max{57, x1 - 66} y!_A = 56 partial status: pi(cond#) = [] pi(true) = [] pi(and) = [1, 2] pi(even) = [1] pi(gr) = [1] pi(|0|) = [] pi(p) = [1] pi(false) = [] pi(s) = [1] pi(y) = [] 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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: even#_A(x1) = x1 s_A(x1) = x1 + 2 even#!_A(x1) = x1 + 2 s!_A(x1) = x1 + 1 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: even#_A(x1) = 0 s_A(x1) = max{6, x1 - 3} even#!_A(x1) = max{2, x1 - 23} s!_A(x1) = max{2, x1 - 20} partial status: pi(even#) = [] pi(s) = [1] The following rules are removed: p1 Then no dependency pair remains.