(0) Obligation:

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

a__terms(N) → cons(recip(a__sqr(mark(N))), terms(s(N)))
a__sqr(0) → 0
a__sqr(s(X)) → s(add(sqr(X), dbl(X)))
a__dbl(0) → 0
a__dbl(s(X)) → s(s(dbl(X)))
a__add(0, X) → mark(X)
a__add(s(X), Y) → s(add(X, Y))
a__first(0, X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
mark(terms(X)) → a__terms(mark(X))
mark(sqr(X)) → a__sqr(mark(X))
mark(add(X1, X2)) → a__add(mark(X1), mark(X2))
mark(dbl(X)) → a__dbl(mark(X))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(recip(X)) → recip(mark(X))
mark(s(X)) → s(X)
mark(0) → 0
mark(nil) → nil
a__terms(X) → terms(X)
a__sqr(X) → sqr(X)
a__add(X1, X2) → add(X1, X2)
a__dbl(X) → dbl(X)
a__first(X1, X2) → first(X1, X2)

Q is empty.

(1) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem.

(2) Obligation:

Q DP problem:
The TRS P consists of the following rules:

A__TERMS(N) → A__SQR(mark(N))
A__TERMS(N) → MARK(N)
A__ADD(0, X) → MARK(X)
A__FIRST(s(X), cons(Y, Z)) → MARK(Y)
MARK(terms(X)) → A__TERMS(mark(X))
MARK(terms(X)) → MARK(X)
MARK(sqr(X)) → A__SQR(mark(X))
MARK(sqr(X)) → MARK(X)
MARK(add(X1, X2)) → A__ADD(mark(X1), mark(X2))
MARK(add(X1, X2)) → MARK(X1)
MARK(add(X1, X2)) → MARK(X2)
MARK(dbl(X)) → A__DBL(mark(X))
MARK(dbl(X)) → MARK(X)
MARK(first(X1, X2)) → A__FIRST(mark(X1), mark(X2))
MARK(first(X1, X2)) → MARK(X1)
MARK(first(X1, X2)) → MARK(X2)
MARK(cons(X1, X2)) → MARK(X1)
MARK(recip(X)) → MARK(X)

The TRS R consists of the following rules:

a__terms(N) → cons(recip(a__sqr(mark(N))), terms(s(N)))
a__sqr(0) → 0
a__sqr(s(X)) → s(add(sqr(X), dbl(X)))
a__dbl(0) → 0
a__dbl(s(X)) → s(s(dbl(X)))
a__add(0, X) → mark(X)
a__add(s(X), Y) → s(add(X, Y))
a__first(0, X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
mark(terms(X)) → a__terms(mark(X))
mark(sqr(X)) → a__sqr(mark(X))
mark(add(X1, X2)) → a__add(mark(X1), mark(X2))
mark(dbl(X)) → a__dbl(mark(X))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(recip(X)) → recip(mark(X))
mark(s(X)) → s(X)
mark(0) → 0
mark(nil) → nil
a__terms(X) → terms(X)
a__sqr(X) → sqr(X)
a__add(X1, X2) → add(X1, X2)
a__dbl(X) → dbl(X)
a__first(X1, X2) → first(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(3) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 3 less nodes.

(4) Obligation:

Q DP problem:
The TRS P consists of the following rules:

A__TERMS(N) → MARK(N)
MARK(terms(X)) → A__TERMS(mark(X))
MARK(terms(X)) → MARK(X)
MARK(sqr(X)) → MARK(X)
MARK(add(X1, X2)) → A__ADD(mark(X1), mark(X2))
A__ADD(0, X) → MARK(X)
MARK(add(X1, X2)) → MARK(X1)
MARK(add(X1, X2)) → MARK(X2)
MARK(dbl(X)) → MARK(X)
MARK(first(X1, X2)) → A__FIRST(mark(X1), mark(X2))
A__FIRST(s(X), cons(Y, Z)) → MARK(Y)
MARK(first(X1, X2)) → MARK(X1)
MARK(first(X1, X2)) → MARK(X2)
MARK(cons(X1, X2)) → MARK(X1)
MARK(recip(X)) → MARK(X)

The TRS R consists of the following rules:

a__terms(N) → cons(recip(a__sqr(mark(N))), terms(s(N)))
a__sqr(0) → 0
a__sqr(s(X)) → s(add(sqr(X), dbl(X)))
a__dbl(0) → 0
a__dbl(s(X)) → s(s(dbl(X)))
a__add(0, X) → mark(X)
a__add(s(X), Y) → s(add(X, Y))
a__first(0, X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
mark(terms(X)) → a__terms(mark(X))
mark(sqr(X)) → a__sqr(mark(X))
mark(add(X1, X2)) → a__add(mark(X1), mark(X2))
mark(dbl(X)) → a__dbl(mark(X))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(recip(X)) → recip(mark(X))
mark(s(X)) → s(X)
mark(0) → 0
mark(nil) → nil
a__terms(X) → terms(X)
a__sqr(X) → sqr(X)
a__add(X1, X2) → add(X1, X2)
a__dbl(X) → dbl(X)
a__first(X1, X2) → first(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(5) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


MARK(terms(X)) → A__TERMS(mark(X))
MARK(terms(X)) → MARK(X)
A__ADD(0, X) → MARK(X)
MARK(add(X1, X2)) → MARK(X1)
MARK(add(X1, X2)) → MARK(X2)
A__FIRST(s(X), cons(Y, Z)) → MARK(Y)
MARK(first(X1, X2)) → MARK(X1)
MARK(first(X1, X2)) → MARK(X2)
MARK(cons(X1, X2)) → MARK(X1)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
A__TERMS(x1)  =  x1
MARK(x1)  =  x1
terms(x1)  =  terms(x1)
mark(x1)  =  x1
sqr(x1)  =  x1
add(x1, x2)  =  add(x1, x2)
A__ADD(x1, x2)  =  A__ADD(x1, x2)
0  =  0
dbl(x1)  =  x1
first(x1, x2)  =  first(x1, x2)
A__FIRST(x1, x2)  =  A__FIRST(x1, x2)
s(x1)  =  s
cons(x1, x2)  =  cons(x1)
recip(x1)  =  x1
a__terms(x1)  =  a__terms(x1)
a__sqr(x1)  =  x1
a__dbl(x1)  =  x1
a__add(x1, x2)  =  a__add(x1, x2)
a__first(x1, x2)  =  a__first(x1, x2)
nil  =  nil

Recursive Path Order [RPO].
Precedence:
0 > nil
s > [add2, AADD2, aadd2] > nil
s > [first2, AFIRST2, afirst2] > [terms1, cons1, aterms1] > nil


The following usable rules [FROCOS05] were oriented:

a__terms(N) → cons(recip(a__sqr(mark(N))), terms(s(N)))
a__sqr(0) → 0
a__sqr(s(X)) → s(add(sqr(X), dbl(X)))
a__dbl(0) → 0
a__dbl(s(X)) → s(s(dbl(X)))
a__add(0, X) → mark(X)
a__add(s(X), Y) → s(add(X, Y))
a__first(0, X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
mark(terms(X)) → a__terms(mark(X))
mark(sqr(X)) → a__sqr(mark(X))
mark(add(X1, X2)) → a__add(mark(X1), mark(X2))
mark(dbl(X)) → a__dbl(mark(X))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(recip(X)) → recip(mark(X))
mark(s(X)) → s(X)
mark(0) → 0
mark(nil) → nil
a__terms(X) → terms(X)
a__sqr(X) → sqr(X)
a__add(X1, X2) → add(X1, X2)
a__dbl(X) → dbl(X)
a__first(X1, X2) → first(X1, X2)

(6) Obligation:

Q DP problem:
The TRS P consists of the following rules:

A__TERMS(N) → MARK(N)
MARK(sqr(X)) → MARK(X)
MARK(add(X1, X2)) → A__ADD(mark(X1), mark(X2))
MARK(dbl(X)) → MARK(X)
MARK(first(X1, X2)) → A__FIRST(mark(X1), mark(X2))
MARK(recip(X)) → MARK(X)

The TRS R consists of the following rules:

a__terms(N) → cons(recip(a__sqr(mark(N))), terms(s(N)))
a__sqr(0) → 0
a__sqr(s(X)) → s(add(sqr(X), dbl(X)))
a__dbl(0) → 0
a__dbl(s(X)) → s(s(dbl(X)))
a__add(0, X) → mark(X)
a__add(s(X), Y) → s(add(X, Y))
a__first(0, X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
mark(terms(X)) → a__terms(mark(X))
mark(sqr(X)) → a__sqr(mark(X))
mark(add(X1, X2)) → a__add(mark(X1), mark(X2))
mark(dbl(X)) → a__dbl(mark(X))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(recip(X)) → recip(mark(X))
mark(s(X)) → s(X)
mark(0) → 0
mark(nil) → nil
a__terms(X) → terms(X)
a__sqr(X) → sqr(X)
a__add(X1, X2) → add(X1, X2)
a__dbl(X) → dbl(X)
a__first(X1, X2) → first(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(7) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 3 less nodes.

(8) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MARK(dbl(X)) → MARK(X)
MARK(sqr(X)) → MARK(X)
MARK(recip(X)) → MARK(X)

The TRS R consists of the following rules:

a__terms(N) → cons(recip(a__sqr(mark(N))), terms(s(N)))
a__sqr(0) → 0
a__sqr(s(X)) → s(add(sqr(X), dbl(X)))
a__dbl(0) → 0
a__dbl(s(X)) → s(s(dbl(X)))
a__add(0, X) → mark(X)
a__add(s(X), Y) → s(add(X, Y))
a__first(0, X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
mark(terms(X)) → a__terms(mark(X))
mark(sqr(X)) → a__sqr(mark(X))
mark(add(X1, X2)) → a__add(mark(X1), mark(X2))
mark(dbl(X)) → a__dbl(mark(X))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(recip(X)) → recip(mark(X))
mark(s(X)) → s(X)
mark(0) → 0
mark(nil) → nil
a__terms(X) → terms(X)
a__sqr(X) → sqr(X)
a__add(X1, X2) → add(X1, X2)
a__dbl(X) → dbl(X)
a__first(X1, X2) → first(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(9) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


MARK(recip(X)) → MARK(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
MARK(x1)  =  MARK(x1)
dbl(x1)  =  x1
sqr(x1)  =  x1
recip(x1)  =  recip(x1)
a__terms(x1)  =  x1
cons(x1, x2)  =  cons
a__sqr(x1)  =  x1
mark(x1)  =  mark(x1)
terms(x1)  =  x1
s(x1)  =  s
0  =  0
add(x1, x2)  =  add(x2)
a__dbl(x1)  =  x1
a__add(x1, x2)  =  a__add(x2)
a__first(x1, x2)  =  a__first(x1, x2)
nil  =  nil
first(x1, x2)  =  first(x1, x2)

Recursive Path Order [RPO].
Precedence:
[recip1, mark1, s, add1, aadd1] > MARK1 > cons
[recip1, mark1, s, add1, aadd1] > 0 > cons
[recip1, mark1, s, add1, aadd1] > [afirst2, nil] > first2 > cons


The following usable rules [FROCOS05] were oriented:

a__terms(N) → cons(recip(a__sqr(mark(N))), terms(s(N)))
a__sqr(0) → 0
a__sqr(s(X)) → s(add(sqr(X), dbl(X)))
a__dbl(0) → 0
a__dbl(s(X)) → s(s(dbl(X)))
a__add(0, X) → mark(X)
a__add(s(X), Y) → s(add(X, Y))
a__first(0, X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
mark(terms(X)) → a__terms(mark(X))
mark(sqr(X)) → a__sqr(mark(X))
mark(add(X1, X2)) → a__add(mark(X1), mark(X2))
mark(dbl(X)) → a__dbl(mark(X))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(recip(X)) → recip(mark(X))
mark(s(X)) → s(X)
mark(0) → 0
mark(nil) → nil
a__terms(X) → terms(X)
a__sqr(X) → sqr(X)
a__add(X1, X2) → add(X1, X2)
a__dbl(X) → dbl(X)
a__first(X1, X2) → first(X1, X2)

(10) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MARK(dbl(X)) → MARK(X)
MARK(sqr(X)) → MARK(X)

The TRS R consists of the following rules:

a__terms(N) → cons(recip(a__sqr(mark(N))), terms(s(N)))
a__sqr(0) → 0
a__sqr(s(X)) → s(add(sqr(X), dbl(X)))
a__dbl(0) → 0
a__dbl(s(X)) → s(s(dbl(X)))
a__add(0, X) → mark(X)
a__add(s(X), Y) → s(add(X, Y))
a__first(0, X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
mark(terms(X)) → a__terms(mark(X))
mark(sqr(X)) → a__sqr(mark(X))
mark(add(X1, X2)) → a__add(mark(X1), mark(X2))
mark(dbl(X)) → a__dbl(mark(X))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(recip(X)) → recip(mark(X))
mark(s(X)) → s(X)
mark(0) → 0
mark(nil) → nil
a__terms(X) → terms(X)
a__sqr(X) → sqr(X)
a__add(X1, X2) → add(X1, X2)
a__dbl(X) → dbl(X)
a__first(X1, X2) → first(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(11) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


MARK(sqr(X)) → MARK(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
MARK(x1)  =  MARK(x1)
dbl(x1)  =  x1
sqr(x1)  =  sqr(x1)
a__terms(x1)  =  a__terms
cons(x1, x2)  =  cons(x2)
recip(x1)  =  recip(x1)
a__sqr(x1)  =  a__sqr(x1)
mark(x1)  =  mark(x1)
terms(x1)  =  terms
s(x1)  =  s
0  =  0
add(x1, x2)  =  add(x2)
a__dbl(x1)  =  x1
a__add(x1, x2)  =  a__add(x2)
a__first(x1, x2)  =  x2
nil  =  nil
first(x1, x2)  =  x2

Recursive Path Order [RPO].
Precedence:
[aterms, recip1, mark1, add1, aadd1] > cons1 > [MARK1, sqr1, asqr1, s, 0, nil]
[aterms, recip1, mark1, add1, aadd1] > terms > [MARK1, sqr1, asqr1, s, 0, nil]


The following usable rules [FROCOS05] were oriented:

a__terms(N) → cons(recip(a__sqr(mark(N))), terms(s(N)))
a__sqr(0) → 0
a__sqr(s(X)) → s(add(sqr(X), dbl(X)))
a__dbl(0) → 0
a__dbl(s(X)) → s(s(dbl(X)))
a__add(0, X) → mark(X)
a__add(s(X), Y) → s(add(X, Y))
a__first(0, X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
mark(terms(X)) → a__terms(mark(X))
mark(sqr(X)) → a__sqr(mark(X))
mark(add(X1, X2)) → a__add(mark(X1), mark(X2))
mark(dbl(X)) → a__dbl(mark(X))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(recip(X)) → recip(mark(X))
mark(s(X)) → s(X)
mark(0) → 0
mark(nil) → nil
a__terms(X) → terms(X)
a__sqr(X) → sqr(X)
a__add(X1, X2) → add(X1, X2)
a__dbl(X) → dbl(X)
a__first(X1, X2) → first(X1, X2)

(12) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MARK(dbl(X)) → MARK(X)

The TRS R consists of the following rules:

a__terms(N) → cons(recip(a__sqr(mark(N))), terms(s(N)))
a__sqr(0) → 0
a__sqr(s(X)) → s(add(sqr(X), dbl(X)))
a__dbl(0) → 0
a__dbl(s(X)) → s(s(dbl(X)))
a__add(0, X) → mark(X)
a__add(s(X), Y) → s(add(X, Y))
a__first(0, X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
mark(terms(X)) → a__terms(mark(X))
mark(sqr(X)) → a__sqr(mark(X))
mark(add(X1, X2)) → a__add(mark(X1), mark(X2))
mark(dbl(X)) → a__dbl(mark(X))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(recip(X)) → recip(mark(X))
mark(s(X)) → s(X)
mark(0) → 0
mark(nil) → nil
a__terms(X) → terms(X)
a__sqr(X) → sqr(X)
a__add(X1, X2) → add(X1, X2)
a__dbl(X) → dbl(X)
a__first(X1, X2) → first(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(13) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


MARK(dbl(X)) → MARK(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
MARK(x1)  =  x1
dbl(x1)  =  dbl(x1)
a__terms(x1)  =  x1
cons(x1, x2)  =  x2
recip(x1)  =  recip(x1)
a__sqr(x1)  =  x1
mark(x1)  =  x1
terms(x1)  =  x1
s(x1)  =  s
0  =  0
add(x1, x2)  =  add(x1, x2)
sqr(x1)  =  x1
a__dbl(x1)  =  a__dbl(x1)
a__add(x1, x2)  =  a__add(x1, x2)
a__first(x1, x2)  =  x2
nil  =  nil
first(x1, x2)  =  x2

Recursive Path Order [RPO].
Precedence:
[dbl1, 0, adbl1] > [s, nil]
recip1 > [s, nil]
[add2, aadd2] > [s, nil]


The following usable rules [FROCOS05] were oriented:

a__terms(N) → cons(recip(a__sqr(mark(N))), terms(s(N)))
a__sqr(0) → 0
a__sqr(s(X)) → s(add(sqr(X), dbl(X)))
a__dbl(0) → 0
a__dbl(s(X)) → s(s(dbl(X)))
a__add(0, X) → mark(X)
a__add(s(X), Y) → s(add(X, Y))
a__first(0, X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
mark(terms(X)) → a__terms(mark(X))
mark(sqr(X)) → a__sqr(mark(X))
mark(add(X1, X2)) → a__add(mark(X1), mark(X2))
mark(dbl(X)) → a__dbl(mark(X))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(recip(X)) → recip(mark(X))
mark(s(X)) → s(X)
mark(0) → 0
mark(nil) → nil
a__terms(X) → terms(X)
a__sqr(X) → sqr(X)
a__add(X1, X2) → add(X1, X2)
a__dbl(X) → dbl(X)
a__first(X1, X2) → first(X1, X2)

(14) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

a__terms(N) → cons(recip(a__sqr(mark(N))), terms(s(N)))
a__sqr(0) → 0
a__sqr(s(X)) → s(add(sqr(X), dbl(X)))
a__dbl(0) → 0
a__dbl(s(X)) → s(s(dbl(X)))
a__add(0, X) → mark(X)
a__add(s(X), Y) → s(add(X, Y))
a__first(0, X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
mark(terms(X)) → a__terms(mark(X))
mark(sqr(X)) → a__sqr(mark(X))
mark(add(X1, X2)) → a__add(mark(X1), mark(X2))
mark(dbl(X)) → a__dbl(mark(X))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(recip(X)) → recip(mark(X))
mark(s(X)) → s(X)
mark(0) → 0
mark(nil) → nil
a__terms(X) → terms(X)
a__sqr(X) → sqr(X)
a__add(X1, X2) → add(X1, X2)
a__dbl(X) → dbl(X)
a__first(X1, X2) → first(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(15) PisEmptyProof (EQUIVALENT transformation)

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

(16) TRUE