Termination of the following Term Rewriting System could be proven:

Context-sensitive rewrite system:
The TRS R consists of the following rules:

fib(N) → sel(N, fib1(s(0), s(0)))
fib1(X, Y) → cons(X, 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, XS)

The replacement map contains the following entries:

fib: {1}
sel: {1, 2}
fib1: {1, 2}
s: {1}
0: empty set
cons: {1}
add: {1, 2}


CSR
  ↳ CSRInnermostProof

Context-sensitive rewrite system:
The TRS R consists of the following rules:

fib(N) → sel(N, fib1(s(0), s(0)))
fib1(X, Y) → cons(X, 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, XS)

The replacement map contains the following entries:

fib: {1}
sel: {1, 2}
fib1: {1, 2}
s: {1}
0: empty set
cons: {1}
add: {1, 2}

The CSR is orthogonal. By [10] we can switch to innermost.

↳ CSR
  ↳ CSRInnermostProof
CSR
      ↳ CSDependencyPairsProof

Context-sensitive rewrite system:
The TRS R consists of the following rules:

fib(N) → sel(N, fib1(s(0), s(0)))
fib1(X, Y) → cons(X, 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, XS)

The replacement map contains the following entries:

fib: {1}
sel: {1, 2}
fib1: {1, 2}
s: {1}
0: empty set
cons: {1}
add: {1, 2}

Innermost Strategy.

Using Improved CS-DPs we result in the following initial Q-CSDP problem.

↳ CSR
  ↳ CSRInnermostProof
    ↳ CSR
      ↳ CSDependencyPairsProof
QCSDP
          ↳ QCSDependencyGraphProof

Q-restricted context-sensitive dependency pair problem:
The symbols in {fib, sel, fib1, s, add, SEL, FIB, FIB1, ADD} are replacing on all positions.
For all symbols f in {cons} we have µ(f) = {1}.
The symbols in {U} are not replacing on any position.

The ordinary context-sensitive dependency pairs DPo are:

FIB(N) → SEL(N, fib1(s(0), s(0)))
FIB(N) → FIB1(s(0), s(0))
ADD(s(X), Y) → ADD(X, Y)
SEL(s(N), cons(X, XS)) → SEL(N, XS)

The collapsing dependency pairs are DPc:

SEL(s(N), cons(X, XS)) → XS


The hidden terms of R are:

fib1(Y, add(X, Y))
add(X, Y)

Every hiding context is built from:

add on positions {1, 2}
fib1 on positions {1, 2}

Hence, the new unhiding pairs DPu are :

SEL(s(N), cons(X, XS)) → U(XS)
U(add(x_0, x_1)) → U(x_0)
U(add(x_0, x_1)) → U(x_1)
U(fib1(x_0, x_1)) → U(x_0)
U(fib1(x_0, x_1)) → U(x_1)
U(fib1(Y, add(X, Y))) → FIB1(Y, add(X, Y))
U(add(X, Y)) → ADD(X, Y)

The TRS R consists of the following rules:

fib(N) → sel(N, fib1(s(0), s(0)))
fib1(X, Y) → cons(X, 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, XS)

The set Q consists of the following terms:

fib(x0)
fib1(x0, x1)
add(0, x0)
add(s(x0), x1)
sel(0, cons(x0, x1))
sel(s(x0), cons(x1, x2))


The approximation of the Context-Sensitive Dependency Graph contains 3 SCCs with 4 less nodes.


↳ CSR
  ↳ CSRInnermostProof
    ↳ CSR
      ↳ CSDependencyPairsProof
        ↳ QCSDP
          ↳ QCSDependencyGraphProof
            ↳ AND
QCSDP
                ↳ QCSDPSubtermProof
              ↳ QCSDP
              ↳ QCSDP

Q-restricted context-sensitive dependency pair problem:
The symbols in {fib, sel, fib1, s, add, ADD} are replacing on all positions.
For all symbols f in {cons} we have µ(f) = {1}.

The TRS P consists of the following rules:

ADD(s(X), Y) → ADD(X, Y)

The TRS R consists of the following rules:

fib(N) → sel(N, fib1(s(0), s(0)))
fib1(X, Y) → cons(X, 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, XS)

The set Q consists of the following terms:

fib(x0)
fib1(x0, x1)
add(0, x0)
add(s(x0), x1)
sel(0, cons(x0, x1))
sel(s(x0), cons(x1, x2))


We use the subterm processor [20].


The following pairs can be oriented strictly and are deleted.


ADD(s(X), Y) → ADD(X, Y)
The remaining pairs can at least be oriented weakly.
none
Used ordering: Combined order from the following AFS and order.
ADD(x1, x2)  =  x1

Subterm Order


↳ CSR
  ↳ CSRInnermostProof
    ↳ CSR
      ↳ CSDependencyPairsProof
        ↳ QCSDP
          ↳ QCSDependencyGraphProof
            ↳ AND
              ↳ QCSDP
                ↳ QCSDPSubtermProof
QCSDP
                    ↳ PIsEmptyProof
              ↳ QCSDP
              ↳ QCSDP

Q-restricted context-sensitive dependency pair problem:
The symbols in {fib, sel, fib1, s, add} are replacing on all positions.
For all symbols f in {cons} we have µ(f) = {1}.

The TRS P consists of the following rules:
none

The TRS R consists of the following rules:

fib(N) → sel(N, fib1(s(0), s(0)))
fib1(X, Y) → cons(X, 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, XS)

