(0) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

active(fib(N)) → mark(sel(N, fib1(s(0), s(0))))
active(fib1(X, Y)) → mark(cons(X, fib1(Y, add(X, Y))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(sel(0, cons(X, XS))) → mark(X)
active(sel(s(N), cons(X, XS))) → mark(sel(N, XS))
active(fib(X)) → fib(active(X))
active(sel(X1, X2)) → sel(active(X1), X2)
active(sel(X1, X2)) → sel(X1, active(X2))
active(fib1(X1, X2)) → fib1(active(X1), X2)
active(fib1(X1, X2)) → fib1(X1, active(X2))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(add(X1, X2)) → add(active(X1), X2)
active(add(X1, X2)) → add(X1, active(X2))
fib(mark(X)) → mark(fib(X))
sel(mark(X1), X2) → mark(sel(X1, X2))
sel(X1, mark(X2)) → mark(sel(X1, X2))
fib1(mark(X1), X2) → mark(fib1(X1, X2))
fib1(X1, mark(X2)) → mark(fib1(X1, X2))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
add(mark(X1), X2) → mark(add(X1, X2))
add(X1, mark(X2)) → mark(add(X1, X2))
proper(fib(X)) → fib(proper(X))
proper(sel(X1, X2)) → sel(proper(X1), proper(X2))
proper(fib1(X1, X2)) → fib1(proper(X1), proper(X2))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(add(X1, X2)) → add(proper(X1), proper(X2))
fib(ok(X)) → ok(fib(X))
sel(ok(X1), ok(X2)) → ok(sel(X1, X2))
fib1(ok(X1), ok(X2)) → ok(fib1(X1, X2))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
add(ok(X1), ok(X2)) → ok(add(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

Q is empty.

(1) QTRSToCSRProof (EQUIVALENT transformation)

The following Q TRS is given: Q restricted rewrite system:
The TRS R consists of the following rules:

active(fib(N)) → mark(sel(N, fib1(s(0), s(0))))
active(fib1(X, Y)) → mark(cons(X, fib1(Y, add(X, Y))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(sel(0, cons(X, XS))) → mark(X)
active(sel(s(N), cons(X, XS))) → mark(sel(N, XS))
active(fib(X)) → fib(active(X))
active(sel(X1, X2)) → sel(active(X1), X2)
active(sel(X1, X2)) → sel(X1, active(X2))
active(fib1(X1, X2)) → fib1(active(X1), X2)
active(fib1(X1, X2)) → fib1(X1, active(X2))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(add(X1, X2)) → add(active(X1), X2)
active(add(X1, X2)) → add(X1, active(X2))
fib(mark(X)) → mark(fib(X))
sel(mark(X1), X2) → mark(sel(X1, X2))
sel(X1, mark(X2)) → mark(sel(X1, X2))
fib1(mark(X1), X2) → mark(fib1(X1, X2))
fib1(X1, mark(X2)) → mark(fib1(X1, X2))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
add(mark(X1), X2) → mark(add(X1, X2))
add(X1, mark(X2)) → mark(add(X1, X2))
proper(fib(X)) → fib(proper(X))
proper(sel(X1, X2)) → sel(proper(X1), proper(X2))
proper(fib1(X1, X2)) → fib1(proper(X1), proper(X2))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(add(X1, X2)) → add(proper(X1), proper(X2))
fib(ok(X)) → ok(fib(X))
sel(ok(X1), ok(X2)) → ok(sel(X1, X2))
fib1(ok(X1), ok(X2)) → ok(fib1(X1, X2))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
add(ok(X1), ok(X2)) → ok(add(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

Q is empty.
Special symbols used for the transformation (see [GM04]):
top: top, active: active, mark: mark, ok: ok, proper: proper
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 QTRS contained all rules created by the complete Giesl-Middeldorp transformation. Therefore, the inverse transformation is complete (and sound).

(2) Obligation:

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}

(3) CSRInnermostProof (EQUIVALENT transformation)

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

(4) Obligation:

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.

(5) CSDependencyPairsProof (EQUIVALENT transformation)

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

(6) Obligation:

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(x0, add(x1, x0))
add(x0, x1)

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(x0, add(x1, x0))) → FIB1(x0, add(x1, x0))
U(add(x0, x1)) → ADD(x0, x1)

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))

(7) QCSDependencyGraphProof (EQUIVALENT transformation)

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

(8) Complex Obligation (AND)

(9) Obligation:

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))

(10) QCSDPSubtermProof (EQUIVALENT transformation)

We use the subterm processor [DA_EMMES].


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

(11) Obligation:

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))

(12) PIsEmptyProof (EQUIVALENT transformation)

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

(13) TRUE

(14) Obligation:

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))

(15) QCSDPSubtermProof (EQUIVALENT transformation)

We use the subterm processor [DA_EMMES].


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

(16) Obligation:

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))

(17) PIsEmptyProof (EQUIVALENT transformation)

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

(18) TRUE

(19) Obligation:

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))

(20) QCSDPSubtermProof (EQUIVALENT transformation)

We use the subterm processor [DA_EMMES].


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

(21) Obligation:

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))

(22) PIsEmptyProof (EQUIVALENT transformation)

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

(23) TRUE