Term Rewriting System R:
[N, X, Y, X1, X2, XS]
fib(N) -> sel(N, fib1(s(0), s(0)))
fib1(X, Y) -> cons(X, nfib1(Y, add(X, Y)))
fib1(X1, X2) -> nfib1(X1, X2)
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))
activate(nfib1(X1, X2)) -> fib1(X1, X2)
activate(X) -> X

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

FIB(N) -> SEL(N, fib1(s(0), s(0)))
FIB(N) -> FIB1(s(0), s(0))
FIB1(X, Y) -> ADD(X, Y)
ADD(s(X), Y) -> ADD(X, Y)
SEL(s(N), cons(X, XS)) -> SEL(N, activate(XS))
SEL(s(N), cons(X, XS)) -> ACTIVATE(XS)
ACTIVATE(nfib1(X1, X2)) -> FIB1(X1, X2)

Furthermore, R contains two SCCs.


   R
DPs
       →DP Problem 1
Polynomial Ordering
       →DP Problem 2
Polo


Dependency Pair:

ADD(s(X), Y) -> ADD(X, Y)


Rules:


fib(N) -> sel(N, fib1(s(0), s(0)))
fib1(X, Y) -> cons(X, nfib1(Y, add(X, Y)))
fib1(X1, X2) -> nfib1(X1, X2)
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))
activate(nfib1(X1, X2)) -> fib1(X1, X2)
activate(X) -> X





The following dependency pair can be strictly oriented:

ADD(s(X), Y) -> ADD(X, Y)


There are no usable rules using the Ce-refinement that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(s(x1))=  1 + x1  
  POL(ADD(x1, x2))=  x1  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
           →DP Problem 3
Dependency Graph
       →DP Problem 2
Polo


Dependency Pair:


Rules:


fib(N) -> sel(N, fib1(s(0), s(0)))
fib1(X, Y) -> cons(X, nfib1(Y, add(X, Y)))
fib1(X1, X2) -> nfib1(X1, X2)
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))
activate(nfib1(X1, X2)) -> fib1(X1, X2)
activate(X) -> X





Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polynomial Ordering


Dependency Pair:

SEL(s(N), cons(X, XS)) -> SEL(N, activate(XS))


Rules:


fib(N) -> sel(N, fib1(s(0), s(0)))
fib1(X, Y) -> cons(X, nfib1(Y, add(X, Y)))
fib1(X1, X2) -> nfib1(X1, X2)
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))
activate(nfib1(X1, X2)) -> fib1(X1, X2)
activate(X) -> X





The following dependency pair can be strictly oriented:

SEL(s(N), cons(X, XS)) -> SEL(N, activate(XS))


Additionally, the following usable rules using the Ce-refinement can be oriented:

activate(nfib1(X1, X2)) -> fib1(X1, X2)
activate(X) -> X
fib1(X, Y) -> cons(X, nfib1(Y, add(X, Y)))
fib1(X1, X2) -> nfib1(X1, X2)
add(0, X) -> X
add(s(X), Y) -> s(add(X, Y))


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(activate(x1))=  x1  
  POL(0)=  0  
  POL(cons(x1, x2))=  0  
  POL(SEL(x1, x2))=  x1  
  POL(n__fib1(x1, x2))=  0  
  POL(s(x1))=  1 + x1  
  POL(fib1(x1, x2))=  0  
  POL(add(x1, x2))=  x1 + x2  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
           →DP Problem 4
Dependency Graph


Dependency Pair:


Rules:


fib(N) -> sel(N, fib1(s(0), s(0)))
fib1(X, Y) -> cons(X, nfib1(Y, add(X, Y)))
fib1(X1, X2) -> nfib1(X1, X2)
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))
activate(nfib1(X1, X2)) -> fib1(X1, X2)
activate(X) -> X





Using the Dependency Graph resulted in no new DP problems.

Termination of R successfully shown.
Duration:
0:00 minutes