YES We show the termination of the TRS R: a__fst(|0|(),Z) -> nil() a__fst(s(X),cons(Y,Z)) -> cons(mark(Y),fst(X,Z)) a__from(X) -> cons(mark(X),from(s(X))) a__add(|0|(),X) -> mark(X) a__add(s(X),Y) -> s(add(X,Y)) a__len(nil()) -> |0|() a__len(cons(X,Z)) -> s(len(Z)) mark(fst(X1,X2)) -> a__fst(mark(X1),mark(X2)) mark(from(X)) -> a__from(mark(X)) mark(add(X1,X2)) -> a__add(mark(X1),mark(X2)) mark(len(X)) -> a__len(mark(X)) mark(|0|()) -> |0|() mark(s(X)) -> s(X) mark(nil()) -> nil() mark(cons(X1,X2)) -> cons(mark(X1),X2) a__fst(X1,X2) -> fst(X1,X2) a__from(X) -> from(X) a__add(X1,X2) -> add(X1,X2) a__len(X) -> len(X) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: a__fst#(s(X),cons(Y,Z)) -> mark#(Y) p2: a__from#(X) -> mark#(X) p3: a__add#(|0|(),X) -> mark#(X) p4: mark#(fst(X1,X2)) -> a__fst#(mark(X1),mark(X2)) p5: mark#(fst(X1,X2)) -> mark#(X1) p6: mark#(fst(X1,X2)) -> mark#(X2) p7: mark#(from(X)) -> a__from#(mark(X)) p8: mark#(from(X)) -> mark#(X) p9: mark#(add(X1,X2)) -> a__add#(mark(X1),mark(X2)) p10: mark#(add(X1,X2)) -> mark#(X1) p11: mark#(add(X1,X2)) -> mark#(X2) p12: mark#(len(X)) -> a__len#(mark(X)) p13: mark#(len(X)) -> mark#(X) p14: mark#(cons(X1,X2)) -> mark#(X1) and R consists of: r1: a__fst(|0|(),Z) -> nil() r2: a__fst(s(X),cons(Y,Z)) -> cons(mark(Y),fst(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: a__add(|0|(),X) -> mark(X) r5: a__add(s(X),Y) -> s(add(X,Y)) r6: a__len(nil()) -> |0|() r7: a__len(cons(X,Z)) -> s(len(Z)) r8: mark(fst(X1,X2)) -> a__fst(mark(X1),mark(X2)) r9: mark(from(X)) -> a__from(mark(X)) r10: mark(add(X1,X2)) -> a__add(mark(X1),mark(X2)) r11: mark(len(X)) -> a__len(mark(X)) r12: mark(|0|()) -> |0|() r13: mark(s(X)) -> s(X) r14: mark(nil()) -> nil() r15: mark(cons(X1,X2)) -> cons(mark(X1),X2) r16: a__fst(X1,X2) -> fst(X1,X2) r17: a__from(X) -> from(X) r18: a__add(X1,X2) -> add(X1,X2) r19: a__len(X) -> len(X) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p13, p14} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: a__fst#(s(X),cons(Y,Z)) -> mark#(Y) p2: mark#(cons(X1,X2)) -> mark#(X1) p3: mark#(len(X)) -> mark#(X) p4: mark#(add(X1,X2)) -> mark#(X2) p5: mark#(add(X1,X2)) -> mark#(X1) p6: mark#(add(X1,X2)) -> a__add#(mark(X1),mark(X2)) p7: a__add#(|0|(),X) -> mark#(X) p8: mark#(from(X)) -> mark#(X) p9: mark#(from(X)) -> a__from#(mark(X)) p10: a__from#(X) -> mark#(X) p11: mark#(fst(X1,X2)) -> mark#(X2) p12: mark#(fst(X1,X2)) -> mark#(X1) p13: mark#(fst(X1,X2)) -> a__fst#(mark(X1),mark(X2)) and R consists of: r1: a__fst(|0|(),Z) -> nil() r2: a__fst(s(X),cons(Y,Z)) -> cons(mark(Y),fst(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: a__add(|0|(),X) -> mark(X) r5: a__add(s(X),Y) -> s(add(X,Y)) r6: a__len(nil()) -> |0|() r7: a__len(cons(X,Z)) -> s(len(Z)) r8: mark(fst(X1,X2)) -> a__fst(mark(X1),mark(X2)) r9: mark(from(X)) -> a__from(mark(X)) r10: mark(add(X1,X2)) -> a__add(mark(X1),mark(X2)) r11: mark(len(X)) -> a__len(mark(X)) r12: mark(|0|()) -> |0|() r13: mark(s(X)) -> s(X) r14: mark(nil()) -> nil() r15: mark(cons(X1,X2)) -> cons(mark(X1),X2) r16: a__fst(X1,X2) -> fst(X1,X2) r17: a__from(X) -> from(X) r18: a__add(X1,X2) -> add(X1,X2) r19: a__len(X) -> len(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 Take the reduction pair: matrix interpretations: carrier: N^3 order: lexicographic order interpretations: a__fst#_A(x1,x2) = ((1,0,0),(1,1,0),(0,0,1)) x2 s_A(x1) = (1,2,2) cons_A(x1,x2) = ((1,0,0),(0,0,0),(1,0,0)) x1 + ((0,0,0),(0,0,0),(1,0,0)) x2 + (2,1,5) mark#_A(x1) = x1 + (1,3,5) len_A(x1) = ((1,0,0),(0,0,0),(1,0,0)) x1 + (0,1,0) add_A(x1,x2) = x1 + x2 + (0,1,1) a__add#_A(x1,x2) = x2 + (1,3,5) mark_A(x1) = x1 + (0,3,4) |0|_A() = (1,0,5) from_A(x1) = x1 + (3,1,1) a__from#_A(x1) = ((1,0,0),(1,0,0),(0,0,0)) x1 + (2,2,5) fst_A(x1,x2) = ((1,0,0),(0,0,0),(0,1,0)) x1 + x2 + (0,1,1) a__fst_A(x1,x2) = x1 + x2 + (0,2,2) nil_A() = (1,0,3) a__from_A(x1) = x1 + (3,2,3) a__add_A(x1,x2) = x1 + x2 + (0,2,2) a__len_A(x1) = ((1,0,0),(0,0,0),(1,0,0)) x1 + (0,1,5) The next rules are strictly ordered: p1, p2, p8, p9, p10, p13 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: mark#(len(X)) -> mark#(X) p2: mark#(add(X1,X2)) -> mark#(X2) p3: mark#(add(X1,X2)) -> mark#(X1) p4: mark#(add(X1,X2)) -> a__add#(mark(X1),mark(X2)) p5: a__add#(|0|(),X) -> mark#(X) p6: mark#(fst(X1,X2)) -> mark#(X2) p7: mark#(fst(X1,X2)) -> mark#(X1) and R consists of: r1: a__fst(|0|(),Z) -> nil() r2: a__fst(s(X),cons(Y,Z)) -> cons(mark(Y),fst(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: a__add(|0|(),X) -> mark(X) r5: a__add(s(X),Y) -> s(add(X,Y)) r6: a__len(nil()) -> |0|() r7: a__len(cons(X,Z)) -> s(len(Z)) r8: mark(fst(X1,X2)) -> a__fst(mark(X1),mark(X2)) r9: mark(from(X)) -> a__from(mark(X)) r10: mark(add(X1,X2)) -> a__add(mark(X1),mark(X2)) r11: mark(len(X)) -> a__len(mark(X)) r12: mark(|0|()) -> |0|() r13: mark(s(X)) -> s(X) r14: mark(nil()) -> nil() r15: mark(cons(X1,X2)) -> cons(mark(X1),X2) r16: a__fst(X1,X2) -> fst(X1,X2) r17: a__from(X) -> from(X) r18: a__add(X1,X2) -> add(X1,X2) r19: a__len(X) -> len(X) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4, p5, p6, p7} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: mark#(len(X)) -> mark#(X) p2: mark#(fst(X1,X2)) -> mark#(X1) p3: mark#(fst(X1,X2)) -> mark#(X2) p4: mark#(add(X1,X2)) -> a__add#(mark(X1),mark(X2)) p5: a__add#(|0|(),X) -> mark#(X) p6: mark#(add(X1,X2)) -> mark#(X1) p7: mark#(add(X1,X2)) -> mark#(X2) and R consists of: r1: a__fst(|0|(),Z) -> nil() r2: a__fst(s(X),cons(Y,Z)) -> cons(mark(Y),fst(X,Z)) r3: a__from(X) -> cons(mark(X),from(s(X))) r4: a__add(|0|(),X) -> mark(X) r5: a__add(s(X),Y) -> s(add(X,Y)) r6: a__len(nil()) -> |0|() r7: a__len(cons(X,Z)) -> s(len(Z)) r8: mark(fst(X1,X2)) -> a__fst(mark(X1),mark(X2)) r9: mark(from(X)) -> a__from(mark(X)) r10: mark(add(X1,X2)) -> a__add(mark(X1),mark(X2)) r11: mark(len(X)) -> a__len(mark(X)) r12: mark(|0|()) -> |0|() r13: mark(s(X)) -> s(X) r14: mark(nil()) -> nil() r15: mark(cons(X1,X2)) -> cons(mark(X1),X2) r16: a__fst(X1,X2) -> fst(X1,X2) r17: a__from(X) -> from(X) r18: a__add(X1,X2) -> add(X1,X2) r19: a__len(X) -> len(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 Take the reduction pair: matrix interpretations: carrier: N^3 order: lexicographic order interpretations: mark#_A(x1) = ((1,0,0),(1,1,0),(1,1,1)) x1 + (0,0,8) len_A(x1) = ((1,0,0),(0,1,0),(1,1,1)) x1 + (2,1,1) fst_A(x1,x2) = x1 + x2 + (2,1,1) add_A(x1,x2) = ((1,0,0),(1,0,0),(1,1,0)) x1 + ((1,0,0),(1,0,0),(1,1,0)) x2 + (2,4,1) a__add#_A(x1,x2) = ((0,0,0),(1,0,0),(0,1,0)) x1 + ((1,0,0),(1,0,0),(0,0,0)) x2 + (1,5,0) mark_A(x1) = ((1,0,0),(1,1,0),(1,0,1)) x1 + (0,0,11) |0|_A() = (1,7,9) a__fst_A(x1,x2) = x1 + x2 + (2,2,2) nil_A() = (1,3,3) s_A(x1) = (1,4,6) cons_A(x1,x2) = (0,0,3) a__from_A(x1) = (0,1,4) from_A(x1) = (0,1,1) a__add_A(x1,x2) = ((1,0,0),(1,0,0),(1,1,0)) x1 + ((1,0,0),(1,0,0),(1,1,0)) x2 + (2,4,2) a__len_A(x1) = ((1,0,0),(0,1,0),(0,1,1)) x1 + (2,3,2) The next rules are strictly ordered: p1, p2, p3, p4, p5, p6, p7 We remove them from the problem. Then no dependency pair remains.