YES We show the termination of the TRS R: fib(N) -> sel(N,fib1(s(|0|()),s(|0|()))) fib1(X,Y) -> cons(X,n__fib1(Y,n__add(X,Y))) add(|0|(),X) -> X add(s(X),Y) -> s(add(X,Y)) sel(|0|(),cons(X,XS)) -> X sel(s(N),cons(X,XS)) -> sel(N,activate(XS)) fib1(X1,X2) -> n__fib1(X1,X2) add(X1,X2) -> n__add(X1,X2) activate(n__fib1(X1,X2)) -> fib1(activate(X1),activate(X2)) activate(n__add(X1,X2)) -> add(activate(X1),activate(X2)) activate(X) -> X -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: fib#(N) -> sel#(N,fib1(s(|0|()),s(|0|()))) p2: fib#(N) -> fib1#(s(|0|()),s(|0|())) p3: add#(s(X),Y) -> add#(X,Y) p4: sel#(s(N),cons(X,XS)) -> sel#(N,activate(XS)) p5: sel#(s(N),cons(X,XS)) -> activate#(XS) p6: activate#(n__fib1(X1,X2)) -> fib1#(activate(X1),activate(X2)) p7: activate#(n__fib1(X1,X2)) -> activate#(X1) p8: activate#(n__fib1(X1,X2)) -> activate#(X2) p9: activate#(n__add(X1,X2)) -> add#(activate(X1),activate(X2)) p10: activate#(n__add(X1,X2)) -> activate#(X1) p11: activate#(n__add(X1,X2)) -> activate#(X2) and R consists of: r1: fib(N) -> sel(N,fib1(s(|0|()),s(|0|()))) r2: fib1(X,Y) -> cons(X,n__fib1(Y,n__add(X,Y))) r3: add(|0|(),X) -> X r4: add(s(X),Y) -> s(add(X,Y)) r5: sel(|0|(),cons(X,XS)) -> X r6: sel(s(N),cons(X,XS)) -> sel(N,activate(XS)) r7: fib1(X1,X2) -> n__fib1(X1,X2) r8: add(X1,X2) -> n__add(X1,X2) r9: activate(n__fib1(X1,X2)) -> fib1(activate(X1),activate(X2)) r10: activate(n__add(X1,X2)) -> add(activate(X1),activate(X2)) r11: activate(X) -> X The estimated dependency graph contains the following SCCs: {p4} {p7, p8, p10, p11} {p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: sel#(s(N),cons(X,XS)) -> sel#(N,activate(XS)) and R consists of: r1: fib(N) -> sel(N,fib1(s(|0|()),s(|0|()))) r2: fib1(X,Y) -> cons(X,n__fib1(Y,n__add(X,Y))) r3: add(|0|(),X) -> X r4: add(s(X),Y) -> s(add(X,Y)) r5: sel(|0|(),cons(X,XS)) -> X r6: sel(s(N),cons(X,XS)) -> sel(N,activate(XS)) r7: fib1(X1,X2) -> n__fib1(X1,X2) r8: add(X1,X2) -> n__add(X1,X2) r9: activate(n__fib1(X1,X2)) -> fib1(activate(X1),activate(X2)) r10: activate(n__add(X1,X2)) -> add(activate(X1),activate(X2)) r11: activate(X) -> X The set of usable rules consists of r2, r3, r4, r7, r8, r9, r10, r11 Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: sel#_A(x1,x2) = x1 + 38 s_A(x1) = max{22, x1} cons_A(x1,x2) = max{x1 + 8, x2 - 6} activate_A(x1) = x1 + 16 fib1_A(x1,x2) = max{x1 + 8, x2 + 13} n__fib1_A(x1,x2) = max{x1 + 8, x2 + 13} n__add_A(x1,x2) = max{5, x1 + 1, x2 + 4} add_A(x1,x2) = max{21, x1 + 1, x2 + 4} |0|_A = 0 precedence: activate > cons = fib1 > n__add = add > n__fib1 > s > sel# = |0| partial status: pi(sel#) = [1] pi(s) = [1] pi(cons) = [] pi(activate) = [1] pi(fib1) = [] pi(n__fib1) = [] pi(n__add) = [1, 2] pi(add) = [1, 2] pi(|0|) = [] The next rules are strictly ordered: p1 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: activate#(n__add(X1,X2)) -> activate#(X2) p2: activate#(n__add(X1,X2)) -> activate#(X1) p3: activate#(n__fib1(X1,X2)) -> activate#(X2) p4: activate#(n__fib1(X1,X2)) -> activate#(X1) and R consists of: r1: fib(N) -> sel(N,fib1(s(|0|()),s(|0|()))) r2: fib1(X,Y) -> cons(X,n__fib1(Y,n__add(X,Y))) r3: add(|0|(),X) -> X r4: add(s(X),Y) -> s(add(X,Y)) r5: sel(|0|(),cons(X,XS)) -> X r6: sel(s(N),cons(X,XS)) -> sel(N,activate(XS)) r7: fib1(X1,X2) -> n__fib1(X1,X2) r8: add(X1,X2) -> n__add(X1,X2) r9: activate(n__fib1(X1,X2)) -> fib1(activate(X1),activate(X2)) r10: activate(n__add(X1,X2)) -> add(activate(X1),activate(X2)) r11: activate(X) -> X The set of usable rules consists of (no rules) Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: activate#_A(x1) = x1 + 2 n__add_A(x1,x2) = max{x1, x2 + 1} n__fib1_A(x1,x2) = max{x1, x2} precedence: activate# = n__add = n__fib1 partial status: pi(activate#) = [] pi(n__add) = [2] pi(n__fib1) = [2] The next rules are strictly ordered: p1 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)) -> activate#(X1) p2: activate#(n__fib1(X1,X2)) -> activate#(X2) p3: activate#(n__fib1(X1,X2)) -> activate#(X1) and R consists of: r1: fib(N) -> sel(N,fib1(s(|0|()),s(|0|()))) r2: fib1(X,Y) -> cons(X,n__fib1(Y,n__add(X,Y))) r3: add(|0|(),X) -> X r4: add(s(X),Y) -> s(add(X,Y)) r5: sel(|0|(),cons(X,XS)) -> X r6: sel(s(N),cons(X,XS)) -> sel(N,activate(XS)) r7: fib1(X1,X2) -> n__fib1(X1,X2) r8: add(X1,X2) -> n__add(X1,X2) r9: activate(n__fib1(X1,X2)) -> fib1(activate(X1),activate(X2)) r10: activate(n__add(X1,X2)) -> add(activate(X1),activate(X2)) r11: activate(X) -> X The estimated dependency graph contains the following SCCs: {p1, p2, p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: activate#(n__add(X1,X2)) -> activate#(X1) p2: activate#(n__fib1(X1,X2)) -> activate#(X1) p3: activate#(n__fib1(X1,X2)) -> activate#(X2) and R consists of: r1: fib(N) -> sel(N,fib1(s(|0|()),s(|0|()))) r2: fib1(X,Y) -> cons(X,n__fib1(Y,n__add(X,Y))) r3: add(|0|(),X) -> X r4: add(s(X),Y) -> s(add(X,Y)) r5: sel(|0|(),cons(X,XS)) -> X r6: sel(s(N),cons(X,XS)) -> sel(N,activate(XS)) r7: fib1(X1,X2) -> n__fib1(X1,X2) r8: add(X1,X2) -> n__add(X1,X2) r9: activate(n__fib1(X1,X2)) -> fib1(activate(X1),activate(X2)) r10: activate(n__add(X1,X2)) -> add(activate(X1),activate(X2)) r11: activate(X) -> X The set of usable rules consists of (no rules) Take the monotone reduction pair: weighted path order base order: max/plus interpretations on natural numbers: activate#_A(x1) = x1 + 1 n__add_A(x1,x2) = max{x1, x2} n__fib1_A(x1,x2) = max{x1, x2} precedence: activate# = n__add = n__fib1 partial status: pi(activate#) = [1] pi(n__add) = [1, 2] pi(n__fib1) = [1, 2] The next rules are strictly ordered: p1 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: activate#(n__fib1(X1,X2)) -> activate#(X1) p2: activate#(n__fib1(X1,X2)) -> activate#(X2) and R consists of: r1: fib(N) -> sel(N,fib1(s(|0|()),s(|0|()))) r2: fib1(X,Y) -> cons(X,n__fib1(Y,n__add(X,Y))) r3: add(|0|(),X) -> X r4: add(s(X),Y) -> s(add(X,Y)) r5: sel(|0|(),cons(X,XS)) -> X r6: sel(s(N),cons(X,XS)) -> sel(N,activate(XS)) r7: fib1(X1,X2) -> n__fib1(X1,X2) r8: add(X1,X2) -> n__add(X1,X2) r9: activate(n__fib1(X1,X2)) -> fib1(activate(X1),activate(X2)) r10: activate(n__add(X1,X2)) -> add(activate(X1),activate(X2)) r11: activate(X) -> X The estimated dependency graph contains the following SCCs: {p1, p2} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: activate#(n__fib1(X1,X2)) -> activate#(X1) p2: activate#(n__fib1(X1,X2)) -> activate#(X2) and R consists of: r1: fib(N) -> sel(N,fib1(s(|0|()),s(|0|()))) r2: fib1(X,Y) -> cons(X,n__fib1(Y,n__add(X,Y))) r3: add(|0|(),X) -> X r4: add(s(X),Y) -> s(add(X,Y)) r5: sel(|0|(),cons(X,XS)) -> X r6: sel(s(N),cons(X,XS)) -> sel(N,activate(XS)) r7: fib1(X1,X2) -> n__fib1(X1,X2) r8: add(X1,X2) -> n__add(X1,X2) r9: activate(n__fib1(X1,X2)) -> fib1(activate(X1),activate(X2)) r10: activate(n__add(X1,X2)) -> add(activate(X1),activate(X2)) r11: activate(X) -> X The set of usable rules consists of (no rules) Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: activate#_A(x1) = x1 + 3 n__fib1_A(x1,x2) = max{x1 + 1, x2} precedence: activate# = n__fib1 partial status: pi(activate#) = [] pi(n__fib1) = [2] The next rules are strictly ordered: p1 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: activate#(n__fib1(X1,X2)) -> activate#(X2) and R consists of: r1: fib(N) -> sel(N,fib1(s(|0|()),s(|0|()))) r2: fib1(X,Y) -> cons(X,n__fib1(Y,n__add(X,Y))) r3: add(|0|(),X) -> X r4: add(s(X),Y) -> s(add(X,Y)) r5: sel(|0|(),cons(X,XS)) -> X r6: sel(s(N),cons(X,XS)) -> sel(N,activate(XS)) r7: fib1(X1,X2) -> n__fib1(X1,X2) r8: add(X1,X2) -> n__add(X1,X2) r9: activate(n__fib1(X1,X2)) -> fib1(activate(X1),activate(X2)) r10: activate(n__add(X1,X2)) -> add(activate(X1),activate(X2)) r11: activate(X) -> X The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: activate#(n__fib1(X1,X2)) -> activate#(X2) and R consists of: r1: fib(N) -> sel(N,fib1(s(|0|()),s(|0|()))) r2: fib1(X,Y) -> cons(X,n__fib1(Y,n__add(X,Y))) r3: add(|0|(),X) -> X r4: add(s(X),Y) -> s(add(X,Y)) r5: sel(|0|(),cons(X,XS)) -> X r6: sel(s(N),cons(X,XS)) -> sel(N,activate(XS)) r7: fib1(X1,X2) -> n__fib1(X1,X2) r8: add(X1,X2) -> n__add(X1,X2) r9: activate(n__fib1(X1,X2)) -> fib1(activate(X1),activate(X2)) r10: activate(n__add(X1,X2)) -> add(activate(X1),activate(X2)) r11: activate(X) -> X The set of usable rules consists of (no rules) Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: activate#_A(x1) = x1 + 4 n__fib1_A(x1,x2) = max{x1 - 1, x2 + 1} precedence: activate# = n__fib1 partial status: pi(activate#) = [] pi(n__fib1) = [2] The next rules are strictly ordered: p1 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: add#(s(X),Y) -> add#(X,Y) and R consists of: r1: fib(N) -> sel(N,fib1(s(|0|()),s(|0|()))) r2: fib1(X,Y) -> cons(X,n__fib1(Y,n__add(X,Y))) r3: add(|0|(),X) -> X r4: add(s(X),Y) -> s(add(X,Y)) r5: sel(|0|(),cons(X,XS)) -> X r6: sel(s(N),cons(X,XS)) -> sel(N,activate(XS)) r7: fib1(X1,X2) -> n__fib1(X1,X2) r8: add(X1,X2) -> n__add(X1,X2) r9: activate(n__fib1(X1,X2)) -> fib1(activate(X1),activate(X2)) r10: activate(n__add(X1,X2)) -> add(activate(X1),activate(X2)) r11: activate(X) -> X The set of usable rules consists of (no rules) Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: add#_A(x1,x2) = max{0, x1 - 2} s_A(x1) = max{3, x1 + 1} precedence: add# = s partial status: pi(add#) = [] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.