YES We show the termination of the TRS R: and(true(),X) -> activate(X) and(false(),Y) -> false() if(true(),X,Y) -> activate(X) if(false(),X,Y) -> activate(Y) add(|0|(),X) -> activate(X) add(s(X),Y) -> s(n__add(activate(X),activate(Y))) first(|0|(),X) -> nil() first(s(X),cons(Y,Z)) -> cons(activate(Y),n__first(activate(X),activate(Z))) from(X) -> cons(activate(X),n__from(n__s(activate(X)))) add(X1,X2) -> n__add(X1,X2) first(X1,X2) -> n__first(X1,X2) from(X) -> n__from(X) s(X) -> n__s(X) activate(n__add(X1,X2)) -> add(activate(X1),X2) activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) activate(n__from(X)) -> from(X) activate(n__s(X)) -> s(X) activate(X) -> X -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: and#(true(),X) -> activate#(X) p2: if#(true(),X,Y) -> activate#(X) p3: if#(false(),X,Y) -> activate#(Y) p4: add#(|0|(),X) -> activate#(X) p5: add#(s(X),Y) -> s#(n__add(activate(X),activate(Y))) p6: add#(s(X),Y) -> activate#(X) p7: add#(s(X),Y) -> activate#(Y) p8: first#(s(X),cons(Y,Z)) -> activate#(Y) p9: first#(s(X),cons(Y,Z)) -> activate#(X) p10: first#(s(X),cons(Y,Z)) -> activate#(Z) p11: from#(X) -> activate#(X) p12: activate#(n__add(X1,X2)) -> add#(activate(X1),X2) p13: activate#(n__add(X1,X2)) -> activate#(X1) p14: activate#(n__first(X1,X2)) -> first#(activate(X1),activate(X2)) p15: activate#(n__first(X1,X2)) -> activate#(X1) p16: activate#(n__first(X1,X2)) -> activate#(X2) p17: activate#(n__from(X)) -> from#(X) p18: activate#(n__s(X)) -> s#(X) and R consists of: r1: and(true(),X) -> activate(X) r2: and(false(),Y) -> false() r3: if(true(),X,Y) -> activate(X) r4: if(false(),X,Y) -> activate(Y) r5: add(|0|(),X) -> activate(X) r6: add(s(X),Y) -> s(n__add(activate(X),activate(Y))) r7: first(|0|(),X) -> nil() r8: first(s(X),cons(Y,Z)) -> cons(activate(Y),n__first(activate(X),activate(Z))) r9: from(X) -> cons(activate(X),n__from(n__s(activate(X)))) r10: add(X1,X2) -> n__add(X1,X2) r11: first(X1,X2) -> n__first(X1,X2) r12: from(X) -> n__from(X) r13: s(X) -> n__s(X) r14: activate(n__add(X1,X2)) -> add(activate(X1),X2) r15: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r16: activate(n__from(X)) -> from(X) r17: activate(n__s(X)) -> s(X) r18: activate(X) -> X The estimated dependency graph contains the following SCCs: {p4, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: activate#(n__add(X1,X2)) -> add#(activate(X1),X2) p2: add#(s(X),Y) -> activate#(Y) p3: activate#(n__from(X)) -> from#(X) p4: from#(X) -> activate#(X) p5: activate#(n__first(X1,X2)) -> activate#(X2) p6: activate#(n__first(X1,X2)) -> activate#(X1) p7: activate#(n__first(X1,X2)) -> first#(activate(X1),activate(X2)) p8: first#(s(X),cons(Y,Z)) -> activate#(Z) p9: activate#(n__add(X1,X2)) -> activate#(X1) p10: first#(s(X),cons(Y,Z)) -> activate#(X) p11: first#(s(X),cons(Y,Z)) -> activate#(Y) p12: add#(s(X),Y) -> activate#(X) p13: add#(|0|(),X) -> activate#(X) and R consists of: r1: and(true(),X) -> activate(X) r2: and(false(),Y) -> false() r3: if(true(),X,Y) -> activate(X) r4: if(false(),X,Y) -> activate(Y) r5: add(|0|(),X) -> activate(X) r6: add(s(X),Y) -> s(n__add(activate(X),activate(Y))) r7: first(|0|(),X) -> nil() r8: first(s(X),cons(Y,Z)) -> cons(activate(Y),n__first(activate(X),activate(Z))) r9: from(X) -> cons(activate(X),n__from(n__s(activate(X)))) r10: add(X1,X2) -> n__add(X1,X2) r11: first(X1,X2) -> n__first(X1,X2) r12: from(X) -> n__from(X) r13: s(X) -> n__s(X) r14: activate(n__add(X1,X2)) -> add(activate(X1),X2) r15: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r16: activate(n__from(X)) -> from(X) r17: activate(n__s(X)) -> s(X) r18: activate(X) -> X The set of usable rules consists of r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18 Take the reduction pair: max/plus interpretations on natural numbers: activate#_A(x1) = x1 + 3 n__add_A(x1,x2) = max{2, x1, x2 + 1} add#_A(x1,x2) = max{x1 + 3, x2 + 3} activate_A(x1) = x1 s_A(x1) = x1 n__from_A(x1) = max{2, x1} from#_A(x1) = x1 + 3 n__first_A(x1,x2) = max{x1 + 2, x2} first#_A(x1,x2) = max{x1 + 5, x2 + 3} cons_A(x1,x2) = max{2, x1, x2} |0|_A = 0 add_A(x1,x2) = max{2, x1, x2 + 1} first_A(x1,x2) = max{x1 + 2, x2} nil_A = 0 from_A(x1) = max{2, x1} n__s_A(x1) = x1 The next rules are strictly ordered: p6, p10 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: activate#(n__add(X1,X2)) -> add#(activate(X1),X2) p2: add#(s(X),Y) -> activate#(Y) p3: activate#(n__from(X)) -> from#(X) p4: from#(X) -> activate#(X) p5: activate#(n__first(X1,X2)) -> activate#(X2) p6: activate#(n__first(X1,X2)) -> first#(activate(X1),activate(X2)) p7: first#(s(X),cons(Y,Z)) -> activate#(Z) p8: activate#(n__add(X1,X2)) -> activate#(X1) p9: first#(s(X),cons(Y,Z)) -> activate#(Y) p10: add#(s(X),Y) -> activate#(X) p11: add#(|0|(),X) -> activate#(X) and R consists of: r1: and(true(),X) -> activate(X) r2: and(false(),Y) -> false() r3: if(true(),X,Y) -> activate(X) r4: if(false(),X,Y) -> activate(Y) r5: add(|0|(),X) -> activate(X) r6: add(s(X),Y) -> s(n__add(activate(X),activate(Y))) r7: first(|0|(),X) -> nil() r8: first(s(X),cons(Y,Z)) -> cons(activate(Y),n__first(activate(X),activate(Z))) r9: from(X) -> cons(activate(X),n__from(n__s(activate(X)))) r10: add(X1,X2) -> n__add(X1,X2) r11: first(X1,X2) -> n__first(X1,X2) r12: from(X) -> n__from(X) r13: s(X) -> n__s(X) r14: activate(n__add(X1,X2)) -> add(activate(X1),X2) r15: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r16: activate(n__from(X)) -> from(X) r17: activate(n__s(X)) -> s(X) r18: activate(X) -> X The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: activate#(n__add(X1,X2)) -> add#(activate(X1),X2) p2: add#(|0|(),X) -> activate#(X) p3: activate#(n__add(X1,X2)) -> activate#(X1) p4: activate#(n__first(X1,X2)) -> first#(activate(X1),activate(X2)) p5: first#(s(X),cons(Y,Z)) -> activate#(Y) p6: activate#(n__first(X1,X2)) -> activate#(X2) p7: activate#(n__from(X)) -> from#(X) p8: from#(X) -> activate#(X) p9: first#(s(X),cons(Y,Z)) -> activate#(Z) p10: add#(s(X),Y) -> activate#(X) p11: add#(s(X),Y) -> activate#(Y) and R consists of: r1: and(true(),X) -> activate(X) r2: and(false(),Y) -> false() r3: if(true(),X,Y) -> activate(X) r4: if(false(),X,Y) -> activate(Y) r5: add(|0|(),X) -> activate(X) r6: add(s(X),Y) -> s(n__add(activate(X),activate(Y))) r7: first(|0|(),X) -> nil() r8: first(s(X),cons(Y,Z)) -> cons(activate(Y),n__first(activate(X),activate(Z))) r9: from(X) -> cons(activate(X),n__from(n__s(activate(X)))) r10: add(X1,X2) -> n__add(X1,X2) r11: first(X1,X2) -> n__first(X1,X2) r12: from(X) -> n__from(X) r13: s(X) -> n__s(X) r14: activate(n__add(X1,X2)) -> add(activate(X1),X2) r15: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r16: activate(n__from(X)) -> from(X) r17: activate(n__s(X)) -> s(X) r18: activate(X) -> X The set of usable rules consists of r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18 Take the reduction pair: max/plus interpretations on natural numbers: activate#_A(x1) = max{6, x1} n__add_A(x1,x2) = max{x1 + 9, x2 + 6} add#_A(x1,x2) = max{x1 + 6, x2 + 6} activate_A(x1) = x1 |0|_A = 0 n__first_A(x1,x2) = max{x1 + 8, x2 + 8} first#_A(x1,x2) = max{7, x1 + 2, x2 + 2} s_A(x1) = x1 cons_A(x1,x2) = max{x1 + 5, x2} n__from_A(x1) = x1 + 5 from#_A(x1) = max{6, x1 + 5} add_A(x1,x2) = max{x1 + 9, x2 + 6} first_A(x1,x2) = max{x1 + 8, x2 + 8} nil_A = 5 from_A(x1) = x1 + 5 n__s_A(x1) = x1 The next rules are strictly ordered: p3, p4, p5, p6, p9 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: activate#(n__add(X1,X2)) -> add#(activate(X1),X2) p2: add#(|0|(),X) -> activate#(X) p3: activate#(n__from(X)) -> from#(X) p4: from#(X) -> activate#(X) p5: add#(s(X),Y) -> activate#(X) p6: add#(s(X),Y) -> activate#(Y) and R consists of: r1: and(true(),X) -> activate(X) r2: and(false(),Y) -> false() r3: if(true(),X,Y) -> activate(X) r4: if(false(),X,Y) -> activate(Y) r5: add(|0|(),X) -> activate(X) r6: add(s(X),Y) -> s(n__add(activate(X),activate(Y))) r7: first(|0|(),X) -> nil() r8: first(s(X),cons(Y,Z)) -> cons(activate(Y),n__first(activate(X),activate(Z))) r9: from(X) -> cons(activate(X),n__from(n__s(activate(X)))) r10: add(X1,X2) -> n__add(X1,X2) r11: first(X1,X2) -> n__first(X1,X2) r12: from(X) -> n__from(X) r13: s(X) -> n__s(X) r14: activate(n__add(X1,X2)) -> add(activate(X1),X2) r15: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r16: activate(n__from(X)) -> from(X) r17: activate(n__s(X)) -> s(X) r18: activate(X) -> X The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4, p5, p6} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: activate#(n__add(X1,X2)) -> add#(activate(X1),X2) p2: add#(s(X),Y) -> activate#(Y) p3: activate#(n__from(X)) -> from#(X) p4: from#(X) -> activate#(X) p5: add#(s(X),Y) -> activate#(X) p6: add#(|0|(),X) -> activate#(X) and R consists of: r1: and(true(),X) -> activate(X) r2: and(false(),Y) -> false() r3: if(true(),X,Y) -> activate(X) r4: if(false(),X,Y) -> activate(Y) r5: add(|0|(),X) -> activate(X) r6: add(s(X),Y) -> s(n__add(activate(X),activate(Y))) r7: first(|0|(),X) -> nil() r8: first(s(X),cons(Y,Z)) -> cons(activate(Y),n__first(activate(X),activate(Z))) r9: from(X) -> cons(activate(X),n__from(n__s(activate(X)))) r10: add(X1,X2) -> n__add(X1,X2) r11: first(X1,X2) -> n__first(X1,X2) r12: from(X) -> n__from(X) r13: s(X) -> n__s(X) r14: activate(n__add(X1,X2)) -> add(activate(X1),X2) r15: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r16: activate(n__from(X)) -> from(X) r17: activate(n__s(X)) -> s(X) r18: activate(X) -> X The set of usable rules consists of r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18 Take the reduction pair: max/plus interpretations on natural numbers: activate#_A(x1) = max{2, x1 - 1} n__add_A(x1,x2) = max{x1 + 8, x2 + 3} add#_A(x1,x2) = max{x1 + 1, x2 + 2} activate_A(x1) = x1 s_A(x1) = max{5, x1 - 2} n__from_A(x1) = x1 + 3 from#_A(x1) = x1 + 2 |0|_A = 1 add_A(x1,x2) = max{x1 + 8, x2 + 3} first_A(x1,x2) = 3 nil_A = 0 cons_A(x1,x2) = 3 n__first_A(x1,x2) = 3 from_A(x1) = x1 + 3 n__s_A(x1) = max{5, x1 - 2} The next rules are strictly ordered: p2 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: activate#(n__add(X1,X2)) -> add#(activate(X1),X2) p2: activate#(n__from(X)) -> from#(X) p3: from#(X) -> activate#(X) p4: add#(s(X),Y) -> activate#(X) p5: add#(|0|(),X) -> activate#(X) and R consists of: r1: and(true(),X) -> activate(X) r2: and(false(),Y) -> false() r3: if(true(),X,Y) -> activate(X) r4: if(false(),X,Y) -> activate(Y) r5: add(|0|(),X) -> activate(X) r6: add(s(X),Y) -> s(n__add(activate(X),activate(Y))) r7: first(|0|(),X) -> nil() r8: first(s(X),cons(Y,Z)) -> cons(activate(Y),n__first(activate(X),activate(Z))) r9: from(X) -> cons(activate(X),n__from(n__s(activate(X)))) r10: add(X1,X2) -> n__add(X1,X2) r11: first(X1,X2) -> n__first(X1,X2) r12: from(X) -> n__from(X) r13: s(X) -> n__s(X) r14: activate(n__add(X1,X2)) -> add(activate(X1),X2) r15: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r16: activate(n__from(X)) -> from(X) r17: activate(n__s(X)) -> s(X) r18: activate(X) -> 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: activate#(n__add(X1,X2)) -> add#(activate(X1),X2) p2: add#(|0|(),X) -> activate#(X) p3: activate#(n__from(X)) -> from#(X) p4: from#(X) -> activate#(X) p5: add#(s(X),Y) -> activate#(X) and R consists of: r1: and(true(),X) -> activate(X) r2: and(false(),Y) -> false() r3: if(true(),X,Y) -> activate(X) r4: if(false(),X,Y) -> activate(Y) r5: add(|0|(),X) -> activate(X) r6: add(s(X),Y) -> s(n__add(activate(X),activate(Y))) r7: first(|0|(),X) -> nil() r8: first(s(X),cons(Y,Z)) -> cons(activate(Y),n__first(activate(X),activate(Z))) r9: from(X) -> cons(activate(X),n__from(n__s(activate(X)))) r10: add(X1,X2) -> n__add(X1,X2) r11: first(X1,X2) -> n__first(X1,X2) r12: from(X) -> n__from(X) r13: s(X) -> n__s(X) r14: activate(n__add(X1,X2)) -> add(activate(X1),X2) r15: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r16: activate(n__from(X)) -> from(X) r17: activate(n__s(X)) -> s(X) r18: activate(X) -> X The set of usable rules consists of r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18 Take the reduction pair: max/plus interpretations on natural numbers: activate#_A(x1) = x1 + 1 n__add_A(x1,x2) = max{x1 + 2, x2 + 2} add#_A(x1,x2) = max{x1 + 1, x2 + 3} activate_A(x1) = x1 |0|_A = 0 n__from_A(x1) = x1 + 4 from#_A(x1) = x1 + 5 s_A(x1) = max{2, x1} add_A(x1,x2) = max{x1 + 2, x2 + 2} first_A(x1,x2) = 6 nil_A = 2 cons_A(x1,x2) = max{4, x2 - 2} n__first_A(x1,x2) = 6 from_A(x1) = x1 + 4 n__s_A(x1) = max{2, x1} The next rules are strictly ordered: p2, p4 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: activate#(n__add(X1,X2)) -> add#(activate(X1),X2) p2: activate#(n__from(X)) -> from#(X) p3: add#(s(X),Y) -> activate#(X) and R consists of: r1: and(true(),X) -> activate(X) r2: and(false(),Y) -> false() r3: if(true(),X,Y) -> activate(X) r4: if(false(),X,Y) -> activate(Y) r5: add(|0|(),X) -> activate(X) r6: add(s(X),Y) -> s(n__add(activate(X),activate(Y))) r7: first(|0|(),X) -> nil() r8: first(s(X),cons(Y,Z)) -> cons(activate(Y),n__first(activate(X),activate(Z))) r9: from(X) -> cons(activate(X),n__from(n__s(activate(X)))) r10: add(X1,X2) -> n__add(X1,X2) r11: first(X1,X2) -> n__first(X1,X2) r12: from(X) -> n__from(X) r13: s(X) -> n__s(X) r14: activate(n__add(X1,X2)) -> add(activate(X1),X2) r15: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r16: activate(n__from(X)) -> from(X) r17: activate(n__s(X)) -> s(X) r18: activate(X) -> X The estimated dependency graph contains the following SCCs: {p1, p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: activate#(n__add(X1,X2)) -> add#(activate(X1),X2) p2: add#(s(X),Y) -> activate#(X) and R consists of: r1: and(true(),X) -> activate(X) r2: and(false(),Y) -> false() r3: if(true(),X,Y) -> activate(X) r4: if(false(),X,Y) -> activate(Y) r5: add(|0|(),X) -> activate(X) r6: add(s(X),Y) -> s(n__add(activate(X),activate(Y))) r7: first(|0|(),X) -> nil() r8: first(s(X),cons(Y,Z)) -> cons(activate(Y),n__first(activate(X),activate(Z))) r9: from(X) -> cons(activate(X),n__from(n__s(activate(X)))) r10: add(X1,X2) -> n__add(X1,X2) r11: first(X1,X2) -> n__first(X1,X2) r12: from(X) -> n__from(X) r13: s(X) -> n__s(X) r14: activate(n__add(X1,X2)) -> add(activate(X1),X2) r15: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r16: activate(n__from(X)) -> from(X) r17: activate(n__s(X)) -> s(X) r18: activate(X) -> X The set of usable rules consists of r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18 Take the reduction pair: max/plus interpretations on natural numbers: activate#_A(x1) = x1 + 1 n__add_A(x1,x2) = max{6, x1 + 2, x2 + 1} add#_A(x1,x2) = max{7, x1 + 3, x2 + 1} activate_A(x1) = max{4, x1} s_A(x1) = max{2, x1} add_A(x1,x2) = max{6, x1 + 2, x2 + 1} |0|_A = 2 first_A(x1,x2) = x2 nil_A = 0 cons_A(x1,x2) = 7 n__first_A(x1,x2) = x2 from_A(x1) = 7 n__from_A(x1) = 7 n__s_A(x1) = max{1, x1} The next rules are strictly ordered: p2 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: activate#(n__add(X1,X2)) -> add#(activate(X1),X2) and R consists of: r1: and(true(),X) -> activate(X) r2: and(false(),Y) -> false() r3: if(true(),X,Y) -> activate(X) r4: if(false(),X,Y) -> activate(Y) r5: add(|0|(),X) -> activate(X) r6: add(s(X),Y) -> s(n__add(activate(X),activate(Y))) r7: first(|0|(),X) -> nil() r8: first(s(X),cons(Y,Z)) -> cons(activate(Y),n__first(activate(X),activate(Z))) r9: from(X) -> cons(activate(X),n__from(n__s(activate(X)))) r10: add(X1,X2) -> n__add(X1,X2) r11: first(X1,X2) -> n__first(X1,X2) r12: from(X) -> n__from(X) r13: s(X) -> n__s(X) r14: activate(n__add(X1,X2)) -> add(activate(X1),X2) r15: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r16: activate(n__from(X)) -> from(X) r17: activate(n__s(X)) -> s(X) r18: activate(X) -> X The estimated dependency graph contains the following SCCs: (no SCCs)