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: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: a__2nd#_A(x1) = ((0,1),(0,0)) x1 + (1,6) cons_A(x1,x2) = ((0,1),(0,1)) x1 + ((1,0),(1,0)) x2 + (11,6) mark#_A(x1) = ((0,1),(0,0)) x1 + (4,6) s_A(x1) = ((0,0),(0,1)) x1 + (0,6) from_A(x1) = ((0,0),(0,1)) x1 + (11,18) a__from#_A(x1) = ((0,1),(0,0)) x1 + (5,6) mark_A(x1) = ((0,1),(0,1)) x1 + (10,1) |2nd|_A(x1) = ((0,0),(0,1)) x1 + (3,5) a__2nd_A(x1) = x1 + (4,5) a__from_A(x1) = ((0,1),(0,1)) x1 + (24,18) precedence: a__from# > mark > a__2nd > |2nd| > a__from > cons > from > a__2nd# = mark# = s partial status: pi(a__2nd#) = [] pi(cons) = [] pi(mark#) = [] pi(s) = [] pi(from) = [] pi(a__from#) = [] pi(mark) = [] pi(|2nd|) = [] pi(a__2nd) = [1] pi(a__from) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: a__2nd#_A(x1) = (2,0) cons_A(x1,x2) = (0,0) mark#_A(x1) = (2,0) s_A(x1) = (0,0) from_A(x1) = (1,0) a__from#_A(x1) = (0,0) mark_A(x1) = (0,0) |2nd|_A(x1) = (0,0) a__2nd_A(x1) = (0,0) a__from_A(x1) = (2,0) precedence: a__from# > s = mark = a__2nd > |2nd| > a__from > a__2nd# = cons = mark# = from partial status: pi(a__2nd#) = [] pi(cons) = [] pi(mark#) = [] pi(s) = [] pi(from) = [] pi(a__from#) = [] pi(mark) = [] pi(|2nd|) = [] pi(a__2nd) = [] pi(a__from) = [] The next rules are strictly ordered: p6 We remove them from the problem. -- SCC decomposition. 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: mark#(|2nd|(X)) -> mark#(X) p7: 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, p6, p7} -- 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#(|2nd|(X)) -> a__2nd#(mark(X)) p3: mark#(|2nd|(X)) -> mark#(X) p4: mark#(from(X)) -> mark#(X) p5: mark#(cons(X1,X2)) -> mark#(X1) p6: 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 r1, r2, r3, r4, r5, r6, r7, r8 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: a__2nd#_A(x1) = x1 + (2,1) cons_A(x1,x2) = ((0,1),(0,1)) x1 + ((1,0),(1,0)) x2 + (5,0) mark#_A(x1) = ((0,1),(0,1)) x1 + (11,6) |2nd|_A(x1) = ((0,1),(0,1)) x1 + (2,0) mark_A(x1) = ((0,1),(0,1)) x1 + (8,0) from_A(x1) = ((0,0),(0,1)) x1 s_A(x1) = ((0,0),(0,1)) x1 + (7,0) a__2nd_A(x1) = ((0,1),(0,1)) x1 + (3,0) a__from_A(x1) = ((0,1),(0,1)) x1 + (6,0) precedence: a__2nd > mark > a__2nd# = mark# = |2nd| > a__from > cons > from = s partial status: pi(a__2nd#) = [1] pi(cons) = [] pi(mark#) = [] pi(|2nd|) = [] pi(mark) = [] pi(from) = [] pi(s) = [] pi(a__2nd) = [] pi(a__from) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: a__2nd#_A(x1) = ((1,0),(1,1)) x1 + (2,1) cons_A(x1,x2) = (0,1) mark#_A(x1) = (1,2) |2nd|_A(x1) = (2,3) mark_A(x1) = (3,3) from_A(x1) = (3,3) s_A(x1) = (2,2) a__2nd_A(x1) = (3,3) a__from_A(x1) = (3,3) precedence: cons = |2nd| = mark = from = a__2nd = a__from > s > a__2nd# = mark# partial status: pi(a__2nd#) = [1] pi(cons) = [] pi(mark#) = [] pi(|2nd|) = [] pi(mark) = [] pi(from) = [] pi(s) = [] pi(a__2nd) = [] pi(a__from) = [] 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: a__2nd#(cons(X,cons(Y,Z))) -> mark#(Y) p2: mark#(|2nd|(X)) -> mark#(X) p3: mark#(from(X)) -> mark#(X) p4: mark#(cons(X1,X2)) -> mark#(X1) p5: 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: {p2, p3, p4, p5} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: mark#(|2nd|(X)) -> mark#(X) p2: mark#(s(X)) -> mark#(X) p3: mark#(cons(X1,X2)) -> mark#(X1) p4: mark#(from(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 reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: mark#_A(x1) = ((1,0),(0,0)) x1 + (2,2) |2nd|_A(x1) = x1 + (3,3) s_A(x1) = x1 + (1,3) cons_A(x1,x2) = x1 + x2 + (0,1) from_A(x1) = x1 + (3,3) precedence: mark# = |2nd| > s = cons = from partial status: pi(mark#) = [] pi(|2nd|) = [] pi(s) = [1] pi(cons) = [1, 2] pi(from) = [1] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: mark#_A(x1) = (0,0) |2nd|_A(x1) = (1,1) s_A(x1) = (1,1) cons_A(x1,x2) = x1 + x2 + (1,1) from_A(x1) = (1,1) precedence: |2nd| > mark# = s = cons = from partial status: pi(mark#) = [] pi(|2nd|) = [] pi(s) = [] pi(cons) = [1, 2] pi(from) = [] The next rules are strictly ordered: p1, p2, p4 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: 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} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: 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: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: mark#_A(x1) = x1 + (1,2) cons_A(x1,x2) = ((1,0),(0,0)) x1 + x2 + (2,1) precedence: cons > mark# partial status: pi(mark#) = [1] pi(cons) = [2] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: mark#_A(x1) = (0,0) cons_A(x1,x2) = (1,1) precedence: mark# > cons partial status: pi(mark#) = [] pi(cons) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.