(0) Obligation:

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

active(from(X)) → mark(cons(X, from(s(X))))
active(sel(0, cons(X, XS))) → mark(X)
active(sel(s(N), cons(X, XS))) → mark(sel(N, XS))
active(minus(X, 0)) → mark(0)
active(minus(s(X), s(Y))) → mark(minus(X, Y))
active(quot(0, s(Y))) → mark(0)
active(quot(s(X), s(Y))) → mark(s(quot(minus(X, Y), s(Y))))
active(zWquot(XS, nil)) → mark(nil)
active(zWquot(nil, XS)) → mark(nil)
active(zWquot(cons(X, XS), cons(Y, YS))) → mark(cons(quot(X, Y), zWquot(XS, YS)))
active(from(X)) → from(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(s(X)) → s(active(X))
active(sel(X1, X2)) → sel(active(X1), X2)
active(sel(X1, X2)) → sel(X1, active(X2))
active(minus(X1, X2)) → minus(active(X1), X2)
active(minus(X1, X2)) → minus(X1, active(X2))
active(quot(X1, X2)) → quot(active(X1), X2)
active(quot(X1, X2)) → quot(X1, active(X2))
active(zWquot(X1, X2)) → zWquot(active(X1), X2)
active(zWquot(X1, X2)) → zWquot(X1, active(X2))
from(mark(X)) → mark(from(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
s(mark(X)) → mark(s(X))
sel(mark(X1), X2) → mark(sel(X1, X2))
sel(X1, mark(X2)) → mark(sel(X1, X2))
minus(mark(X1), X2) → mark(minus(X1, X2))
minus(X1, mark(X2)) → mark(minus(X1, X2))
quot(mark(X1), X2) → mark(quot(X1, X2))
quot(X1, mark(X2)) → mark(quot(X1, X2))
zWquot(mark(X1), X2) → mark(zWquot(X1, X2))
zWquot(X1, mark(X2)) → mark(zWquot(X1, X2))
proper(from(X)) → from(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(s(X)) → s(proper(X))
proper(sel(X1, X2)) → sel(proper(X1), proper(X2))
proper(0) → ok(0)
proper(minus(X1, X2)) → minus(proper(X1), proper(X2))
proper(quot(X1, X2)) → quot(proper(X1), proper(X2))
proper(zWquot(X1, X2)) → zWquot(proper(X1), proper(X2))
proper(nil) → ok(nil)
from(ok(X)) → ok(from(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
s(ok(X)) → ok(s(X))
sel(ok(X1), ok(X2)) → ok(sel(X1, X2))
minus(ok(X1), ok(X2)) → ok(minus(X1, X2))
quot(ok(X1), ok(X2)) → ok(quot(X1, X2))
zWquot(ok(X1), ok(X2)) → ok(zWquot(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(from(X)) → mark(cons(X, from(s(X))))
active(sel(0, cons(X, XS))) → mark(X)
active(sel(s(N), cons(X, XS))) → mark(sel(N, XS))
active(minus(X, 0)) → mark(0)
active(minus(s(X), s(Y))) → mark(minus(X, Y))
active(quot(0, s(Y))) → mark(0)
active(quot(s(X), s(Y))) → mark(s(quot(minus(X, Y), s(Y))))
active(zWquot(XS, nil)) → mark(nil)
active(zWquot(nil, XS)) → mark(nil)
active(zWquot(cons(X, XS), cons(Y, YS))) → mark(cons(quot(X, Y), zWquot(XS, YS)))
active(from(X)) → from(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(s(X)) → s(active(X))
active(sel(X1, X2)) → sel(active(X1), X2)
active(sel(X1, X2)) → sel(X1, active(X2))
active(minus(X1, X2)) → minus(active(X1), X2)
active(minus(X1, X2)) → minus(X1, active(X2))
active(quot(X1, X2)) → quot(active(X1), X2)
active(quot(X1, X2)) → quot(X1, active(X2))
active(zWquot(X1, X2)) → zWquot(active(X1), X2)
active(zWquot(X1, X2)) → zWquot(X1, active(X2))
from(mark(X)) → mark(from(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
s(mark(X)) → mark(s(X))
sel(mark(X1), X2) → mark(sel(X1, X2))
sel(X1, mark(X2)) → mark(sel(X1, X2))
minus(mark(X1), X2) → mark(minus(X1, X2))
minus(X1, mark(X2)) → mark(minus(X1, X2))
quot(mark(X1), X2) → mark(quot(X1, X2))
quot(X1, mark(X2)) → mark(quot(X1, X2))
zWquot(mark(X1), X2) → mark(zWquot(X1, X2))
zWquot(X1, mark(X2)) → mark(zWquot(X1, X2))
proper(from(X)) → from(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(s(X)) → s(proper(X))
proper(sel(X1, X2)) → sel(proper(X1), proper(X2))
proper(0) → ok(0)
proper(minus(X1, X2)) → minus(proper(X1), proper(X2))
proper(quot(X1, X2)) → quot(proper(X1), proper(X2))
proper(zWquot(X1, X2)) → zWquot(proper(X1), proper(X2))
proper(nil) → ok(nil)
from(ok(X)) → ok(from(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
s(ok(X)) → ok(s(X))
sel(ok(X1), ok(X2)) → ok(sel(X1, X2))
minus(ok(X1), ok(X2)) → ok(minus(X1, X2))
quot(ok(X1), ok(X2)) → ok(quot(X1, X2))
zWquot(ok(X1), ok(X2)) → ok(zWquot(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:

from: {1}
cons: {1}
s: {1}
sel: {1, 2}
0: empty set
minus: {1, 2}
quot: {1, 2}
zWquot: {1, 2}
nil: empty set
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:

from(X) → cons(X, from(s(X)))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, XS)
minus(X, 0) → 0
minus(s(X), s(Y)) → minus(X, Y)
quot(0, s(Y)) → 0
quot(s(X), s(Y)) → s(quot(minus(X, Y), s(Y)))
zWquot(XS, nil) → nil
zWquot(nil, XS) → nil
zWquot(cons(X, XS), cons(Y, YS)) → cons(quot(X, Y), zWquot(XS, YS))

The replacement map contains the following entries:

from: {1}
cons: {1}
s: {1}
sel: {1, 2}
0: empty set
minus: {1, 2}
quot: {1, 2}
zWquot: {1, 2}
nil: empty set

(3) CSDependencyPairsProof (EQUIVALENT transformation)

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

(4) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {from, s, sel, minus, quot, zWquot, SEL, MINUS, QUOT, ZWQUOT, FROM} 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:

SEL(s(N), cons(X, XS)) → SEL(N, XS)
MINUS(s(X), s(Y)) → MINUS(X, Y)
QUOT(s(X), s(Y)) → QUOT(minus(X, Y), s(Y))
QUOT(s(X), s(Y)) → MINUS(X, Y)
ZWQUOT(cons(X, XS), cons(Y, YS)) → QUOT(X, Y)

The collapsing dependency pairs are DPc:

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


The hidden terms of R are:

from(s(x0))
zWquot(x0, x1)

Every hiding context is built from:

s on positions {1}
from on positions {1}
zWquot on positions {1, 2}

Hence, the new unhiding pairs DPu are :

SEL(s(N), cons(X, XS)) → U(XS)
U(s(x_0)) → U(x_0)
U(from(x_0)) → U(x_0)
U(zWquot(x_0, x_1)) → U(x_0)
U(zWquot(x_0, x_1)) → U(x_1)
U(from(s(x0))) → FROM(s(x0))
U(zWquot(x0, x1)) → ZWQUOT(x0, x1)

The TRS R consists of the following rules:

from(X) → cons(X, from(s(X)))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, XS)
minus(X, 0) → 0
minus(s(X), s(Y)) → minus(X, Y)
quot(0, s(Y)) → 0
quot(s(X), s(Y)) → s(quot(minus(X, Y), s(Y)))
zWquot(XS, nil) → nil
zWquot(nil, XS) → nil
zWquot(cons(X, XS), cons(Y, YS)) → cons(quot(X, Y), zWquot(XS, YS))

Q is empty.

(5) QCSDependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) Obligation:

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

The TRS P consists of the following rules:

MINUS(s(X), s(Y)) → MINUS(X, Y)

The TRS R consists of the following rules:

from(X) → cons(X, from(s(X)))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, XS)
minus(X, 0) → 0
minus(s(X), s(Y)) → minus(X, Y)
quot(0, s(Y)) → 0
quot(s(X), s(Y)) → s(quot(minus(X, Y), s(Y)))
zWquot(XS, nil) → nil
zWquot(nil, XS) → nil
zWquot(cons(X, XS), cons(Y, YS)) → cons(quot(X, Y), zWquot(XS, YS))

Q is empty.

(8) QCSDPSubtermProof (EQUIVALENT transformation)

We use the subterm processor [DA_EMMES].


The following pairs can be oriented strictly and are deleted.


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

Subterm Order

(9) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {from, s, sel, minus, quot, zWquot} 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:

from(X) → cons(X, from(s(X)))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, XS)
minus(X, 0) → 0
minus(s(X), s(Y)) → minus(X, Y)
quot(0, s(Y)) → 0
quot(s(X), s(Y)) → s(quot(minus(X, Y), s(Y)))
zWquot(XS, nil) → nil
zWquot(nil, XS) → nil
zWquot(cons(X, XS), cons(Y, YS)) → cons(quot(X, Y), zWquot(XS, YS))

Q is empty.

(10) PIsEmptyProof (EQUIVALENT transformation)

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

(11) TRUE

(12) Obligation:

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

The TRS P consists of the following rules:

QUOT(s(X), s(Y)) → QUOT(minus(X, Y), s(Y))

The TRS R consists of the following rules:

from(X) → cons(X, from(s(X)))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, XS)
minus(X, 0) → 0
minus(s(X), s(Y)) → minus(X, Y)
quot(0, s(Y)) → 0
quot(s(X), s(Y)) → s(quot(minus(X, Y), s(Y)))
zWquot(XS, nil) → nil
zWquot(nil, XS) → nil
zWquot(cons(X, XS), cons(Y, YS)) → cons(quot(X, Y), zWquot(XS, YS))

Q is empty.

(13) QCSDPReductionPairProof (EQUIVALENT transformation)

Using the order
Polynomial interpretation with max and min functions [POLO,MAXPOLO]:

POL(0) = 0   
POL(QUOT(x1, x2)) = x1   
POL(cons(x1, x2)) = x1   
POL(from(x1)) = 1 + x1   
POL(minus(x1, x2)) = 0   
POL(nil) = 1   
POL(quot(x1, x2)) = 1   
POL(s(x1)) = 1   
POL(zWquot(x1, x2)) = 1 + x2   

the following usable rules

minus(X, 0) → 0
minus(s(X), s(Y)) → minus(X, Y)
quot(0, s(Y)) → 0
quot(s(X), s(Y)) → s(quot(minus(X, Y), s(Y)))
from(X) → cons(X, from(s(X)))
zWquot(XS, nil) → nil
zWquot(nil, XS) → nil
zWquot(cons(X, XS), cons(Y, YS)) → cons(quot(X, Y), zWquot(XS, YS))

could all be oriented weakly.
Furthermore, the pairs

QUOT(s(X), s(Y)) → QUOT(minus(X, Y), s(Y))

could be oriented strictly and thus removed by the CS-Reduction Pair Processor [LPAR08,DA_EMMES].

(14) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {from, s, sel, minus, quot, zWquot} 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:

from(X) → cons(X, from(s(X)))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, XS)
minus(X, 0) → 0
minus(s(X), s(Y)) → minus(X, Y)
quot(0, s(Y)) → 0
quot(s(X), s(Y)) → s(quot(minus(X, Y), s(Y)))
zWquot(XS, nil) → nil
zWquot(nil, XS) → nil
zWquot(cons(X, XS), cons(Y, YS)) → cons(quot(X, Y), zWquot(XS, YS))

Q is empty.

(15) PIsEmptyProof (EQUIVALENT transformation)

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

(16) TRUE

(17) QCSDPReductionPairProof (EQUIVALENT transformation)

Using the order
Polynomial interpretation [POLO]:

POL(0) = 0   
POL(QUOT(x1, x2)) = 2·x1   
POL(cons(x1, x2)) = 2 + x1   
POL(from(x1)) = 2 + x1   
POL(minus(x1, x2)) = 0   
POL(nil) = 2   
POL(quot(x1, x2)) = 1 + x1 + x2   
POL(s(x1)) = 2   
POL(zWquot(x1, x2)) = 2·x1 + 2·x2   

the following usable rules

minus(X, 0) → 0
minus(s(X), s(Y)) → minus(X, Y)
quot(0, s(Y)) → 0
quot(s(X), s(Y)) → s(quot(minus(X, Y), s(Y)))
from(X) → cons(X, from(s(X)))
zWquot(XS, nil) → nil
zWquot(nil, XS) → nil
zWquot(cons(X, XS), cons(Y, YS)) → cons(quot(X, Y), zWquot(XS, YS))

could all be oriented weakly.
Furthermore, the pairs

QUOT(s(X), s(Y)) → QUOT(minus(X, Y), s(Y))

could be oriented strictly and thus removed by the CS-Reduction Pair Processor [LPAR08,DA_EMMES].

(18) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {from, s, sel, minus, quot, zWquot} 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:

from(X) → cons(X, from(s(X)))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, XS)
minus(X, 0) → 0
minus(s(X), s(Y)) → minus(X, Y)
quot(0, s(Y)) → 0
quot(s(X), s(Y)) → s(quot(minus(X, Y), s(Y)))
zWquot(XS, nil) → nil
zWquot(nil, XS) → nil
zWquot(cons(X, XS), cons(Y, YS)) → cons(quot(X, Y), zWquot(XS, YS))

Q is empty.

(19) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {from, s, sel, minus, quot, zWquot} 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(s(x_0)) → U(x_0)
U(from(x_0)) → U(x_0)
U(zWquot(x_0, x_1)) → U(x_0)
U(zWquot(x_0, x_1)) → U(x_1)

The TRS R consists of the following rules:

from(X) → cons(X, from(s(X)))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, XS)
minus(X, 0) → 0
minus(s(X), s(Y)) → minus(X, Y)
quot(0, s(Y)) → 0
quot(s(X), s(Y)) → s(quot(minus(X, Y), s(Y)))
zWquot(XS, nil) → nil
zWquot(nil, XS) → nil
zWquot(cons(X, XS), cons(Y, YS)) → cons(quot(X, Y), zWquot(XS, YS))

Q is empty.

(20) QCSDPSubtermProof (EQUIVALENT transformation)

We use the subterm processor [DA_EMMES].


The following pairs can be oriented strictly and are deleted.


U(s(x_0)) → U(x_0)
U(from(x_0)) → U(x_0)
U(zWquot(x_0, x_1)) → U(x_0)
U(zWquot(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

(21) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {from, s, sel, minus, quot, zWquot} 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:

from(X) → cons(X, from(s(X)))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, XS)
minus(X, 0) → 0
minus(s(X), s(Y)) → minus(X, Y)
quot(0, s(Y)) → 0
quot(s(X), s(Y)) → s(quot(minus(X, Y), s(Y)))
zWquot(XS, nil) → nil
zWquot(nil, XS) → nil
zWquot(cons(X, XS), cons(Y, YS)) → cons(quot(X, Y), zWquot(XS, YS))

Q is empty.

(22) PIsEmptyProof (EQUIVALENT transformation)

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

(23) TRUE

(24) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {from, s, sel, minus, quot, zWquot, 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:

from(X) → cons(X, from(s(X)))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, XS)
minus(X, 0) → 0
minus(s(X), s(Y)) → minus(X, Y)
quot(0, s(Y)) → 0
quot(s(X), s(Y)) → s(quot(minus(X, Y), s(Y)))
zWquot(XS, nil) → nil
zWquot(nil, XS) → nil
zWquot(cons(X, XS), cons(Y, YS)) → cons(quot(X, Y), zWquot(XS, YS))

Q is empty.

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

(26) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {from, s, sel, minus, quot, zWquot} 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:

from(X) → cons(X, from(s(X)))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, XS)
minus(X, 0) → 0
minus(s(X), s(Y)) → minus(X, Y)
quot(0, s(Y)) → 0
quot(s(X), s(Y)) → s(quot(minus(X, Y), s(Y)))
zWquot(XS, nil) → nil
zWquot(nil, XS) → nil
zWquot(cons(X, XS), cons(Y, YS)) → cons(quot(X, Y), zWquot(XS, YS))

Q is empty.

(27) PIsEmptyProof (EQUIVALENT transformation)

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

(28) TRUE