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,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) activate(n__fib1(X1,X2)) -> fib1(X1,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: fib1#(X,Y) -> add#(X,Y) p4: add#(s(X),Y) -> add#(X,Y) p5: sel#(s(N),cons(X,XS)) -> sel#(N,activate(XS)) p6: sel#(s(N),cons(X,XS)) -> activate#(XS) p7: activate#(n__fib1(X1,X2)) -> fib1#(X1,X2) and R consists of: r1: fib(N) -> sel(N,fib1(s(|0|()),s(|0|()))) r2: fib1(X,Y) -> cons(X,n__fib1(Y,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: activate(n__fib1(X1,X2)) -> fib1(X1,X2) r9: activate(X) -> X The estimated dependency graph contains the following SCCs: {p5} {p4} -- 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,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: activate(n__fib1(X1,X2)) -> fib1(X1,X2) r9: activate(X) -> X The set of usable rules consists of r2, r3, r4, r7, r8, r9 Take the reduction pair: lexicographic combination of reduction pairs: 1. lexicographic path order with precedence: precedence: n__fib1 > add > cons > fib1 > |0| > activate > s > sel# argument filter: pi(sel#) = [1] pi(s) = [1] pi(cons) = 1 pi(activate) = [1] pi(add) = [1, 2] pi(|0|) = [] pi(fib1) = 1 pi(n__fib1) = 1 2. lexicographic path order with precedence: precedence: n__fib1 > add > cons > fib1 > |0| > activate > s > sel# argument filter: pi(sel#) = [] pi(s) = 1 pi(cons) = 1 pi(activate) = 1 pi(add) = 1 pi(|0|) = [] pi(fib1) = 1 pi(n__fib1) = 1 3. lexicographic path order with precedence: precedence: n__fib1 > add > cons > fib1 > |0| > activate > s > sel# argument filter: pi(sel#) = [] pi(s) = [1] pi(cons) = 1 pi(activate) = [1] pi(add) = 1 pi(|0|) = [] pi(fib1) = 1 pi(n__fib1) = 1 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,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: activate(n__fib1(X1,X2)) -> fib1(X1,X2) r9: activate(X) -> X The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. lexicographic path order with precedence: precedence: add# > s argument filter: pi(add#) = [1, 2] pi(s) = 1 2. lexicographic path order with precedence: precedence: s > add# argument filter: pi(add#) = 1 pi(s) = 1 3. lexicographic path order with precedence: precedence: s > add# argument filter: pi(add#) = [1] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.