YES We show the termination of the TRS R: active(first(|0|(),X)) -> mark(nil()) active(first(s(X),cons(Y,Z))) -> mark(cons(Y,first(X,Z))) active(from(X)) -> mark(cons(X,from(s(X)))) mark(first(X1,X2)) -> active(first(mark(X1),mark(X2))) mark(|0|()) -> active(|0|()) mark(nil()) -> active(nil()) mark(s(X)) -> active(s(mark(X))) mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) mark(from(X)) -> active(from(mark(X))) first(mark(X1),X2) -> first(X1,X2) first(X1,mark(X2)) -> first(X1,X2) first(active(X1),X2) -> first(X1,X2) first(X1,active(X2)) -> first(X1,X2) s(mark(X)) -> s(X) s(active(X)) -> s(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) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: active#(first(|0|(),X)) -> mark#(nil()) p2: active#(first(s(X),cons(Y,Z))) -> mark#(cons(Y,first(X,Z))) p3: active#(first(s(X),cons(Y,Z))) -> cons#(Y,first(X,Z)) p4: active#(first(s(X),cons(Y,Z))) -> first#(X,Z) p5: active#(from(X)) -> mark#(cons(X,from(s(X)))) p6: active#(from(X)) -> cons#(X,from(s(X))) p7: active#(from(X)) -> from#(s(X)) p8: active#(from(X)) -> s#(X) p9: mark#(first(X1,X2)) -> active#(first(mark(X1),mark(X2))) p10: mark#(first(X1,X2)) -> first#(mark(X1),mark(X2)) p11: mark#(first(X1,X2)) -> mark#(X1) p12: mark#(first(X1,X2)) -> mark#(X2) p13: mark#(|0|()) -> active#(|0|()) p14: mark#(nil()) -> active#(nil()) p15: mark#(s(X)) -> active#(s(mark(X))) p16: mark#(s(X)) -> s#(mark(X)) p17: mark#(s(X)) -> mark#(X) p18: mark#(cons(X1,X2)) -> active#(cons(mark(X1),X2)) p19: mark#(cons(X1,X2)) -> cons#(mark(X1),X2) p20: mark#(cons(X1,X2)) -> mark#(X1) p21: mark#(from(X)) -> active#(from(mark(X))) p22: mark#(from(X)) -> from#(mark(X)) p23: mark#(from(X)) -> mark#(X) p24: first#(mark(X1),X2) -> first#(X1,X2) p25: first#(X1,mark(X2)) -> first#(X1,X2) p26: first#(active(X1),X2) -> first#(X1,X2) p27: first#(X1,active(X2)) -> first#(X1,X2) p28: s#(mark(X)) -> s#(X) p29: s#(active(X)) -> s#(X) p30: cons#(mark(X1),X2) -> cons#(X1,X2) p31: cons#(X1,mark(X2)) -> cons#(X1,X2) p32: cons#(active(X1),X2) -> cons#(X1,X2) p33: cons#(X1,active(X2)) -> cons#(X1,X2) p34: from#(mark(X)) -> from#(X) p35: from#(active(X)) -> from#(X) and R consists of: r1: active(first(|0|(),X)) -> mark(nil()) r2: active(first(s(X),cons(Y,Z))) -> mark(cons(Y,first(X,Z))) r3: active(from(X)) -> mark(cons(X,from(s(X)))) r4: mark(first(X1,X2)) -> active(first(mark(X1),mark(X2))) r5: mark(|0|()) -> active(|0|()) r6: mark(nil()) -> active(nil()) r7: mark(s(X)) -> active(s(mark(X))) r8: mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) r9: mark(from(X)) -> active(from(mark(X))) r10: first(mark(X1),X2) -> first(X1,X2) r11: first(X1,mark(X2)) -> first(X1,X2) r12: first(active(X1),X2) -> first(X1,X2) r13: first(X1,active(X2)) -> first(X1,X2) r14: s(mark(X)) -> s(X) r15: s(active(X)) -> s(X) r16: cons(mark(X1),X2) -> cons(X1,X2) r17: cons(X1,mark(X2)) -> cons(X1,X2) r18: cons(active(X1),X2) -> cons(X1,X2) r19: cons(X1,active(X2)) -> cons(X1,X2) r20: from(mark(X)) -> from(X) r21: from(active(X)) -> from(X) The estimated dependency graph contains the following SCCs: {p2, p5, p9, p11, p12, p15, p17, p18, p20, p21, p23} {p30, p31, p32, p33} {p24, p25, p26, p27} {p34, p35} {p28, p29} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: mark#(from(X)) -> active#(from(mark(X))) p2: active#(from(X)) -> mark#(cons(X,from(s(X)))) p3: mark#(from(X)) -> mark#(X) p4: mark#(cons(X1,X2)) -> mark#(X1) p5: mark#(cons(X1,X2)) -> active#(cons(mark(X1),X2)) p6: active#(first(s(X),cons(Y,Z))) -> mark#(cons(Y,first(X,Z))) p7: mark#(s(X)) -> mark#(X) p8: mark#(s(X)) -> active#(s(mark(X))) p9: mark#(first(X1,X2)) -> mark#(X2) p10: mark#(first(X1,X2)) -> mark#(X1) p11: mark#(first(X1,X2)) -> active#(first(mark(X1),mark(X2))) and R consists of: r1: active(first(|0|(),X)) -> mark(nil()) r2: active(first(s(X),cons(Y,Z))) -> mark(cons(Y,first(X,Z))) r3: active(from(X)) -> mark(cons(X,from(s(X)))) r4: mark(first(X1,X2)) -> active(first(mark(X1),mark(X2))) r5: mark(|0|()) -> active(|0|()) r6: mark(nil()) -> active(nil()) r7: mark(s(X)) -> active(s(mark(X))) r8: mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) r9: mark(from(X)) -> active(from(mark(X))) r10: first(mark(X1),X2) -> first(X1,X2) r11: first(X1,mark(X2)) -> first(X1,X2) r12: first(active(X1),X2) -> first(X1,X2) r13: first(X1,active(X2)) -> first(X1,X2) r14: s(mark(X)) -> s(X) r15: s(active(X)) -> s(X) r16: cons(mark(X1),X2) -> cons(X1,X2) r17: cons(X1,mark(X2)) -> cons(X1,X2) r18: cons(active(X1),X2) -> cons(X1,X2) r19: cons(X1,active(X2)) -> cons(X1,X2) r20: from(mark(X)) -> from(X) r21: from(active(X)) -> from(X) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: mark#_A(x1) = x1 + 14 from_A(x1) = max{20, x1 + 19} active#_A(x1) = max{21, x1 + 14} mark_A(x1) = x1 cons_A(x1,x2) = max{x1 + 13, x2 - 17} s_A(x1) = max{18, x1 + 14} first_A(x1,x2) = max{x1 + 7, x2 + 7} active_A(x1) = max{4, x1} |0|_A = 5 nil_A = 5 precedence: from = mark = active = |0| = nil > cons = first > mark# = active# = s partial status: pi(mark#) = [] pi(from) = [] pi(active#) = [] pi(mark) = [] pi(cons) = [] pi(s) = [1] pi(first) = [1] pi(active) = [] pi(|0|) = [] pi(nil) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: mark#_A(x1) = 147 from_A(x1) = 235 active#_A(x1) = 147 mark_A(x1) = 140 cons_A(x1,x2) = 89 s_A(x1) = 141 first_A(x1,x2) = 143 active_A(x1) = 140 |0|_A = 121 nil_A = 144 precedence: from = mark = cons = s = first = active = |0| = nil > mark# = active# partial status: pi(mark#) = [] pi(from) = [] pi(active#) = [] pi(mark) = [] pi(cons) = [] pi(s) = [] pi(first) = [] pi(active) = [] pi(|0|) = [] pi(nil) = [] The next rules are strictly ordered: p10 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: mark#(from(X)) -> active#(from(mark(X))) p2: active#(from(X)) -> mark#(cons(X,from(s(X)))) p3: mark#(from(X)) -> mark#(X) p4: mark#(cons(X1,X2)) -> mark#(X1) p5: mark#(cons(X1,X2)) -> active#(cons(mark(X1),X2)) p6: active#(first(s(X),cons(Y,Z))) -> mark#(cons(Y,first(X,Z))) p7: mark#(s(X)) -> mark#(X) p8: mark#(s(X)) -> active#(s(mark(X))) p9: mark#(first(X1,X2)) -> mark#(X2) p10: mark#(first(X1,X2)) -> active#(first(mark(X1),mark(X2))) and R consists of: r1: active(first(|0|(),X)) -> mark(nil()) r2: active(first(s(X),cons(Y,Z))) -> mark(cons(Y,first(X,Z))) r3: active(from(X)) -> mark(cons(X,from(s(X)))) r4: mark(first(X1,X2)) -> active(first(mark(X1),mark(X2))) r5: mark(|0|()) -> active(|0|()) r6: mark(nil()) -> active(nil()) r7: mark(s(X)) -> active(s(mark(X))) r8: mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) r9: mark(from(X)) -> active(from(mark(X))) r10: first(mark(X1),X2) -> first(X1,X2) r11: first(X1,mark(X2)) -> first(X1,X2) r12: first(active(X1),X2) -> first(X1,X2) r13: first(X1,active(X2)) -> first(X1,X2) r14: s(mark(X)) -> s(X) r15: s(active(X)) -> s(X) r16: cons(mark(X1),X2) -> cons(X1,X2) r17: cons(X1,mark(X2)) -> cons(X1,X2) r18: cons(active(X1),X2) -> cons(X1,X2) r19: cons(X1,active(X2)) -> cons(X1,X2) r20: from(mark(X)) -> from(X) r21: from(active(X)) -> from(X) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4, p5, p6, p7, p8, p9, p10} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: mark#(from(X)) -> active#(from(mark(X))) p2: active#(first(s(X),cons(Y,Z))) -> mark#(cons(Y,first(X,Z))) p3: mark#(first(X1,X2)) -> active#(first(mark(X1),mark(X2))) p4: active#(from(X)) -> mark#(cons(X,from(s(X)))) p5: mark#(first(X1,X2)) -> mark#(X2) p6: mark#(s(X)) -> active#(s(mark(X))) p7: mark#(s(X)) -> mark#(X) p8: mark#(cons(X1,X2)) -> active#(cons(mark(X1),X2)) p9: mark#(cons(X1,X2)) -> mark#(X1) p10: mark#(from(X)) -> mark#(X) and R consists of: r1: active(first(|0|(),X)) -> mark(nil()) r2: active(first(s(X),cons(Y,Z))) -> mark(cons(Y,first(X,Z))) r3: active(from(X)) -> mark(cons(X,from(s(X)))) r4: mark(first(X1,X2)) -> active(first(mark(X1),mark(X2))) r5: mark(|0|()) -> active(|0|()) r6: mark(nil()) -> active(nil()) r7: mark(s(X)) -> active(s(mark(X))) r8: mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) r9: mark(from(X)) -> active(from(mark(X))) r10: first(mark(X1),X2) -> first(X1,X2) r11: first(X1,mark(X2)) -> first(X1,X2) r12: first(active(X1),X2) -> first(X1,X2) r13: first(X1,active(X2)) -> first(X1,X2) r14: s(mark(X)) -> s(X) r15: s(active(X)) -> s(X) r16: cons(mark(X1),X2) -> cons(X1,X2) r17: cons(X1,mark(X2)) -> cons(X1,X2) r18: cons(active(X1),X2) -> cons(X1,X2) r19: cons(X1,active(X2)) -> cons(X1,X2) r20: from(mark(X)) -> from(X) r21: from(active(X)) -> from(X) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21 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{2, x1} from_A(x1) = max{9, x1 + 5} active#_A(x1) = x1 mark_A(x1) = max{1, x1} first_A(x1,x2) = max{10, x1 + 3, x2 + 5} s_A(x1) = max{4, x1} cons_A(x1,x2) = max{4, x1 + 3, x2} active_A(x1) = max{4, x1} |0|_A = 5 nil_A = 4 precedence: |0| > from = first > mark# = mark > s = active = nil > active# = cons partial status: pi(mark#) = [1] pi(from) = [] pi(active#) = [1] pi(mark) = [1] pi(first) = [] pi(s) = [1] pi(cons) = [] pi(active) = [1] pi(|0|) = [] pi(nil) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: mark#_A(x1) = 159 from_A(x1) = 179 active#_A(x1) = max{151, x1 + 6} mark_A(x1) = max{160, x1 + 8} first_A(x1,x2) = 179 s_A(x1) = 152 cons_A(x1,x2) = 78 active_A(x1) = max{160, x1 - 19} |0|_A = 0 nil_A = 180 precedence: from > mark = s = active = nil > mark# = active# = |0| > first = cons partial status: pi(mark#) = [] pi(from) = [] pi(active#) = [1] pi(mark) = [] pi(first) = [] pi(s) = [] pi(cons) = [] pi(active) = [] pi(|0|) = [] pi(nil) = [] The next rules are strictly ordered: p1, p2, p3, p4 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: mark#(first(X1,X2)) -> mark#(X2) p2: mark#(s(X)) -> active#(s(mark(X))) p3: mark#(s(X)) -> mark#(X) p4: mark#(cons(X1,X2)) -> active#(cons(mark(X1),X2)) p5: mark#(cons(X1,X2)) -> mark#(X1) p6: mark#(from(X)) -> mark#(X) and R consists of: r1: active(first(|0|(),X)) -> mark(nil()) r2: active(first(s(X),cons(Y,Z))) -> mark(cons(Y,first(X,Z))) r3: active(from(X)) -> mark(cons(X,from(s(X)))) r4: mark(first(X1,X2)) -> active(first(mark(X1),mark(X2))) r5: mark(|0|()) -> active(|0|()) r6: mark(nil()) -> active(nil()) r7: mark(s(X)) -> active(s(mark(X))) r8: mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) r9: mark(from(X)) -> active(from(mark(X))) r10: first(mark(X1),X2) -> first(X1,X2) r11: first(X1,mark(X2)) -> first(X1,X2) r12: first(active(X1),X2) -> first(X1,X2) r13: first(X1,active(X2)) -> first(X1,X2) r14: s(mark(X)) -> s(X) r15: s(active(X)) -> s(X) r16: cons(mark(X1),X2) -> cons(X1,X2) r17: cons(X1,mark(X2)) -> cons(X1,X2) r18: cons(active(X1),X2) -> cons(X1,X2) r19: cons(X1,active(X2)) -> cons(X1,X2) r20: from(mark(X)) -> from(X) r21: from(active(X)) -> from(X) The estimated dependency graph contains the following SCCs: {p1, p3, p5, p6} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: mark#(first(X1,X2)) -> mark#(X2) p2: mark#(from(X)) -> mark#(X) p3: mark#(cons(X1,X2)) -> mark#(X1) p4: mark#(s(X)) -> mark#(X) and R consists of: r1: active(first(|0|(),X)) -> mark(nil()) r2: active(first(s(X),cons(Y,Z))) -> mark(cons(Y,first(X,Z))) r3: active(from(X)) -> mark(cons(X,from(s(X)))) r4: mark(first(X1,X2)) -> active(first(mark(X1),mark(X2))) r5: mark(|0|()) -> active(|0|()) r6: mark(nil()) -> active(nil()) r7: mark(s(X)) -> active(s(mark(X))) r8: mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) r9: mark(from(X)) -> active(from(mark(X))) r10: first(mark(X1),X2) -> first(X1,X2) r11: first(X1,mark(X2)) -> first(X1,X2) r12: first(active(X1),X2) -> first(X1,X2) r13: first(X1,active(X2)) -> first(X1,X2) r14: s(mark(X)) -> s(X) r15: s(active(X)) -> s(X) r16: cons(mark(X1),X2) -> cons(X1,X2) r17: cons(X1,mark(X2)) -> cons(X1,X2) r18: cons(active(X1),X2) -> cons(X1,X2) r19: cons(X1,active(X2)) -> cons(X1,X2) r20: from(mark(X)) -> from(X) r21: from(active(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: max/plus interpretations on natural numbers: mark#_A(x1) = max{3, x1 + 2} first_A(x1,x2) = max{1, x2} from_A(x1) = max{1, x1} cons_A(x1,x2) = max{x1, x2} s_A(x1) = max{1, x1} precedence: mark# = first = from = cons = s partial status: pi(mark#) = [1] pi(first) = [2] pi(from) = [1] pi(cons) = [1, 2] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: mark#_A(x1) = x1 + 2 first_A(x1,x2) = x2 from_A(x1) = x1 cons_A(x1,x2) = max{x1, x2} s_A(x1) = x1 precedence: mark# = first = from = cons = s partial status: pi(mark#) = [1] pi(first) = [2] pi(from) = [1] pi(cons) = [1, 2] pi(s) = [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: 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(first(|0|(),X)) -> mark(nil()) r2: active(first(s(X),cons(Y,Z))) -> mark(cons(Y,first(X,Z))) r3: active(from(X)) -> mark(cons(X,from(s(X)))) r4: mark(first(X1,X2)) -> active(first(mark(X1),mark(X2))) r5: mark(|0|()) -> active(|0|()) r6: mark(nil()) -> active(nil()) r7: mark(s(X)) -> active(s(mark(X))) r8: mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) r9: mark(from(X)) -> active(from(mark(X))) r10: first(mark(X1),X2) -> first(X1,X2) r11: first(X1,mark(X2)) -> first(X1,X2) r12: first(active(X1),X2) -> first(X1,X2) r13: first(X1,active(X2)) -> first(X1,X2) r14: s(mark(X)) -> s(X) r15: s(active(X)) -> s(X) r16: cons(mark(X1),X2) -> cons(X1,X2) r17: cons(X1,mark(X2)) -> cons(X1,X2) r18: cons(active(X1),X2) -> cons(X1,X2) r19: cons(X1,active(X2)) -> cons(X1,X2) r20: from(mark(X)) -> from(X) r21: from(active(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: 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: first#(mark(X1),X2) -> first#(X1,X2) p2: first#(X1,active(X2)) -> first#(X1,X2) p3: first#(active(X1),X2) -> first#(X1,X2) p4: first#(X1,mark(X2)) -> first#(X1,X2) and R consists of: r1: active(first(|0|(),X)) -> mark(nil()) r2: active(first(s(X),cons(Y,Z))) -> mark(cons(Y,first(X,Z))) r3: active(from(X)) -> mark(cons(X,from(s(X)))) r4: mark(first(X1,X2)) -> active(first(mark(X1),mark(X2))) r5: mark(|0|()) -> active(|0|()) r6: mark(nil()) -> active(nil()) r7: mark(s(X)) -> active(s(mark(X))) r8: mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) r9: mark(from(X)) -> active(from(mark(X))) r10: first(mark(X1),X2) -> first(X1,X2) r11: first(X1,mark(X2)) -> first(X1,X2) r12: first(active(X1),X2) -> first(X1,X2) r13: first(X1,active(X2)) -> first(X1,X2) r14: s(mark(X)) -> s(X) r15: s(active(X)) -> s(X) r16: cons(mark(X1),X2) -> cons(X1,X2) r17: cons(X1,mark(X2)) -> cons(X1,X2) r18: cons(active(X1),X2) -> cons(X1,X2) r19: cons(X1,active(X2)) -> cons(X1,X2) r20: from(mark(X)) -> from(X) r21: from(active(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: max/plus interpretations on natural numbers: first#_A(x1,x2) = max{2, x1 + 1, x2 + 1} mark_A(x1) = max{1, x1} active_A(x1) = max{1, x1} precedence: first# = mark = active partial status: pi(first#) = [1, 2] pi(mark) = [1] pi(active) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: first#_A(x1,x2) = max{x1 + 1, x2 - 1} mark_A(x1) = x1 active_A(x1) = x1 precedence: first# = mark = active partial status: pi(first#) = [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(first(|0|(),X)) -> mark(nil()) r2: active(first(s(X),cons(Y,Z))) -> mark(cons(Y,first(X,Z))) r3: active(from(X)) -> mark(cons(X,from(s(X)))) r4: mark(first(X1,X2)) -> active(first(mark(X1),mark(X2))) r5: mark(|0|()) -> active(|0|()) r6: mark(nil()) -> active(nil()) r7: mark(s(X)) -> active(s(mark(X))) r8: mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) r9: mark(from(X)) -> active(from(mark(X))) r10: first(mark(X1),X2) -> first(X1,X2) r11: first(X1,mark(X2)) -> first(X1,X2) r12: first(active(X1),X2) -> first(X1,X2) r13: first(X1,active(X2)) -> first(X1,X2) r14: s(mark(X)) -> s(X) r15: s(active(X)) -> s(X) r16: cons(mark(X1),X2) -> cons(X1,X2) r17: cons(X1,mark(X2)) -> cons(X1,X2) r18: cons(active(X1),X2) -> cons(X1,X2) r19: cons(X1,active(X2)) -> cons(X1,X2) r20: from(mark(X)) -> from(X) r21: from(active(X)) -> from(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(first(|0|(),X)) -> mark(nil()) r2: active(first(s(X),cons(Y,Z))) -> mark(cons(Y,first(X,Z))) r3: active(from(X)) -> mark(cons(X,from(s(X)))) r4: mark(first(X1,X2)) -> active(first(mark(X1),mark(X2))) r5: mark(|0|()) -> active(|0|()) r6: mark(nil()) -> active(nil()) r7: mark(s(X)) -> active(s(mark(X))) r8: mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) r9: mark(from(X)) -> active(from(mark(X))) r10: first(mark(X1),X2) -> first(X1,X2) r11: first(X1,mark(X2)) -> first(X1,X2) r12: first(active(X1),X2) -> first(X1,X2) r13: first(X1,active(X2)) -> first(X1,X2) r14: s(mark(X)) -> s(X) r15: s(active(X)) -> s(X) r16: cons(mark(X1),X2) -> cons(X1,X2) r17: cons(X1,mark(X2)) -> cons(X1,X2) r18: cons(active(X1),X2) -> cons(X1,X2) r19: cons(X1,active(X2)) -> cons(X1,X2) r20: from(mark(X)) -> from(X) r21: from(active(X)) -> from(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.