YES We show the termination of the TRS R: a__2nd(cons(X,cons(Y,Z))) -> mark(Y) a__from(X) -> cons(mark(X),from(s(X))) mark(|2nd|(X)) -> a__2nd(mark(X)) mark(from(X)) -> a__from(mark(X)) mark(cons(X1,X2)) -> cons(mark(X1),X2) mark(s(X)) -> s(mark(X)) a__2nd(X) -> |2nd|(X) a__from(X) -> from(X) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: a__2nd#(cons(X,cons(Y,Z))) -> mark#(Y) p2: a__from#(X) -> mark#(X) p3: mark#(|2nd|(X)) -> a__2nd#(mark(X)) p4: mark#(|2nd|(X)) -> mark#(X) p5: mark#(from(X)) -> a__from#(mark(X)) p6: mark#(from(X)) -> mark#(X) p7: mark#(cons(X1,X2)) -> mark#(X1) p8: mark#(s(X)) -> mark#(X) and R consists of: r1: a__2nd(cons(X,cons(Y,Z))) -> mark(Y) r2: a__from(X) -> cons(mark(X),from(s(X))) r3: mark(|2nd|(X)) -> a__2nd(mark(X)) r4: mark(from(X)) -> a__from(mark(X)) r5: mark(cons(X1,X2)) -> cons(mark(X1),X2) r6: mark(s(X)) -> s(mark(X)) r7: a__2nd(X) -> |2nd|(X) r8: a__from(X) -> from(X) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4, p5, p6, p7, p8} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: a__2nd#(cons(X,cons(Y,Z))) -> mark#(Y) p2: mark#(s(X)) -> mark#(X) p3: mark#(cons(X1,X2)) -> mark#(X1) p4: mark#(from(X)) -> mark#(X) p5: mark#(from(X)) -> a__from#(mark(X)) p6: a__from#(X) -> mark#(X) p7: mark#(|2nd|(X)) -> mark#(X) p8: mark#(|2nd|(X)) -> a__2nd#(mark(X)) and R consists of: r1: a__2nd(cons(X,cons(Y,Z))) -> mark(Y) r2: a__from(X) -> cons(mark(X),from(s(X))) r3: mark(|2nd|(X)) -> a__2nd(mark(X)) r4: mark(from(X)) -> a__from(mark(X)) r5: mark(cons(X1,X2)) -> cons(mark(X1),X2) r6: mark(s(X)) -> s(mark(X)) r7: a__2nd(X) -> |2nd|(X) r8: a__from(X) -> from(X) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8 Take the reduction pair: max/plus interpretations on natural numbers: a__2nd#_A(x1) = x1 + 8 cons_A(x1,x2) = max{3, x1, x2 - 3} mark#_A(x1) = max{1, x1} s_A(x1) = max{3, x1} from_A(x1) = max{7, x1 + 6} a__from#_A(x1) = max{1, x1} mark_A(x1) = x1 + 6 |2nd|_A(x1) = max{15, x1 + 14} a__2nd_A(x1) = max{15, x1 + 14} a__from_A(x1) = max{7, x1 + 6} The next rules are strictly ordered: p1, p4, p7 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: mark#(s(X)) -> mark#(X) p2: mark#(cons(X1,X2)) -> mark#(X1) p3: mark#(from(X)) -> a__from#(mark(X)) p4: a__from#(X) -> mark#(X) p5: mark#(|2nd|(X)) -> a__2nd#(mark(X)) and R consists of: r1: a__2nd(cons(X,cons(Y,Z))) -> mark(Y) r2: a__from(X) -> cons(mark(X),from(s(X))) r3: mark(|2nd|(X)) -> a__2nd(mark(X)) r4: mark(from(X)) -> a__from(mark(X)) r5: mark(cons(X1,X2)) -> cons(mark(X1),X2) r6: mark(s(X)) -> s(mark(X)) r7: a__2nd(X) -> |2nd|(X) r8: a__from(X) -> from(X) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: mark#(s(X)) -> mark#(X) p2: mark#(from(X)) -> a__from#(mark(X)) p3: a__from#(X) -> mark#(X) p4: mark#(cons(X1,X2)) -> mark#(X1) and R consists of: r1: a__2nd(cons(X,cons(Y,Z))) -> mark(Y) r2: a__from(X) -> cons(mark(X),from(s(X))) r3: mark(|2nd|(X)) -> a__2nd(mark(X)) r4: mark(from(X)) -> a__from(mark(X)) r5: mark(cons(X1,X2)) -> cons(mark(X1),X2) r6: mark(s(X)) -> s(mark(X)) r7: a__2nd(X) -> |2nd|(X) r8: a__from(X) -> from(X) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8 Take the reduction pair: max/plus interpretations on natural numbers: mark#_A(x1) = max{0, x1 - 2} s_A(x1) = x1 + 1 from_A(x1) = max{6, x1 + 5} a__from#_A(x1) = x1 + 1 mark_A(x1) = x1 + 2 cons_A(x1,x2) = max{x1 + 2, x2 - 1} a__2nd_A(x1) = max{3, x1 + 2} a__from_A(x1) = max{6, x1 + 5} |2nd|_A(x1) = max{3, x1 + 2} The next rules are strictly ordered: p3 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: mark#(s(X)) -> mark#(X) p2: mark#(from(X)) -> a__from#(mark(X)) p3: mark#(cons(X1,X2)) -> mark#(X1) and R consists of: r1: a__2nd(cons(X,cons(Y,Z))) -> mark(Y) r2: a__from(X) -> cons(mark(X),from(s(X))) r3: mark(|2nd|(X)) -> a__2nd(mark(X)) r4: mark(from(X)) -> a__from(mark(X)) r5: mark(cons(X1,X2)) -> cons(mark(X1),X2) r6: mark(s(X)) -> s(mark(X)) r7: a__2nd(X) -> |2nd|(X) r8: a__from(X) -> from(X) The estimated dependency graph contains the following SCCs: {p1, p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: mark#(s(X)) -> mark#(X) p2: mark#(cons(X1,X2)) -> mark#(X1) and R consists of: r1: a__2nd(cons(X,cons(Y,Z))) -> mark(Y) r2: a__from(X) -> cons(mark(X),from(s(X))) r3: mark(|2nd|(X)) -> a__2nd(mark(X)) r4: mark(from(X)) -> a__from(mark(X)) r5: mark(cons(X1,X2)) -> cons(mark(X1),X2) r6: mark(s(X)) -> s(mark(X)) r7: a__2nd(X) -> |2nd|(X) r8: a__from(X) -> from(X) The set of usable rules consists of (no rules) Take the reduction pair: max/plus interpretations on natural numbers: mark#_A(x1) = max{0, x1 - 1} s_A(x1) = x1 + 1 cons_A(x1,x2) = max{x1 + 2, x2 + 2} The next rules are strictly ordered: p2 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: mark#(s(X)) -> mark#(X) and R consists of: r1: a__2nd(cons(X,cons(Y,Z))) -> mark(Y) r2: a__from(X) -> cons(mark(X),from(s(X))) r3: mark(|2nd|(X)) -> a__2nd(mark(X)) r4: mark(from(X)) -> a__from(mark(X)) r5: mark(cons(X1,X2)) -> cons(mark(X1),X2) r6: mark(s(X)) -> s(mark(X)) r7: a__2nd(X) -> |2nd|(X) r8: a__from(X) -> from(X) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: mark#(s(X)) -> mark#(X) and R consists of: r1: a__2nd(cons(X,cons(Y,Z))) -> mark(Y) r2: a__from(X) -> cons(mark(X),from(s(X))) r3: mark(|2nd|(X)) -> a__2nd(mark(X)) r4: mark(from(X)) -> a__from(mark(X)) r5: mark(cons(X1,X2)) -> cons(mark(X1),X2) r6: mark(s(X)) -> s(mark(X)) r7: a__2nd(X) -> |2nd|(X) r8: a__from(X) -> from(X) The set of usable rules consists of (no rules) Take the monotone reduction pair: max/plus interpretations on natural numbers: mark#_A(x1) = x1 s_A(x1) = x1 + 1 The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.