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!): max/plus interpretation on natural numbers: cond#_A(x1,x2) = max{5, x2 - 1} true_A = 39 and_A(x1,x2) = max{6, x2} even_A(x1) = x1 + 38 gr_A(x1,x2) = max{x1 + 31, x2 - 1} |0|_A = 6 p_A(x1) = max{6, x1 - 8} false_A = 6 s_A(x1) = x1 + 8 y_A = 0 cond#!_A(x1,x2) = max{x1 - 7, x2 + 25} true!_A = 22 and!_A(x1,x2) = max{20, x1 - 18, x2 + 15} even!_A(x1) = max{17, x1 + 1} gr!_A(x1,x2) = max{x1 - 9, x2 + 27} |0|!_A = 22 p!_A(x1) = max{23, x1 - 7} false!_A = 16 s!_A(x1) = x1 + 23 y!_A = 23 2. 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) = x1 + 1 even_A(x1) = x1 + 1 gr_A(x1,x2) = 1 |0|_A() = 1 p_A(x1) = x1 + 1 false_A() = 1 s_A(x1) = x1 y_A() = 1 cond#!_A(x1,x2) = 6 true!_A() = 2 and!_A(x1,x2) = 7 even!_A(x1) = x1 gr!_A(x1,x2) = 5 |0|!_A() = 2 p!_A(x1) = 3 false!_A() = 0 s!_A(x1) = 3 y!_A() = 0 partial status: pi(cond#) = [] pi(true) = [] pi(and) = [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!): max/plus interpretation on natural numbers: even#_A(x1) = x1 s_A(x1) = max{10, x1 + 5} even#!_A(x1) = max{1, x1 - 14} s!_A(x1) = max{7, x1 - 8} 2. 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 + 5 even#!_A(x1) = x1 + 5 s!_A(x1) = 6 partial status: pi(even#) = [1] pi(s) = [1] The following rules are removed: p1 Then no dependency pair remains.