The set Q consists of the following terms:

fib(x0)
fib1(x0, x1)
add(0, x0)
add(s(x0), x1)
sel(0, cons(x0, x1))
sel(s(x0), cons(x1, x2))


The TRS P is empty. Hence, there is no (P,Q,R,µ)-chain.

↳ CSR
  ↳ CSRInnermostProof
    ↳ CSR
      ↳ CSDependencyPairsProof
        ↳ QCSDP
          ↳ QCSDependencyGraphProof
            ↳ AND
              ↳ QCSDP
QCSDP
                ↳ QCSDPSubtermProof
              ↳ QCSDP

Q-restricted context-sensitive dependency pair problem:
The symbols in {fib, sel, fib1, s, add} are replacing on all positions.
For all symbols f in {cons} we have µ(f) = {1}.
The symbols in {U} are not replacing on any position.

The TRS P consists of the following rules:

U(add(x_0, x_1)) → U(x_0)
U(add(x_0, x_1)) → U(x_1)
U(fib1(x_0, x_1)) → U(x_0)
U(fib1(x_0, x_1)) → U(x_1)

The TRS R consists of the following rules:

fib(N) → sel(N, fib1(s(0), s(0)))
fib1(X, Y) → cons(X, 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, XS)

The set Q consists of the following terms:

fib(x0)
fib1(x0, x1)
add(0, x0)
add(s(x0), x1)
sel(0, cons(x0, x1))
sel(s(x0), cons(x1, x2))


We use the subterm processor [20].


The following pairs can be oriented strictly and are deleted.


U(add(x_0, x_1)) → U(x_0)
U(add(x_0, x_1)) → U(x_1)
U(fib1(x_0, x_1)) → U(x_0)
U(fib1(x_0, x_1)) → U(x_1)
The remaining pairs can at least be oriented weakly.
none
Used ordering: Combined order from the following AFS and order.
U(x1)  =  x1

Subterm Order


↳ CSR
  ↳ CSRInnermostProof
    ↳ CSR
      ↳ CSDependencyPairsProof
        ↳ QCSDP
          ↳ QCSDependencyGraphProof
            ↳ AND
              ↳ QCSDP
              ↳ QCSDP
                ↳ QCSDPSubtermProof
QCSDP
                    ↳ PIsEmptyProof
              ↳ QCSDP

Q-restricted context-sensitive dependency pair problem:
The symbols in {fib, sel, fib1, s, add} are replacing on all positions.
For all symbols f in {cons} we have µ(f) = {1}.

The TRS P consists of the following rules:
none

The TRS R consists of the following rules:

fib(N) → sel(N, fib1(s(0), s(0)))
fib1(X, Y) → cons(X, 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, XS)

The set Q consists of the following terms:

fib(x0)
fib1(x0, x1)
add(0, x0)
add(s(x0), x1)
sel(0, cons(x0, x1))
sel(s(x0), cons(x1, x2))


The TRS P is empty. Hence, there is no (P,Q,R,µ)-chain.

↳ CSR
  ↳ CSRInnermostProof
    ↳ CSR
      ↳ CSDependencyPairsProof
        ↳ QCSDP
          ↳ QCSDependencyGraphProof
            ↳ AND
              ↳ QCSDP
              ↳ QCSDP
QCSDP
                ↳ QCSDPSubtermProof

Q-restricted context-sensitive dependency pair problem:
The symbols in {fib, sel, fib1, s, add, SEL} are replacing on all positions.
For all symbols f in {cons} we have µ(f) = {1}.

The TRS P consists of the following rules:

SEL(s(N), cons(X, XS)) → SEL(N, XS)

The TRS R consists of the following rules:

fib(N) → sel(N, fib1(s(0), s(0)))
fib1(X, Y) → cons(X, 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, XS)

The set Q consists of the following terms:

fib(x0)
fib1(x0, x1)
add(0, x0)
add(s(x0), x1)
sel(0, cons(x0, x1))
sel(s(x0), cons(x1, x2))


We use the subterm processor [20].


The following pairs can be oriented strictly and are deleted.


SEL(s(N), cons(X, XS)) → SEL(N, XS)
The remaining pairs can at least be oriented weakly.
none
Used ordering: Combined order from the following AFS and order.
SEL(x1, x2)  =  x1

Subterm Order


↳ CSR
  ↳ CSRInnermostProof
    ↳ CSR
      ↳ CSDependencyPairsProof
        ↳ QCSDP
          ↳ QCSDependencyGraphProof
            ↳ AND
              ↳ QCSDP
              ↳ QCSDP
              ↳ QCSDP
                ↳ QCSDPSubtermProof
QCSDP
                    ↳ PIsEmptyProof

Q-restricted context-sensitive dependency pair problem:
The symbols in {fib, sel, fib1, s, add} are replacing on all positions.
For all symbols f in {cons} we have µ(f) = {1}.

The TRS P consists of the following rules:
none

The TRS R consists of the following rules:

fib(N) → sel(N, fib1(s(0), s(0)))
fib1(X, Y) → cons(X, 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, XS)

The set Q consists of the following terms:

fib(x0)
fib1(x0, x1)
add(0, x0)
add(s(x0), x1)
sel(0, cons(x0, x1))
sel(s(x0), cons(x1, x2))


The TRS P is empty. Hence, there is no (P,Q,R,µ)-chain.