(0) Obligation:

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

a__first(0, X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
a__from(X) → cons(mark(X), from(s(X)))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(from(X)) → a__from(mark(X))
mark(0) → 0
mark(nil) → nil
mark(s(X)) → s(mark(X))
mark(cons(X1, X2)) → cons(mark(X1), X2)
a__first(X1, X2) → first(X1, X2)
a__from(X) → from(X)

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__FIRST(s(X), cons(Y, Z)) → MARK(Y)
A__FROM(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(from(X)) → A__FROM(mark(X))
MARK(from(X)) → MARK(X)
MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)

The TRS R consists of the following rules:

a__first(0, X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
a__from(X) → cons(mark(X), from(s(X)))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(from(X)) → a__from(mark(X))
mark(0) → 0
mark(nil) → nil
mark(s(X)) → s(mark(X))
mark(cons(X1, X2)) → cons(mark(X1), X2)
a__first(X1, X2) → first(X1, X2)
a__from(X) → from(X)

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

(3) QDPSizeChangeProof (EQUIVALENT transformation)

We used the following order and afs together with the size-change analysis [AAECC05] to show that there are no infinite chains for this DP problem.

Order:Combined order from the following AFS and order.
mark(x1)  =  x1
first(x1, x2)  =  first(x1, x2)
a__first(x1, x2)  =  a__first(x1, x2)
from(x1)  =  from(x1)
a__from(x1)  =  a__from(x1)
0  =  0
nil  =  nil
s(x1)  =  s(x1)
cons(x1, x2)  =  cons(x1)

Recursive path order with status [RPO].
Quasi-Precedence:

[from1, afrom1] > s1 > cons1 > [first2, afirst2] > nil

Status:
first2: multiset
afirst2: multiset
from1: multiset
afrom1: multiset
0: multiset
nil: multiset
s1: multiset
cons1: multiset

AFS:
mark(x1)  =  x1
first(x1, x2)  =  first(x1, x2)
a__first(x1, x2)  =  a__first(x1, x2)
from(x1)  =  from(x1)
a__from(x1)  =  a__from(x1)
0  =  0
nil  =  nil
s(x1)  =  s(x1)
cons(x1, x2)  =  cons(x1)

From the DPs we obtained the following set of size-change graphs:

  • MARK(first(X1, X2)) → A__FIRST(mark(X1), mark(X2)) (allowed arguments on rhs = {2})
    The graph contains the following edges 1 > 2

  • MARK(from(X)) → A__FROM(mark(X)) (allowed arguments on rhs = {1})
    The graph contains the following edges 1 > 1

  • A__FIRST(s(X), cons(Y, Z)) → MARK(Y) (allowed arguments on rhs = {1})
    The graph contains the following edges 2 > 1

  • A__FROM(X) → MARK(X) (allowed arguments on rhs = {1})
    The graph contains the following edges 1 >= 1

  • MARK(first(X1, X2)) → MARK(X1) (allowed arguments on rhs = {1})
    The graph contains the following edges 1 > 1

  • MARK(first(X1, X2)) → MARK(X2) (allowed arguments on rhs = {1})
    The graph contains the following edges 1 > 1

  • MARK(from(X)) → MARK(X) (allowed arguments on rhs = {1})
    The graph contains the following edges 1 > 1

  • MARK(s(X)) → MARK(X) (allowed arguments on rhs = {1})
    The graph contains the following edges 1 > 1

  • MARK(cons(X1, X2)) → MARK(X1) (allowed arguments on rhs = {1})
    The graph contains the following edges 1 > 1

We oriented the following set of usable rules [AAECC05,FROCOS05].


mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(from(X)) → a__from(mark(X))
mark(0) → 0
mark(nil) → nil
mark(s(X)) → s(mark(X))
mark(cons(X1, X2)) → cons(mark(X1), X2)
a__from(X) → cons(mark(X), from(s(X)))
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
a__from(X) → from(X)
a__first(0, X) → nil
a__first(X1, X2) → first(X1, X2)

(4) TRUE