YES We show the termination of the TRS R: a__first(|0|(),X) -> nil() a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) a__from(X) -> cons(mark(X),from(s(X))) mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) mark(from(X)) -> a__from(mark(X)) mark(|0|()) -> |0|() mark(nil()) -> nil() mark(s(X)) -> s(mark(X)) mark(cons(X1,X2)) -> cons(mark(X1),X2) a__first(X1,X2) -> first(X1,X2) a__from(X) -> from(X) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: a__first#(s(X),cons(Y,Z)) -> mark#(Y) p2: a__from#(X) -> mark#(X) p3: mark#(first(X1,X2)) -> a__first#(mark(X1),mark(X2)) p4: mark#(first(X1,X2)) -> mark#(X1) p5: mark#(first(X1,X2)) -> mark#(X2) p6: mark#(from(X)) -> a__from#(mark(X)) p7: mark#(from(X)) -> mark#(X) p8: mark#(s(X)) -> mark#(X) p9: mark#(cons(X1,X2)) -> mark#(X1) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: a__from(X) -> from(X) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4, p5, p6, p7, p8, p9} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: a__first#(s(X),cons(Y,Z)) -> mark#(Y) p2: mark#(cons(X1,X2)) -> mark#(X1) p3: mark#(s(X)) -> mark#(X) p4: mark#(from(X)) -> mark#(X) p5: mark#(from(X)) -> a__from#(mark(X)) p6: a__from#(X) -> mark#(X) p7: mark#(first(X1,X2)) -> mark#(X2) p8: mark#(first(X1,X2)) -> mark#(X1) p9: mark#(first(X1,X2)) -> a__first#(mark(X1),mark(X2)) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: a__from(X) -> from(X) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: a__first#_A(x1,x2) = ((0,0),(1,0)) x2 + (5,10) s_A(x1) = ((1,0),(1,0)) x1 + (6,24) cons_A(x1,x2) = ((1,0),(0,0)) x1 + ((0,0),(1,0)) x2 + (0,10) mark#_A(x1) = ((0,0),(1,0)) x1 + (5,6) from_A(x1) = ((1,0),(1,0)) x1 + (6,8) a__from#_A(x1) = ((0,0),(1,0)) x1 + (5,7) mark_A(x1) = ((1,0),(1,1)) x1 + (0,9) first_A(x1,x2) = x1 + ((1,0),(0,0)) x2 + (4,0) a__first_A(x1,x2) = x1 + ((1,0),(0,0)) x2 + (4,1) |0|_A() = (2,2) nil_A() = (1,1) a__from_A(x1) = ((1,0),(1,0)) x1 + (6,23) precedence: a__first# = mark# = a__from# > nil > s = mark = a__first = a__from > from > cons = first = |0| partial status: pi(a__first#) = [] pi(s) = [] pi(cons) = [] pi(mark#) = [] pi(from) = [] pi(a__from#) = [] pi(mark) = [1] pi(first) = [] pi(a__first) = [1] pi(|0|) = [] pi(nil) = [] pi(a__from) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: a__first#_A(x1,x2) = (1,1) s_A(x1) = (3,7) cons_A(x1,x2) = (8,12) mark#_A(x1) = (1,1) from_A(x1) = (2,2) a__from#_A(x1) = (1,1) mark_A(x1) = ((0,0),(1,0)) x1 + (10,3) first_A(x1,x2) = (7,8) a__first_A(x1,x2) = (10,9) |0|_A() = (9,11) nil_A() = (9,10) a__from_A(x1) = (9,6) precedence: mark > a__first = a__from > from > a__first# = s = cons = mark# = a__from# = first > |0| = nil partial status: pi(a__first#) = [] pi(s) = [] pi(cons) = [] pi(mark#) = [] pi(from) = [] pi(a__from#) = [] pi(mark) = [] pi(first) = [] pi(a__first) = [] pi(|0|) = [] pi(nil) = [] pi(a__from) = [] 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: a__first#(s(X),cons(Y,Z)) -> mark#(Y) p2: mark#(cons(X1,X2)) -> mark#(X1) p3: mark#(from(X)) -> mark#(X) p4: mark#(from(X)) -> a__from#(mark(X)) p5: a__from#(X) -> mark#(X) p6: mark#(first(X1,X2)) -> mark#(X2) p7: mark#(first(X1,X2)) -> mark#(X1) p8: mark#(first(X1,X2)) -> a__first#(mark(X1),mark(X2)) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: 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__first#(s(X),cons(Y,Z)) -> mark#(Y) p2: mark#(first(X1,X2)) -> a__first#(mark(X1),mark(X2)) p3: mark#(first(X1,X2)) -> mark#(X1) p4: mark#(first(X1,X2)) -> mark#(X2) p5: mark#(from(X)) -> a__from#(mark(X)) p6: a__from#(X) -> mark#(X) p7: mark#(from(X)) -> mark#(X) p8: mark#(cons(X1,X2)) -> mark#(X1) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: a__from(X) -> from(X) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: a__first#_A(x1,x2) = ((1,0),(0,0)) x2 + (8,4) s_A(x1) = (0,0) cons_A(x1,x2) = x1 + (0,1) mark#_A(x1) = x1 + (3,4) first_A(x1,x2) = x1 + ((1,0),(0,0)) x2 + (5,0) mark_A(x1) = ((1,0),(1,1)) x1 + (0,2) from_A(x1) = ((1,0),(1,1)) x1 + (5,0) a__from#_A(x1) = x1 + (4,1) a__first_A(x1,x2) = x1 + ((1,0),(1,0)) x2 + (5,4) |0|_A() = (0,1) nil_A() = (1,0) a__from_A(x1) = ((1,0),(1,1)) x1 + (5,4) precedence: s = first = mark = a__first > from = |0| = a__from > cons > a__from# = nil > a__first# = mark# partial status: pi(a__first#) = [] pi(s) = [] pi(cons) = [] pi(mark#) = [1] pi(first) = [] pi(mark) = [] pi(from) = [] pi(a__from#) = [] pi(a__first) = [] pi(|0|) = [] pi(nil) = [] pi(a__from) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: a__first#_A(x1,x2) = (0,0) s_A(x1) = (1,1) cons_A(x1,x2) = (0,3) mark#_A(x1) = (0,0) first_A(x1,x2) = (0,4) mark_A(x1) = (3,5) from_A(x1) = (0,1) a__from#_A(x1) = (0,0) a__first_A(x1,x2) = (0,4) |0|_A() = (1,2) nil_A() = (0,1) a__from_A(x1) = (2,2) precedence: mark > a__from > |0| = nil > a__first# = cons = mark# > a__first > first > s > from = a__from# partial status: pi(a__first#) = [] pi(s) = [] pi(cons) = [] pi(mark#) = [] pi(first) = [] pi(mark) = [] pi(from) = [] pi(a__from#) = [] pi(a__first) = [] pi(|0|) = [] pi(nil) = [] 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__first#(s(X),cons(Y,Z)) -> mark#(Y) p2: mark#(first(X1,X2)) -> a__first#(mark(X1),mark(X2)) p3: mark#(first(X1,X2)) -> mark#(X1) p4: mark#(first(X1,X2)) -> mark#(X2) p5: mark#(from(X)) -> a__from#(mark(X)) p6: mark#(from(X)) -> mark#(X) p7: mark#(cons(X1,X2)) -> mark#(X1) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: 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__first#(s(X),cons(Y,Z)) -> mark#(Y) p2: mark#(cons(X1,X2)) -> mark#(X1) p3: mark#(from(X)) -> mark#(X) p4: mark#(first(X1,X2)) -> mark#(X2) p5: mark#(first(X1,X2)) -> mark#(X1) p6: mark#(first(X1,X2)) -> a__first#(mark(X1),mark(X2)) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: a__from(X) -> from(X) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: a__first#_A(x1,x2) = ((1,0),(1,1)) x2 + (1,1) s_A(x1) = (5,0) cons_A(x1,x2) = ((1,0),(1,0)) x1 + (3,0) mark#_A(x1) = ((1,0),(0,0)) x1 + (2,5) from_A(x1) = ((1,0),(0,0)) x1 + (4,6) first_A(x1,x2) = ((1,0),(0,0)) x1 + ((1,0),(1,0)) x2 + (0,3) mark_A(x1) = ((1,0),(1,1)) x1 + (0,8) a__first_A(x1,x2) = ((1,0),(0,0)) x1 + ((1,0),(1,0)) x2 + (0,4) |0|_A() = (2,2) nil_A() = (1,1) a__from_A(x1) = ((1,0),(0,0)) x1 + (4,7) precedence: cons = mark = a__first = |0| = nil > first > mark# > a__first# = s = from = a__from partial status: pi(a__first#) = [2] pi(s) = [] pi(cons) = [] pi(mark#) = [] pi(from) = [] pi(first) = [] pi(mark) = [1] pi(a__first) = [] pi(|0|) = [] pi(nil) = [] pi(a__from) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: a__first#_A(x1,x2) = (6,1) s_A(x1) = (4,4) cons_A(x1,x2) = (1,0) mark#_A(x1) = (5,5) from_A(x1) = (0,0) first_A(x1,x2) = (0,3) mark_A(x1) = ((1,0),(1,0)) x1 + (3,2) a__first_A(x1,x2) = (3,2) |0|_A() = (0,2) nil_A() = (1,1) a__from_A(x1) = (2,5) precedence: nil > |0| > a__first# > mark# = mark > a__first > s = first = a__from > cons = from partial status: pi(a__first#) = [] pi(s) = [] pi(cons) = [] pi(mark#) = [] pi(from) = [] pi(first) = [] pi(mark) = [] pi(a__first) = [] pi(|0|) = [] pi(nil) = [] pi(a__from) = [] The next rules are strictly ordered: p1, p6 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) p2: mark#(from(X)) -> mark#(X) p3: mark#(first(X1,X2)) -> mark#(X2) p4: mark#(first(X1,X2)) -> mark#(X1) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: 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#(cons(X1,X2)) -> mark#(X1) p2: mark#(first(X1,X2)) -> mark#(X1) p3: mark#(first(X1,X2)) -> mark#(X2) p4: mark#(from(X)) -> mark#(X) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: 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),(1,1)) x1 + x2 + (1,3) first_A(x1,x2) = ((1,0),(1,0)) x1 + ((1,0),(1,1)) x2 + (2,1) from_A(x1) = ((1,0),(0,0)) x1 + (2,1) precedence: cons = first = from > mark# partial status: pi(mark#) = [1] pi(cons) = [1] pi(first) = [2] pi(from) = [] 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) first_A(x1,x2) = ((1,0),(1,1)) x2 + (1,1) from_A(x1) = (1,1) precedence: mark# = first > from > cons partial status: pi(mark#) = [] pi(cons) = [] pi(first) = [] pi(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: mark#(cons(X1,X2)) -> mark#(X1) p2: mark#(first(X1,X2)) -> mark#(X2) p3: mark#(from(X)) -> mark#(X) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: a__from(X) -> from(X) The estimated dependency graph contains the following SCCs: {p1, p2, p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: mark#(cons(X1,X2)) -> mark#(X1) p2: mark#(from(X)) -> mark#(X) p3: mark#(first(X1,X2)) -> mark#(X2) and R consists of: r1: a__first(|0|(),X) -> nil() r2: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(|0|()) -> |0|() r7: mark(nil()) -> nil() r8: mark(s(X)) -> s(mark(X)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: a__first(X1,X2) -> first(X1,X2) r11: 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),(1,1)) x1 + (0,1) cons_A(x1,x2) = x1 + x2 + (1,2) from_A(x1) = x1 + (1,2) first_A(x1,x2) = x1 + ((1,0),(1,1)) x2 + (1,2) precedence: from > mark# = cons = first partial status: pi(mark#) = [1] pi(cons) = [1, 2] pi(from) = [1] pi(first) = [1, 2] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: mark#_A(x1) = ((1,0),(0,0)) x1 + (2,2) cons_A(x1,x2) = ((1,0),(0,0)) x1 + x2 + (1,1) from_A(x1) = ((1,0),(0,0)) x1 + (3,1) first_A(x1,x2) = x1 + ((1,0),(0,0)) x2 + (1,1) precedence: mark# = from > first > cons partial status: pi(mark#) = [] pi(cons) = [] pi(from) = [] pi(first) = [] The next rules are strictly ordered: p1, p2, p3 We remove them from the problem. Then no dependency pair remains.