YES We show the termination of the TRS R: active(|2nd|(cons(X,cons(Y,Z)))) -> mark(Y) active(from(X)) -> mark(cons(X,from(s(X)))) mark(|2nd|(X)) -> active(|2nd|(mark(X))) mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) mark(from(X)) -> active(from(mark(X))) mark(s(X)) -> active(s(mark(X))) |2nd|(mark(X)) -> |2nd|(X) |2nd|(active(X)) -> |2nd|(X) cons(mark(X1),X2) -> cons(X1,X2) cons(X1,mark(X2)) -> cons(X1,X2) cons(active(X1),X2) -> cons(X1,X2) cons(X1,active(X2)) -> cons(X1,X2) from(mark(X)) -> from(X) from(active(X)) -> from(X) s(mark(X)) -> s(X) s(active(X)) -> s(X) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: active#(|2nd|(cons(X,cons(Y,Z)))) -> mark#(Y) p2: active#(from(X)) -> mark#(cons(X,from(s(X)))) p3: active#(from(X)) -> cons#(X,from(s(X))) p4: active#(from(X)) -> from#(s(X)) p5: active#(from(X)) -> s#(X) p6: mark#(|2nd|(X)) -> active#(|2nd|(mark(X))) p7: mark#(|2nd|(X)) -> |2nd|#(mark(X)) p8: mark#(|2nd|(X)) -> mark#(X) p9: mark#(cons(X1,X2)) -> active#(cons(mark(X1),X2)) p10: mark#(cons(X1,X2)) -> cons#(mark(X1),X2) p11: mark#(cons(X1,X2)) -> mark#(X1) p12: mark#(from(X)) -> active#(from(mark(X))) p13: mark#(from(X)) -> from#(mark(X)) p14: mark#(from(X)) -> mark#(X) p15: mark#(s(X)) -> active#(s(mark(X))) p16: mark#(s(X)) -> s#(mark(X)) p17: mark#(s(X)) -> mark#(X) p18: |2nd|#(mark(X)) -> |2nd|#(X) p19: |2nd|#(active(X)) -> |2nd|#(X) p20: cons#(mark(X1),X2) -> cons#(X1,X2) p21: cons#(X1,mark(X2)) -> cons#(X1,X2) p22: cons#(active(X1),X2) -> cons#(X1,X2) p23: cons#(X1,active(X2)) -> cons#(X1,X2) p24: from#(mark(X)) -> from#(X) p25: from#(active(X)) -> from#(X) p26: s#(mark(X)) -> s#(X) p27: s#(active(X)) -> s#(X) and R consists of: r1: active(|2nd|(cons(X,cons(Y,Z)))) -> mark(Y) r2: active(from(X)) -> mark(cons(X,from(s(X)))) r3: mark(|2nd|(X)) -> active(|2nd|(mark(X))) r4: mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) r5: mark(from(X)) -> active(from(mark(X))) r6: mark(s(X)) -> active(s(mark(X))) r7: |2nd|(mark(X)) -> |2nd|(X) r8: |2nd|(active(X)) -> |2nd|(X) r9: cons(mark(X1),X2) -> cons(X1,X2) r10: cons(X1,mark(X2)) -> cons(X1,X2) r11: cons(active(X1),X2) -> cons(X1,X2) r12: cons(X1,active(X2)) -> cons(X1,X2) r13: from(mark(X)) -> from(X) r14: from(active(X)) -> from(X) r15: s(mark(X)) -> s(X) r16: s(active(X)) -> s(X) The estimated dependency graph contains the following SCCs: {p1, p2, p6, p8, p9, p11, p12, p14, p15, p17} {p20, p21, p22, p23} {p24, p25} {p26, p27} {p18, p19} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: active#(|2nd|(cons(X,cons(Y,Z)))) -> mark#(Y) p2: mark#(s(X)) -> mark#(X) p3: mark#(s(X)) -> active#(s(mark(X))) p4: active#(from(X)) -> mark#(cons(X,from(s(X)))) p5: mark#(from(X)) -> mark#(X) p6: mark#(from(X)) -> active#(from(mark(X))) p7: mark#(cons(X1,X2)) -> mark#(X1) p8: mark#(cons(X1,X2)) -> active#(cons(mark(X1),X2)) p9: mark#(|2nd|(X)) -> mark#(X) p10: mark#(|2nd|(X)) -> active#(|2nd|(mark(X))) and R consists of: r1: active(|2nd|(cons(X,cons(Y,Z)))) -> mark(Y) r2: active(from(X)) -> mark(cons(X,from(s(X)))) r3: mark(|2nd|(X)) -> active(|2nd|(mark(X))) r4: mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) r5: mark(from(X)) -> active(from(mark(X))) r6: mark(s(X)) -> active(s(mark(X))) r7: |2nd|(mark(X)) -> |2nd|(X) r8: |2nd|(active(X)) -> |2nd|(X) r9: cons(mark(X1),X2) -> cons(X1,X2) r10: cons(X1,mark(X2)) -> cons(X1,X2) r11: cons(active(X1),X2) -> cons(X1,X2) r12: cons(X1,active(X2)) -> cons(X1,X2) r13: from(mark(X)) -> from(X) r14: from(active(X)) -> from(X) r15: s(mark(X)) -> s(X) r16: s(active(X)) -> s(X) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: active#_A(x1) = max{20, x1 + 6} |2nd|_A(x1) = x1 + 19 cons_A(x1,x2) = max{x1 + 13, x2 - 16} mark#_A(x1) = x1 + 20 s_A(x1) = x1 mark_A(x1) = x1 + 14 from_A(x1) = x1 + 27 active_A(x1) = x1 precedence: active# = |2nd| = cons = mark# = s = mark = from = active partial status: pi(active#) = [] pi(|2nd|) = [] pi(cons) = [] pi(mark#) = [] pi(s) = [] pi(mark) = [] pi(from) = [] pi(active) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: active#_A(x1) = 33 |2nd|_A(x1) = 74 cons_A(x1,x2) = 35 mark#_A(x1) = max{24, x1 - 2} s_A(x1) = max{43, x1} mark_A(x1) = 74 from_A(x1) = max{74, x1} active_A(x1) = max{61, x1} precedence: cons = mark = active > from > s > active# = mark# > |2nd| partial status: pi(active#) = [] pi(|2nd|) = [] pi(cons) = [] pi(mark#) = [] pi(s) = [] pi(mark) = [] pi(from) = [] pi(active) = [] The next rules are strictly ordered: p1, p5, p6, p7, p9 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#(s(X)) -> active#(s(mark(X))) p3: active#(from(X)) -> mark#(cons(X,from(s(X)))) p4: mark#(cons(X1,X2)) -> active#(cons(mark(X1),X2)) p5: mark#(|2nd|(X)) -> active#(|2nd|(mark(X))) and R consists of: r1: active(|2nd|(cons(X,cons(Y,Z)))) -> mark(Y) r2: active(from(X)) -> mark(cons(X,from(s(X)))) r3: mark(|2nd|(X)) -> active(|2nd|(mark(X))) r4: mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) r5: mark(from(X)) -> active(from(mark(X))) r6: mark(s(X)) -> active(s(mark(X))) r7: |2nd|(mark(X)) -> |2nd|(X) r8: |2nd|(active(X)) -> |2nd|(X) r9: cons(mark(X1),X2) -> cons(X1,X2) r10: cons(X1,mark(X2)) -> cons(X1,X2) r11: cons(active(X1),X2) -> cons(X1,X2) r12: cons(X1,active(X2)) -> cons(X1,X2) r13: from(mark(X)) -> from(X) r14: from(active(X)) -> from(X) r15: s(mark(X)) -> s(X) r16: s(active(X)) -> s(X) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4, p5} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: mark#(s(X)) -> mark#(X) p2: mark#(|2nd|(X)) -> active#(|2nd|(mark(X))) p3: active#(from(X)) -> mark#(cons(X,from(s(X)))) p4: mark#(cons(X1,X2)) -> active#(cons(mark(X1),X2)) p5: mark#(s(X)) -> active#(s(mark(X))) and R consists of: r1: active(|2nd|(cons(X,cons(Y,Z)))) -> mark(Y) r2: active(from(X)) -> mark(cons(X,from(s(X)))) r3: mark(|2nd|(X)) -> active(|2nd|(mark(X))) r4: mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) r5: mark(from(X)) -> active(from(mark(X))) r6: mark(s(X)) -> active(s(mark(X))) r7: |2nd|(mark(X)) -> |2nd|(X) r8: |2nd|(active(X)) -> |2nd|(X) r9: cons(mark(X1),X2) -> cons(X1,X2) r10: cons(X1,mark(X2)) -> cons(X1,X2) r11: cons(active(X1),X2) -> cons(X1,X2) r12: cons(X1,active(X2)) -> cons(X1,X2) r13: from(mark(X)) -> from(X) r14: from(active(X)) -> from(X) r15: s(mark(X)) -> s(X) r16: s(active(X)) -> s(X) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: mark#_A(x1) = max{15, x1 + 4} s_A(x1) = x1 |2nd|_A(x1) = max{0, x1 - 3} active#_A(x1) = max{15, x1} mark_A(x1) = x1 from_A(x1) = max{17, x1 + 14} cons_A(x1,x2) = max{12, x1 + 8, x2 - 4} active_A(x1) = x1 precedence: from > mark# = |2nd| > mark > s = active# = active > cons partial status: pi(mark#) = [1] pi(s) = [1] pi(|2nd|) = [] pi(active#) = [1] pi(mark) = [1] pi(from) = [] pi(cons) = [] pi(active) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: mark#_A(x1) = max{16, x1} s_A(x1) = max{247, x1 + 238} |2nd|_A(x1) = 25 active#_A(x1) = max{23, x1 - 8} mark_A(x1) = 7 from_A(x1) = 115 cons_A(x1,x2) = 23 active_A(x1) = 6 precedence: |2nd| > s = from = cons = active > active# > mark# > mark partial status: pi(mark#) = [1] pi(s) = [] pi(|2nd|) = [] pi(active#) = [] pi(mark) = [] pi(from) = [] pi(cons) = [] pi(active) = [] The next rules are strictly ordered: p1, p2, p3, p4, p5 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: cons#(mark(X1),X2) -> cons#(X1,X2) p2: cons#(X1,active(X2)) -> cons#(X1,X2) p3: cons#(active(X1),X2) -> cons#(X1,X2) p4: cons#(X1,mark(X2)) -> cons#(X1,X2) and R consists of: r1: active(|2nd|(cons(X,cons(Y,Z)))) -> mark(Y) r2: active(from(X)) -> mark(cons(X,from(s(X)))) r3: mark(|2nd|(X)) -> active(|2nd|(mark(X))) r4: mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) r5: mark(from(X)) -> active(from(mark(X))) r6: mark(s(X)) -> active(s(mark(X))) r7: |2nd|(mark(X)) -> |2nd|(X) r8: |2nd|(active(X)) -> |2nd|(X) r9: cons(mark(X1),X2) -> cons(X1,X2) r10: cons(X1,mark(X2)) -> cons(X1,X2) r11: cons(active(X1),X2) -> cons(X1,X2) r12: cons(X1,active(X2)) -> cons(X1,X2) r13: from(mark(X)) -> from(X) r14: from(active(X)) -> from(X) r15: s(mark(X)) -> s(X) r16: s(active(X)) -> s(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: max/plus interpretations on natural numbers: cons#_A(x1,x2) = max{2, x1 + 1, x2 + 1} mark_A(x1) = max{1, x1} active_A(x1) = max{1, x1} precedence: cons# = mark = active partial status: pi(cons#) = [1, 2] pi(mark) = [1] pi(active) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: cons#_A(x1,x2) = max{x1 + 1, x2 - 1} mark_A(x1) = x1 active_A(x1) = x1 precedence: cons# = mark = active partial status: pi(cons#) = [1] pi(mark) = [1] pi(active) = [1] The next rules are strictly ordered: p1, p2, p3, p4 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: from#(mark(X)) -> from#(X) p2: from#(active(X)) -> from#(X) and R consists of: r1: active(|2nd|(cons(X,cons(Y,Z)))) -> mark(Y) r2: active(from(X)) -> mark(cons(X,from(s(X)))) r3: mark(|2nd|(X)) -> active(|2nd|(mark(X))) r4: mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) r5: mark(from(X)) -> active(from(mark(X))) r6: mark(s(X)) -> active(s(mark(X))) r7: |2nd|(mark(X)) -> |2nd|(X) r8: |2nd|(active(X)) -> |2nd|(X) r9: cons(mark(X1),X2) -> cons(X1,X2) r10: cons(X1,mark(X2)) -> cons(X1,X2) r11: cons(active(X1),X2) -> cons(X1,X2) r12: cons(X1,active(X2)) -> cons(X1,X2) r13: from(mark(X)) -> from(X) r14: from(active(X)) -> from(X) r15: s(mark(X)) -> s(X) r16: s(active(X)) -> s(X) The set of usable rules consists of (no rules) Take the monotone reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: from#_A(x1) = x1 + 2 mark_A(x1) = x1 active_A(x1) = x1 + 2 precedence: mark > active > from# partial status: pi(from#) = [1] pi(mark) = [1] pi(active) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: from#_A(x1) = x1 + 1 mark_A(x1) = x1 active_A(x1) = x1 precedence: from# = mark = active partial status: pi(from#) = [1] pi(mark) = [1] pi(active) = [1] The next rules are strictly ordered: p1, p2 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: s#(mark(X)) -> s#(X) p2: s#(active(X)) -> s#(X) and R consists of: r1: active(|2nd|(cons(X,cons(Y,Z)))) -> mark(Y) r2: active(from(X)) -> mark(cons(X,from(s(X)))) r3: mark(|2nd|(X)) -> active(|2nd|(mark(X))) r4: mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) r5: mark(from(X)) -> active(from(mark(X))) r6: mark(s(X)) -> active(s(mark(X))) r7: |2nd|(mark(X)) -> |2nd|(X) r8: |2nd|(active(X)) -> |2nd|(X) r9: cons(mark(X1),X2) -> cons(X1,X2) r10: cons(X1,mark(X2)) -> cons(X1,X2) r11: cons(active(X1),X2) -> cons(X1,X2) r12: cons(X1,active(X2)) -> cons(X1,X2) r13: from(mark(X)) -> from(X) r14: from(active(X)) -> from(X) r15: s(mark(X)) -> s(X) r16: s(active(X)) -> s(X) The set of usable rules consists of (no rules) Take the monotone reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: s#_A(x1) = max{6, x1 + 4} mark_A(x1) = max{4, x1 + 3} active_A(x1) = max{2, x1 + 1} precedence: s# = mark = active partial status: pi(s#) = [1] pi(mark) = [1] pi(active) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: s#_A(x1) = x1 + 1 mark_A(x1) = x1 active_A(x1) = x1 precedence: s# = mark = active partial status: pi(s#) = [1] pi(mark) = [1] pi(active) = [1] The next rules are strictly ordered: p1, p2 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: |2nd|#(mark(X)) -> |2nd|#(X) p2: |2nd|#(active(X)) -> |2nd|#(X) and R consists of: r1: active(|2nd|(cons(X,cons(Y,Z)))) -> mark(Y) r2: active(from(X)) -> mark(cons(X,from(s(X)))) r3: mark(|2nd|(X)) -> active(|2nd|(mark(X))) r4: mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) r5: mark(from(X)) -> active(from(mark(X))) r6: mark(s(X)) -> active(s(mark(X))) r7: |2nd|(mark(X)) -> |2nd|(X) r8: |2nd|(active(X)) -> |2nd|(X) r9: cons(mark(X1),X2) -> cons(X1,X2) r10: cons(X1,mark(X2)) -> cons(X1,X2) r11: cons(active(X1),X2) -> cons(X1,X2) r12: cons(X1,active(X2)) -> cons(X1,X2) r13: from(mark(X)) -> from(X) r14: from(active(X)) -> from(X) r15: s(mark(X)) -> s(X) r16: s(active(X)) -> s(X) The set of usable rules consists of (no rules) Take the monotone reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: |2nd|#_A(x1) = x1 + 1 mark_A(x1) = x1 active_A(x1) = x1 precedence: |2nd|# = mark = active partial status: pi(|2nd|#) = [] pi(mark) = [] pi(active) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: |2nd|#_A(x1) = x1 + 1 mark_A(x1) = x1 active_A(x1) = x1 precedence: |2nd|# = mark = active partial status: pi(|2nd|#) = [1] pi(mark) = [1] pi(active) = [1] The next rules are strictly ordered: p1, p2 We remove them from the problem. Then no dependency pair remains.