Term Rewriting System R:
[N, X, Y, XS]
fib(N) -> sel(N, fib1(s(0), s(0)))
fib1(X, Y) -> cons(X, fib1(Y, add(X, Y)))
sel(0, cons(X, XS)) -> X
sel(s(N), cons(X, XS)) -> sel(N, XS)

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) -> FIB1(Y, add(X, Y))
SEL(s(N), cons(X, XS)) -> SEL(N, XS)

Furthermore, R contains three SCCs.

R
DPs
→DP Problem 1
Remaining Obligation(s)
→DP Problem 2
Remaining Obligation(s)
→DP Problem 3
Remaining Obligation(s)

The following remains to be proven:
• Dependency Pair:

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

Rules:

fib(N) -> sel(N, fib1(s(0), s(0)))
fib1(X, Y) -> cons(X, fib1(Y, add(X, Y)))
sel(0, cons(X, XS)) -> X
sel(s(N), cons(X, XS)) -> sel(N, XS)

• Dependency Pair:

Rules:

fib(N) -> sel(N, fib1(s(0), s(0)))
fib1(X, Y) -> cons(X, fib1(Y, add(X, Y)))
sel(0, cons(X, XS)) -> X
sel(s(N), cons(X, XS)) -> sel(N, XS)

• Dependency Pair:

FIB1(X, Y) -> FIB1(Y, add(X, Y))

Rules:

fib(N) -> sel(N, fib1(s(0), s(0)))
fib1(X, Y) -> cons(X, fib1(Y, add(X, Y)))
sel(0, cons(X, XS)) -> X
sel(s(N), cons(X, XS)) -> sel(N, XS)

R
DPs
→DP Problem 1
Remaining Obligation(s)
→DP Problem 2
Remaining Obligation(s)
→DP Problem 3
Remaining Obligation(s)

The following remains to be proven:
• Dependency Pair:

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

Rules:

fib(N) -> sel(N, fib1(s(0), s(0)))
fib1(X, Y) -> cons(X, fib1(Y, add(X, Y)))
sel(0, cons(X, XS)) -> X
sel(s(N), cons(X, XS)) -> sel(N, XS)

• Dependency Pair:

Rules:

fib(N) -> sel(N, fib1(s(0), s(0)))
fib1(X, Y) -> cons(X, fib1(Y, add(X, Y)))
sel(0, cons(X, XS)) -> X
sel(s(N), cons(X, XS)) -> sel(N, XS)

• Dependency Pair:

FIB1(X, Y) -> FIB1(Y, add(X, Y))

Rules:

fib(N) -> sel(N, fib1(s(0), s(0)))
fib1(X, Y) -> cons(X, fib1(Y, add(X, Y)))
sel(0, cons(X, XS)) -> X
sel(s(N), cons(X, XS)) -> sel(N, XS)

R
DPs
→DP Problem 1
Remaining Obligation(s)
→DP Problem 2
Remaining Obligation(s)
→DP Problem 3
Remaining Obligation(s)

The following remains to be proven:
• Dependency Pair:

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

Rules:

fib(N) -> sel(N, fib1(s(0), s(0)))
fib1(X, Y) -> cons(X, fib1(Y, add(X, Y)))
sel(0, cons(X, XS)) -> X
sel(s(N), cons(X, XS)) -> sel(N, XS)

• Dependency Pair:

Rules:

fib(N) -> sel(N, fib1(s(0), s(0)))
fib1(X, Y) -> cons(X, fib1(Y, add(X, Y)))
sel(0, cons(X, XS)) -> X
sel(s(N), cons(X, XS)) -> sel(N, XS)

• Dependency Pair:

FIB1(X, Y) -> FIB1(Y, add(X, Y))

Rules:

fib(N) -> sel(N, fib1(s(0), s(0)))
fib1(X, Y) -> cons(X, fib1(Y, add(X, Y)))