YES We show the termination of the TRS R: a__and(true(),X) -> mark(X) a__and(false(),Y) -> false() a__if(true(),X,Y) -> mark(X) a__if(false(),X,Y) -> mark(Y) a__add(|0|(),X) -> mark(X) a__add(s(X),Y) -> s(add(X,Y)) a__first(|0|(),X) -> nil() a__first(s(X),cons(Y,Z)) -> cons(Y,first(X,Z)) a__from(X) -> cons(X,from(s(X))) mark(and(X1,X2)) -> a__and(mark(X1),X2) mark(if(X1,X2,X3)) -> a__if(mark(X1),X2,X3) mark(add(X1,X2)) -> a__add(mark(X1),X2) mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) mark(from(X)) -> a__from(X) mark(true()) -> true() mark(false()) -> false() mark(|0|()) -> |0|() mark(s(X)) -> s(X) mark(nil()) -> nil() mark(cons(X1,X2)) -> cons(X1,X2) a__and(X1,X2) -> and(X1,X2) a__if(X1,X2,X3) -> if(X1,X2,X3) a__add(X1,X2) -> add(X1,X2) a__first(X1,X2) -> first(X1,X2) a__from(X) -> from(X) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: a__and#(true(),X) -> mark#(X) p2: a__if#(true(),X,Y) -> mark#(X) p3: a__if#(false(),X,Y) -> mark#(Y) p4: a__add#(|0|(),X) -> mark#(X) p5: mark#(and(X1,X2)) -> a__and#(mark(X1),X2) p6: mark#(and(X1,X2)) -> mark#(X1) p7: mark#(if(X1,X2,X3)) -> a__if#(mark(X1),X2,X3) p8: mark#(if(X1,X2,X3)) -> mark#(X1) p9: mark#(add(X1,X2)) -> a__add#(mark(X1),X2) p10: mark#(add(X1,X2)) -> mark#(X1) p11: mark#(first(X1,X2)) -> a__first#(mark(X1),mark(X2)) p12: mark#(first(X1,X2)) -> mark#(X1) p13: mark#(first(X1,X2)) -> mark#(X2) p14: mark#(from(X)) -> a__from#(X) and R consists of: r1: a__and(true(),X) -> mark(X) r2: a__and(false(),Y) -> false() r3: a__if(true(),X,Y) -> mark(X) r4: a__if(false(),X,Y) -> mark(Y) r5: a__add(|0|(),X) -> mark(X) r6: a__add(s(X),Y) -> s(add(X,Y)) r7: a__first(|0|(),X) -> nil() r8: a__first(s(X),cons(Y,Z)) -> cons(Y,first(X,Z)) r9: a__from(X) -> cons(X,from(s(X))) r10: mark(and(X1,X2)) -> a__and(mark(X1),X2) r11: mark(if(X1,X2,X3)) -> a__if(mark(X1),X2,X3) r12: mark(add(X1,X2)) -> a__add(mark(X1),X2) r13: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r14: mark(from(X)) -> a__from(X) r15: mark(true()) -> true() r16: mark(false()) -> false() r17: mark(|0|()) -> |0|() r18: mark(s(X)) -> s(X) r19: mark(nil()) -> nil() r20: mark(cons(X1,X2)) -> cons(X1,X2) r21: a__and(X1,X2) -> and(X1,X2) r22: a__if(X1,X2,X3) -> if(X1,X2,X3) r23: a__add(X1,X2) -> add(X1,X2) r24: a__first(X1,X2) -> first(X1,X2) r25: a__from(X) -> from(X) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p12, p13} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: a__and#(true(),X) -> mark#(X) p2: mark#(first(X1,X2)) -> mark#(X2) p3: mark#(first(X1,X2)) -> mark#(X1) p4: mark#(add(X1,X2)) -> mark#(X1) p5: mark#(add(X1,X2)) -> a__add#(mark(X1),X2) p6: a__add#(|0|(),X) -> mark#(X) p7: mark#(if(X1,X2,X3)) -> mark#(X1) p8: mark#(if(X1,X2,X3)) -> a__if#(mark(X1),X2,X3) p9: a__if#(false(),X,Y) -> mark#(Y) p10: mark#(and(X1,X2)) -> mark#(X1) p11: mark#(and(X1,X2)) -> a__and#(mark(X1),X2) p12: a__if#(true(),X,Y) -> mark#(X) and R consists of: r1: a__and(true(),X) -> mark(X) r2: a__and(false(),Y) -> false() r3: a__if(true(),X,Y) -> mark(X) r4: a__if(false(),X,Y) -> mark(Y) r5: a__add(|0|(),X) -> mark(X) r6: a__add(s(X),Y) -> s(add(X,Y)) r7: a__first(|0|(),X) -> nil() r8: a__first(s(X),cons(Y,Z)) -> cons(Y,first(X,Z)) r9: a__from(X) -> cons(X,from(s(X))) r10: mark(and(X1,X2)) -> a__and(mark(X1),X2) r11: mark(if(X1,X2,X3)) -> a__if(mark(X1),X2,X3) r12: mark(add(X1,X2)) -> a__add(mark(X1),X2) r13: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r14: mark(from(X)) -> a__from(X) r15: mark(true()) -> true() r16: mark(false()) -> false() r17: mark(|0|()) -> |0|() r18: mark(s(X)) -> s(X) r19: mark(nil()) -> nil() r20: mark(cons(X1,X2)) -> cons(X1,X2) r21: a__and(X1,X2) -> and(X1,X2) r22: a__if(X1,X2,X3) -> if(X1,X2,X3) r23: a__add(X1,X2) -> add(X1,X2) r24: a__first(X1,X2) -> first(X1,X2) r25: a__from(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, r22, r23, r24, r25 Take the reduction pair: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: a__and#_A(x1,x2) = x2 + (2,3) true_A() = (1,1) mark#_A(x1) = ((1,0),(1,1)) x1 first_A(x1,x2) = ((1,0),(1,1)) x1 + ((1,0),(1,1)) x2 + (3,1) add_A(x1,x2) = ((1,0),(1,1)) x1 + x2 + (2,1) a__add#_A(x1,x2) = ((1,0),(1,1)) x2 + (1,2) mark_A(x1) = ((1,0),(1,1)) x1 + (0,1) |0|_A() = (0,0) if_A(x1,x2,x3) = x1 + ((1,0),(1,1)) x2 + ((1,0),(1,1)) x3 + (2,1) a__if#_A(x1,x2,x3) = ((1,0),(1,1)) x2 + ((1,0),(1,1)) x3 + (1,2) false_A() = (1,1) and_A(x1,x2) = ((1,0),(1,1)) x1 + x2 + (2,1) a__and_A(x1,x2) = ((1,0),(1,1)) x1 + x2 + (2,2) a__if_A(x1,x2,x3) = x1 + ((1,0),(1,1)) x2 + ((1,0),(1,1)) x3 + (2,2) a__add_A(x1,x2) = ((1,0),(1,1)) x1 + x2 + (2,3) s_A(x1) = (0,1) a__first_A(x1,x2) = ((1,0),(1,1)) x1 + ((1,0),(1,1)) x2 + (3,2) nil_A() = (1,3) cons_A(x1,x2) = x1 + (1,2) a__from_A(x1) = x1 + (2,2) from_A(x1) = x1 + (2,1) The next rules are strictly ordered: p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p12 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: mark#(and(X1,X2)) -> a__and#(mark(X1),X2) and R consists of: r1: a__and(true(),X) -> mark(X) r2: a__and(false(),Y) -> false() r3: a__if(true(),X,Y) -> mark(X) r4: a__if(false(),X,Y) -> mark(Y) r5: a__add(|0|(),X) -> mark(X) r6: a__add(s(X),Y) -> s(add(X,Y)) r7: a__first(|0|(),X) -> nil() r8: a__first(s(X),cons(Y,Z)) -> cons(Y,first(X,Z)) r9: a__from(X) -> cons(X,from(s(X))) r10: mark(and(X1,X2)) -> a__and(mark(X1),X2) r11: mark(if(X1,X2,X3)) -> a__if(mark(X1),X2,X3) r12: mark(add(X1,X2)) -> a__add(mark(X1),X2) r13: mark(first(X1,X2)) -> a__first(mark(X1),mark(X2)) r14: mark(from(X)) -> a__from(X) r15: mark(true()) -> true() r16: mark(false()) -> false() r17: mark(|0|()) -> |0|() r18: mark(s(X)) -> s(X) r19: mark(nil()) -> nil() r20: mark(cons(X1,X2)) -> cons(X1,X2) r21: a__and(X1,X2) -> and(X1,X2) r22: a__if(X1,X2,X3) -> if(X1,X2,X3) r23: a__add(X1,X2) -> add(X1,X2) r24: a__first(X1,X2) -> first(X1,X2) r25: a__from(X) -> from(X) The estimated dependency graph contains the following SCCs: (no SCCs)