YES We show the termination of the TRS R: a__from(X) -> cons(mark(X),from(s(X))) a__sel(|0|(),cons(X,Y)) -> mark(X) a__sel(s(X),cons(Y,Z)) -> a__sel(mark(X),mark(Z)) mark(from(X)) -> a__from(mark(X)) 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|() a__from(X) -> from(X) 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__sel#(|0|(),cons(X,Y)) -> mark#(X) p3: a__sel#(s(X),cons(Y,Z)) -> a__sel#(mark(X),mark(Z)) p4: a__sel#(s(X),cons(Y,Z)) -> mark#(X) p5: a__sel#(s(X),cons(Y,Z)) -> mark#(Z) p6: mark#(from(X)) -> a__from#(mark(X)) p7: mark#(from(X)) -> mark#(X) p8: mark#(sel(X1,X2)) -> a__sel#(mark(X1),mark(X2)) p9: mark#(sel(X1,X2)) -> mark#(X1) p10: mark#(sel(X1,X2)) -> mark#(X2) p11: mark#(cons(X1,X2)) -> mark#(X1) p12: mark#(s(X)) -> mark#(X) and R consists of: r1: a__from(X) -> cons(mark(X),from(s(X))) r2: a__sel(|0|(),cons(X,Y)) -> mark(X) r3: a__sel(s(X),cons(Y,Z)) -> a__sel(mark(X),mark(Z)) r4: mark(from(X)) -> a__from(mark(X)) r5: mark(sel(X1,X2)) -> a__sel(mark(X1),mark(X2)) r6: mark(cons(X1,X2)) -> cons(mark(X1),X2) r7: mark(s(X)) -> s(mark(X)) r8: mark(|0|()) -> |0|() r9: a__from(X) -> from(X) r10: 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} -- 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#(from(X)) -> mark#(X) p9: mark#(from(X)) -> a__from#(mark(X)) p10: a__sel#(s(X),cons(Y,Z)) -> mark#(X) p11: a__sel#(s(X),cons(Y,Z)) -> a__sel#(mark(X),mark(Z)) p12: a__sel#(|0|(),cons(X,Y)) -> mark#(X) and R consists of: r1: a__from(X) -> cons(mark(X),from(s(X))) r2: a__sel(|0|(),cons(X,Y)) -> mark(X) r3: a__sel(s(X),cons(Y,Z)) -> a__sel(mark(X),mark(Z)) r4: mark(from(X)) -> a__from(mark(X)) r5: mark(sel(X1,X2)) -> a__sel(mark(X1),mark(X2)) r6: mark(cons(X1,X2)) -> cons(mark(X1),X2) r7: mark(s(X)) -> s(mark(X)) r8: mark(|0|()) -> |0|() r9: a__from(X) -> from(X) r10: a__sel(X1,X2) -> sel(X1,X2) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10 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{2, x1 + 1} mark#_A(x1) = max{0, x1 - 2} s_A(x1) = x1 cons_A(x1,x2) = max{x1 + 5, x2} sel_A(x1,x2) = max{10, x1 + 9, x2 + 5} a__sel#_A(x1,x2) = max{x1 + 2, x2 - 1} mark_A(x1) = x1 from_A(x1) = max{6, x1 + 5} |0|_A = 1 a__from_A(x1) = max{6, x1 + 5} a__sel_A(x1,x2) = max{10, x1 + 9, x2 + 5} precedence: a__from# = mark# = s = cons = sel = a__sel# = mark = from = |0| = a__from = a__sel partial status: pi(a__from#) = [1] pi(mark#) = [] pi(s) = [] pi(cons) = [] pi(sel) = [] pi(a__sel#) = [1] pi(mark) = [] pi(from) = [] pi(|0|) = [] pi(a__from) = [] pi(a__sel) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: a__from#_A(x1) = 7 mark#_A(x1) = 7 s_A(x1) = 4 cons_A(x1,x2) = 4 sel_A(x1,x2) = 0 a__sel#_A(x1,x2) = 4 mark_A(x1) = 4 from_A(x1) = 4 |0|_A = 4 a__from_A(x1) = 4 a__sel_A(x1,x2) = 4 precedence: mark = |0| = a__sel > a__from > from > cons = sel > a__from# = mark# > s = a__sel# partial status: pi(a__from#) = [] pi(mark#) = [] pi(s) = [] pi(cons) = [] pi(sel) = [] pi(a__sel#) = [] pi(mark) = [] pi(from) = [] pi(|0|) = [] pi(a__from) = [] pi(a__sel) = [] The next rules are strictly ordered: p7, p10, p12 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#(sel(X1,X2)) -> mark#(X2) p5: mark#(sel(X1,X2)) -> mark#(X1) p6: mark#(sel(X1,X2)) -> a__sel#(mark(X1),mark(X2)) p7: mark#(from(X)) -> mark#(X) p8: mark#(from(X)) -> a__from#(mark(X)) p9: 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__sel(|0|(),cons(X,Y)) -> mark(X) r3: a__sel(s(X),cons(Y,Z)) -> a__sel(mark(X),mark(Z)) r4: mark(from(X)) -> a__from(mark(X)) r5: mark(sel(X1,X2)) -> a__sel(mark(X1),mark(X2)) r6: mark(cons(X1,X2)) -> cons(mark(X1),X2) r7: mark(s(X)) -> s(mark(X)) r8: mark(|0|()) -> |0|() r9: a__from(X) -> from(X) r10: a__sel(X1,X2) -> sel(X1,X2) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4, p5, p7, p8} {p9} -- 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#(sel(X1,X2)) -> mark#(X1) p5: mark#(sel(X1,X2)) -> mark#(X2) p6: mark#(cons(X1,X2)) -> mark#(X1) p7: mark#(s(X)) -> mark#(X) and R consists of: r1: a__from(X) -> cons(mark(X),from(s(X))) r2: a__sel(|0|(),cons(X,Y)) -> mark(X) r3: a__sel(s(X),cons(Y,Z)) -> a__sel(mark(X),mark(Z)) r4: mark(from(X)) -> a__from(mark(X)) r5: mark(sel(X1,X2)) -> a__sel(mark(X1),mark(X2)) r6: mark(cons(X1,X2)) -> cons(mark(X1),X2) r7: mark(s(X)) -> s(mark(X)) r8: mark(|0|()) -> |0|() r9: a__from(X) -> from(X) r10: a__sel(X1,X2) -> sel(X1,X2) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10 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 + 7 mark#_A(x1) = x1 + 6 from_A(x1) = x1 + 6 mark_A(x1) = x1 sel_A(x1,x2) = max{x1 + 4, x2 + 2} cons_A(x1,x2) = max{x1 + 6, x2} s_A(x1) = x1 a__from_A(x1) = x1 + 6 a__sel_A(x1,x2) = max{x1 + 4, x2 + 2} |0|_A = 1 precedence: a__from# = mark# = from = mark = sel = cons = s = a__from = a__sel = |0| partial status: pi(a__from#) = [] pi(mark#) = [] pi(from) = [] pi(mark) = [] pi(sel) = [] pi(cons) = [] pi(s) = [] pi(a__from) = [] pi(a__sel) = [] pi(|0|) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: a__from#_A(x1) = max{56, x1 + 51} mark#_A(x1) = max{34, x1 + 28} from_A(x1) = x1 + 27 mark_A(x1) = x1 + 12 sel_A(x1,x2) = 11 cons_A(x1,x2) = 1 s_A(x1) = x1 + 13 a__from_A(x1) = max{28, x1 + 27} a__sel_A(x1,x2) = 12 |0|_A = 6 precedence: a__from# = mark# > cons = a__sel > sel > mark = s = a__from > |0| > from partial status: pi(a__from#) = [] pi(mark#) = [] pi(from) = [1] pi(mark) = [1] pi(sel) = [] pi(cons) = [] pi(s) = [1] pi(a__from) = [] pi(a__sel) = [] pi(|0|) = [] The next rules are strictly ordered: p1, p2, p3, p4, p5, p6, p7 We remove them from the problem. Then no dependency pair remains. -- 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__sel(|0|(),cons(X,Y)) -> mark(X) r3: a__sel(s(X),cons(Y,Z)) -> a__sel(mark(X),mark(Z)) r4: mark(from(X)) -> a__from(mark(X)) r5: mark(sel(X1,X2)) -> a__sel(mark(X1),mark(X2)) r6: mark(cons(X1,X2)) -> cons(mark(X1),X2) r7: mark(s(X)) -> s(mark(X)) r8: mark(|0|()) -> |0|() r9: a__from(X) -> from(X) r10: a__sel(X1,X2) -> sel(X1,X2) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10 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{x1 + 2, x2 + 2} s_A(x1) = x1 cons_A(x1,x2) = max{4, x1 + 3, x2} mark_A(x1) = x1 a__from_A(x1) = max{6, x1 + 5} from_A(x1) = max{6, x1 + 5} a__sel_A(x1,x2) = max{1, x2 - 1} |0|_A = 2 sel_A(x1,x2) = max{1, x2 - 1} precedence: a__from = from > a__sel# = a__sel = sel > cons > s = mark = |0| partial status: pi(a__sel#) = [1] pi(s) = [1] pi(cons) = [] pi(mark) = [1] pi(a__from) = [] pi(from) = [] pi(a__sel) = [] pi(|0|) = [] pi(sel) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: a__sel#_A(x1,x2) = max{1, x1} s_A(x1) = x1 + 5 cons_A(x1,x2) = 1 mark_A(x1) = x1 a__from_A(x1) = 2 from_A(x1) = 2 a__sel_A(x1,x2) = 2 |0|_A = 1 sel_A(x1,x2) = 1 precedence: s = a__sel > a__sel# = cons = mark = a__from = |0| > from > sel partial status: pi(a__sel#) = [1] pi(s) = [] pi(cons) = [] pi(mark) = [1] pi(a__from) = [] pi(from) = [] pi(a__sel) = [] pi(|0|) = [] pi(sel) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.