YES We show the termination of the TRS R: a__from(X) -> cons(mark(X),from(s(X))) a__first(|0|(),Z) -> nil() a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) a__sel(|0|(),cons(X,Z)) -> mark(X) a__sel(s(X),cons(Y,Z)) -> a__sel(mark(X),mark(Z)) mark(from(X)) -> a__from(mark(X)) mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) mark(sel(X1,X2)) -> a__sel(mark(X1),mark(X2)) mark(cons(X1,X2)) -> cons(mark(X1),X2) mark(s(X)) -> s(mark(X)) mark(|0|()) -> |0|() mark(nil()) -> nil() a__from(X) -> from(X) a__first(X1,X2) -> first(X1,X2) a__sel(X1,X2) -> sel(X1,X2) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: a__from#(X) -> mark#(X) p2: a__first#(s(X),cons(Y,Z)) -> mark#(Y) p3: a__sel#(|0|(),cons(X,Z)) -> mark#(X) p4: a__sel#(s(X),cons(Y,Z)) -> a__sel#(mark(X),mark(Z)) p5: a__sel#(s(X),cons(Y,Z)) -> mark#(X) p6: a__sel#(s(X),cons(Y,Z)) -> mark#(Z) p7: mark#(from(X)) -> a__from#(mark(X)) p8: mark#(from(X)) -> mark#(X) p9: mark#(first(X1,X2)) -> a__first#(mark(X1),mark(X2)) p10: mark#(first(X1,X2)) -> mark#(X1) p11: mark#(first(X1,X2)) -> mark#(X2) p12: mark#(sel(X1,X2)) -> a__sel#(mark(X1),mark(X2)) p13: mark#(sel(X1,X2)) -> mark#(X1) p14: mark#(sel(X1,X2)) -> mark#(X2) p15: mark#(cons(X1,X2)) -> mark#(X1) p16: mark#(s(X)) -> mark#(X) and R consists of: r1: a__from(X) -> cons(mark(X),from(s(X))) r2: a__first(|0|(),Z) -> nil() r3: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r4: a__sel(|0|(),cons(X,Z)) -> mark(X) r5: a__sel(s(X),cons(Y,Z)) -> a__sel(mark(X),mark(Z)) r6: mark(from(X)) -> a__from(mark(X)) r7: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r8: mark(sel(X1,X2)) -> a__sel(mark(X1),mark(X2)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: mark(s(X)) -> s(mark(X)) r11: mark(|0|()) -> |0|() r12: mark(nil()) -> nil() r13: a__from(X) -> from(X) r14: a__first(X1,X2) -> first(X1,X2) r15: a__sel(X1,X2) -> sel(X1,X2) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: a__from#(X) -> mark#(X) p2: mark#(s(X)) -> mark#(X) p3: mark#(cons(X1,X2)) -> mark#(X1) p4: mark#(sel(X1,X2)) -> mark#(X2) p5: mark#(sel(X1,X2)) -> mark#(X1) p6: mark#(sel(X1,X2)) -> a__sel#(mark(X1),mark(X2)) p7: a__sel#(s(X),cons(Y,Z)) -> mark#(Z) p8: mark#(first(X1,X2)) -> mark#(X2) p9: mark#(first(X1,X2)) -> mark#(X1) p10: mark#(first(X1,X2)) -> a__first#(mark(X1),mark(X2)) p11: a__first#(s(X),cons(Y,Z)) -> mark#(Y) p12: mark#(from(X)) -> mark#(X) p13: mark#(from(X)) -> a__from#(mark(X)) p14: a__sel#(s(X),cons(Y,Z)) -> mark#(X) p15: a__sel#(s(X),cons(Y,Z)) -> a__sel#(mark(X),mark(Z)) p16: a__sel#(|0|(),cons(X,Z)) -> mark#(X) and R consists of: r1: a__from(X) -> cons(mark(X),from(s(X))) r2: a__first(|0|(),Z) -> nil() r3: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r4: a__sel(|0|(),cons(X,Z)) -> mark(X) r5: a__sel(s(X),cons(Y,Z)) -> a__sel(mark(X),mark(Z)) r6: mark(from(X)) -> a__from(mark(X)) r7: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r8: mark(sel(X1,X2)) -> a__sel(mark(X1),mark(X2)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: mark(s(X)) -> s(mark(X)) r11: mark(|0|()) -> |0|() r12: mark(nil()) -> nil() r13: a__from(X) -> from(X) r14: a__first(X1,X2) -> first(X1,X2) r15: a__sel(X1,X2) -> sel(X1,X2) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: a__from#_A(x1) = x1 + 4 mark#_A(x1) = x1 + 4 s_A(x1) = x1 cons_A(x1,x2) = max{3, x1, x2} sel_A(x1,x2) = max{x1 + 12, x2 + 7} a__sel#_A(x1,x2) = max{x1 + 5, x2 + 11} mark_A(x1) = x1 first_A(x1,x2) = max{8, x1 + 5, x2 + 5} a__first#_A(x1,x2) = max{12, x1 + 9, x2 + 6} from_A(x1) = max{3, x1} |0|_A = 10 a__from_A(x1) = max{3, x1} a__first_A(x1,x2) = max{8, x1 + 5, x2 + 5} nil_A = 9 a__sel_A(x1,x2) = max{x1 + 12, x2 + 7} precedence: mark = a__sel > a__from > a__first > a__from# = mark# = cons > a__sel# > sel > |0| > first = a__first# > s = from = nil partial status: pi(a__from#) = [] pi(mark#) = [] pi(s) = [] pi(cons) = [2] pi(sel) = [2] pi(a__sel#) = [] pi(mark) = [1] pi(first) = [1, 2] pi(a__first#) = [1, 2] pi(from) = [1] pi(|0|) = [] pi(a__from) = [1] pi(a__first) = [1, 2] pi(nil) = [] pi(a__sel) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: a__from#_A(x1) = 36 mark#_A(x1) = 36 s_A(x1) = 29 cons_A(x1,x2) = 0 sel_A(x1,x2) = x2 + 23 a__sel#_A(x1,x2) = 36 mark_A(x1) = 30 first_A(x1,x2) = max{27, x1 + 15, x2 + 15} a__first#_A(x1,x2) = max{28, x1 + 7, x2 + 10} from_A(x1) = 21 |0|_A = 31 a__from_A(x1) = max{28, x1} a__first_A(x1,x2) = max{x1 + 15, x2 + 107} nil_A = 32 a__sel_A(x1,x2) = 32 precedence: a__sel# > a__from# = mark# = a__first# = a__first = nil = a__sel > |0| > s = mark > sel > a__from > cons = first = from partial status: pi(a__from#) = [] pi(mark#) = [] pi(s) = [] pi(cons) = [] pi(sel) = [2] pi(a__sel#) = [] pi(mark) = [] pi(first) = [2] pi(a__first#) = [2] pi(from) = [] pi(|0|) = [] pi(a__from) = [] pi(a__first) = [] pi(nil) = [] pi(a__sel) = [] The next rules are strictly ordered: p4, p5, p6, p7, p8, p9, p10, p11, p14, p16 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: a__from#(X) -> mark#(X) 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__sel#(s(X),cons(Y,Z)) -> a__sel#(mark(X),mark(Z)) and R consists of: r1: a__from(X) -> cons(mark(X),from(s(X))) r2: a__first(|0|(),Z) -> nil() r3: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r4: a__sel(|0|(),cons(X,Z)) -> mark(X) r5: a__sel(s(X),cons(Y,Z)) -> a__sel(mark(X),mark(Z)) r6: mark(from(X)) -> a__from(mark(X)) r7: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r8: mark(sel(X1,X2)) -> a__sel(mark(X1),mark(X2)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: mark(s(X)) -> s(mark(X)) r11: mark(|0|()) -> |0|() r12: mark(nil()) -> nil() r13: a__from(X) -> from(X) r14: a__first(X1,X2) -> first(X1,X2) r15: a__sel(X1,X2) -> sel(X1,X2) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4, p5} {p6} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: a__from#(X) -> mark#(X) p2: mark#(from(X)) -> a__from#(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__from(X) -> cons(mark(X),from(s(X))) r2: a__first(|0|(),Z) -> nil() r3: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r4: a__sel(|0|(),cons(X,Z)) -> mark(X) r5: a__sel(s(X),cons(Y,Z)) -> a__sel(mark(X),mark(Z)) r6: mark(from(X)) -> a__from(mark(X)) r7: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r8: mark(sel(X1,X2)) -> a__sel(mark(X1),mark(X2)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: mark(s(X)) -> s(mark(X)) r11: mark(|0|()) -> |0|() r12: mark(nil()) -> nil() r13: a__from(X) -> from(X) r14: a__first(X1,X2) -> first(X1,X2) r15: a__sel(X1,X2) -> sel(X1,X2) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: a__from#_A(x1) = max{15, x1 + 8} mark#_A(x1) = max{5, x1} from_A(x1) = max{15, x1 + 9} mark_A(x1) = max{3, x1} cons_A(x1,x2) = max{15, x1 + 9, x2} s_A(x1) = max{6, x1} a__from_A(x1) = max{15, x1 + 9} a__first_A(x1,x2) = max{24, x1 + 20, x2 + 16} |0|_A = 16 nil_A = 15 first_A(x1,x2) = max{24, x1 + 20, x2 + 16} a__sel_A(x1,x2) = max{6, x2 + 2} sel_A(x1,x2) = max{6, x2 + 2} precedence: a__first = |0| = first > a__sel = sel > mark = s > nil > a__from > from > a__from# = mark# = cons partial status: pi(a__from#) = [1] pi(mark#) = [1] pi(from) = [1] pi(mark) = [1] pi(cons) = [1] pi(s) = [1] pi(a__from) = [1] pi(a__first) = [] pi(|0|) = [] pi(nil) = [] pi(first) = [] pi(a__sel) = [] pi(sel) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: a__from#_A(x1) = x1 + 4 mark#_A(x1) = x1 + 3 from_A(x1) = x1 + 9 mark_A(x1) = x1 cons_A(x1,x2) = x1 + 5 s_A(x1) = x1 + 4 a__from_A(x1) = x1 + 9 a__first_A(x1,x2) = 2 |0|_A = 2 nil_A = 3 first_A(x1,x2) = 2 a__sel_A(x1,x2) = 2 sel_A(x1,x2) = 2 precedence: a__from# = mark# > mark > from = cons = s = a__from = a__first = |0| = nil = first = a__sel = sel partial status: pi(a__from#) = [] pi(mark#) = [1] pi(from) = [] pi(mark) = [] pi(cons) = [] pi(s) = [1] pi(a__from) = [1] pi(a__first) = [] pi(|0|) = [] pi(nil) = [] pi(first) = [] pi(a__sel) = [] pi(sel) = [] The next rules are strictly ordered: p1, p3, p4, p5 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: mark#(from(X)) -> a__from#(mark(X)) and R consists of: r1: a__from(X) -> cons(mark(X),from(s(X))) r2: a__first(|0|(),Z) -> nil() r3: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r4: a__sel(|0|(),cons(X,Z)) -> mark(X) r5: a__sel(s(X),cons(Y,Z)) -> a__sel(mark(X),mark(Z)) r6: mark(from(X)) -> a__from(mark(X)) r7: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r8: mark(sel(X1,X2)) -> a__sel(mark(X1),mark(X2)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: mark(s(X)) -> s(mark(X)) r11: mark(|0|()) -> |0|() r12: mark(nil()) -> nil() r13: a__from(X) -> from(X) r14: a__first(X1,X2) -> first(X1,X2) r15: a__sel(X1,X2) -> sel(X1,X2) The estimated dependency graph contains the following SCCs: (no SCCs) -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: a__sel#(s(X),cons(Y,Z)) -> a__sel#(mark(X),mark(Z)) and R consists of: r1: a__from(X) -> cons(mark(X),from(s(X))) r2: a__first(|0|(),Z) -> nil() r3: a__first(s(X),cons(Y,Z)) -> cons(mark(Y),first(X,Z)) r4: a__sel(|0|(),cons(X,Z)) -> mark(X) r5: a__sel(s(X),cons(Y,Z)) -> a__sel(mark(X),mark(Z)) r6: mark(from(X)) -> a__from(mark(X)) r7: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r8: mark(sel(X1,X2)) -> a__sel(mark(X1),mark(X2)) r9: mark(cons(X1,X2)) -> cons(mark(X1),X2) r10: mark(s(X)) -> s(mark(X)) r11: mark(|0|()) -> |0|() r12: mark(nil()) -> nil() r13: a__from(X) -> from(X) r14: a__first(X1,X2) -> first(X1,X2) r15: a__sel(X1,X2) -> sel(X1,X2) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: a__sel#_A(x1,x2) = max{4, x1 + 2, x2 + 3} s_A(x1) = x1 cons_A(x1,x2) = max{x1 - 2, x2} mark_A(x1) = x1 a__from_A(x1) = x1 + 1 from_A(x1) = x1 + 1 a__first_A(x1,x2) = max{1, x1 - 1, x2} |0|_A = 2 nil_A = 0 first_A(x1,x2) = max{1, x1 - 1, x2} a__sel_A(x1,x2) = max{x1 + 3, x2 + 4} sel_A(x1,x2) = max{x1 + 3, x2 + 4} precedence: a__sel# > nil > a__sel = sel > s = mark = a__from = from = a__first = first > cons = |0| partial status: pi(a__sel#) = [1] pi(s) = [1] pi(cons) = [] pi(mark) = [1] pi(a__from) = [] pi(from) = [] pi(a__first) = [] pi(|0|) = [] pi(nil) = [] pi(first) = [] pi(a__sel) = [] pi(sel) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: a__sel#_A(x1,x2) = max{13, x1} s_A(x1) = x1 + 3 cons_A(x1,x2) = 0 mark_A(x1) = x1 a__from_A(x1) = 5 from_A(x1) = 5 a__first_A(x1,x2) = 13 |0|_A = 6 nil_A = 14 first_A(x1,x2) = 13 a__sel_A(x1,x2) = 1 sel_A(x1,x2) = 1 precedence: a__from = from > s = cons = mark = a__first = a__sel > first > a__sel# = |0| = nil = sel partial status: pi(a__sel#) = [1] pi(s) = [] pi(cons) = [] pi(mark) = [1] pi(a__from) = [] pi(from) = [] pi(a__first) = [] pi(|0|) = [] pi(nil) = [] pi(first) = [] pi(a__sel) = [] pi(sel) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.