Term Rewriting System R:
[X, Z, Y, X1, X2]
afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
afirst(0, Z) -> nil
afirst(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
afirst(X1, X2) -> first(X1, X2)
asel(0, cons(X, Z)) -> mark(X)
asel(s(X), cons(Y, Z)) -> asel(mark(X), mark(Z))
asel(X1, X2) -> sel(X1, X2)
mark(from(X)) -> afrom(mark(X))
mark(first(X1, X2)) -> afirst(mark(X1), mark(X2))
mark(sel(X1, X2)) -> asel(mark(X1), mark(X2))
mark(cons(X1, X2)) -> cons(mark(X1), X2)
mark(s(X)) -> s(mark(X))
mark(0) -> 0
mark(nil) -> nil

Termination of R to be shown.

`   R`
`     ↳Dependency Pair Analysis`

R contains the following Dependency Pairs:

AFROM(X) -> MARK(X)
AFIRST(s(X), cons(Y, Z)) -> MARK(Y)
ASEL(0, cons(X, Z)) -> MARK(X)
ASEL(s(X), cons(Y, Z)) -> ASEL(mark(X), mark(Z))
ASEL(s(X), cons(Y, Z)) -> MARK(X)
ASEL(s(X), cons(Y, Z)) -> MARK(Z)
MARK(from(X)) -> AFROM(mark(X))
MARK(from(X)) -> MARK(X)
MARK(first(X1, X2)) -> AFIRST(mark(X1), mark(X2))
MARK(first(X1, X2)) -> MARK(X1)
MARK(first(X1, X2)) -> MARK(X2)
MARK(sel(X1, X2)) -> ASEL(mark(X1), mark(X2))
MARK(sel(X1, X2)) -> MARK(X1)
MARK(sel(X1, X2)) -> MARK(X2)
MARK(cons(X1, X2)) -> MARK(X1)
MARK(s(X)) -> MARK(X)

Furthermore, R contains one SCC.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Narrowing Transformation`

Dependency Pairs:

ASEL(s(X), cons(Y, Z)) -> MARK(Z)
ASEL(s(X), cons(Y, Z)) -> MARK(X)
ASEL(s(X), cons(Y, Z)) -> ASEL(mark(X), mark(Z))
MARK(s(X)) -> MARK(X)
MARK(cons(X1, X2)) -> MARK(X1)
MARK(sel(X1, X2)) -> MARK(X2)
MARK(sel(X1, X2)) -> MARK(X1)
ASEL(0, cons(X, Z)) -> MARK(X)
MARK(sel(X1, X2)) -> ASEL(mark(X1), mark(X2))
MARK(first(X1, X2)) -> MARK(X2)
MARK(first(X1, X2)) -> MARK(X1)
AFIRST(s(X), cons(Y, Z)) -> MARK(Y)
MARK(first(X1, X2)) -> AFIRST(mark(X1), mark(X2))
MARK(from(X)) -> MARK(X)
MARK(from(X)) -> AFROM(mark(X))
AFROM(X) -> MARK(X)

Rules:

afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
afirst(0, Z) -> nil
afirst(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
afirst(X1, X2) -> first(X1, X2)
asel(0, cons(X, Z)) -> mark(X)
asel(s(X), cons(Y, Z)) -> asel(mark(X), mark(Z))
asel(X1, X2) -> sel(X1, X2)
mark(from(X)) -> afrom(mark(X))
mark(first(X1, X2)) -> afirst(mark(X1), mark(X2))
mark(sel(X1, X2)) -> asel(mark(X1), mark(X2))
mark(cons(X1, X2)) -> cons(mark(X1), X2)
mark(s(X)) -> s(mark(X))
mark(0) -> 0
mark(nil) -> nil

On this DP problem, a Narrowing SCC transformation can be performed.
As a result of transforming the rule

ASEL(s(X), cons(Y, Z)) -> ASEL(mark(X), mark(Z))
14 new Dependency Pairs are created:

ASEL(s(from(X'')), cons(Y, Z)) -> ASEL(afrom(mark(X'')), mark(Z))
ASEL(s(first(X1', X2')), cons(Y, Z)) -> ASEL(afirst(mark(X1'), mark(X2')), mark(Z))
ASEL(s(sel(X1', X2')), cons(Y, Z)) -> ASEL(asel(mark(X1'), mark(X2')), mark(Z))
ASEL(s(cons(X1', X2')), cons(Y, Z)) -> ASEL(cons(mark(X1'), X2'), mark(Z))
ASEL(s(s(X'')), cons(Y, Z)) -> ASEL(s(mark(X'')), mark(Z))
ASEL(s(0), cons(Y, Z)) -> ASEL(0, mark(Z))
ASEL(s(nil), cons(Y, Z)) -> ASEL(nil, mark(Z))
ASEL(s(X), cons(Y, from(X''))) -> ASEL(mark(X), afrom(mark(X'')))
ASEL(s(X), cons(Y, first(X1', X2'))) -> ASEL(mark(X), afirst(mark(X1'), mark(X2')))
ASEL(s(X), cons(Y, sel(X1', X2'))) -> ASEL(mark(X), asel(mark(X1'), mark(X2')))
ASEL(s(X), cons(Y, cons(X1', X2'))) -> ASEL(mark(X), cons(mark(X1'), X2'))
ASEL(s(X), cons(Y, s(X''))) -> ASEL(mark(X), s(mark(X'')))
ASEL(s(X), cons(Y, 0)) -> ASEL(mark(X), 0)
ASEL(s(X), cons(Y, nil)) -> ASEL(mark(X), nil)

The transformation is resulting in one new DP problem:

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Nar`
`           →DP Problem 2`
`             ↳Narrowing Transformation`

Dependency Pairs:

ASEL(s(X), cons(Y, cons(X1', X2'))) -> ASEL(mark(X), cons(mark(X1'), X2'))
ASEL(s(X), cons(Y, sel(X1', X2'))) -> ASEL(mark(X), asel(mark(X1'), mark(X2')))
ASEL(s(X), cons(Y, first(X1', X2'))) -> ASEL(mark(X), afirst(mark(X1'), mark(X2')))
ASEL(s(X), cons(Y, from(X''))) -> ASEL(mark(X), afrom(mark(X'')))
ASEL(s(0), cons(Y, Z)) -> ASEL(0, mark(Z))
ASEL(s(s(X'')), cons(Y, Z)) -> ASEL(s(mark(X'')), mark(Z))
ASEL(s(sel(X1', X2')), cons(Y, Z)) -> ASEL(asel(mark(X1'), mark(X2')), mark(Z))
ASEL(s(first(X1', X2')), cons(Y, Z)) -> ASEL(afirst(mark(X1'), mark(X2')), mark(Z))
ASEL(s(from(X'')), cons(Y, Z)) -> ASEL(afrom(mark(X'')), mark(Z))
ASEL(s(X), cons(Y, Z)) -> MARK(X)
MARK(s(X)) -> MARK(X)
MARK(cons(X1, X2)) -> MARK(X1)
MARK(sel(X1, X2)) -> MARK(X2)
MARK(sel(X1, X2)) -> MARK(X1)
ASEL(0, cons(X, Z)) -> MARK(X)
MARK(sel(X1, X2)) -> ASEL(mark(X1), mark(X2))
MARK(first(X1, X2)) -> MARK(X2)
MARK(first(X1, X2)) -> MARK(X1)
AFIRST(s(X), cons(Y, Z)) -> MARK(Y)
MARK(first(X1, X2)) -> AFIRST(mark(X1), mark(X2))
MARK(from(X)) -> MARK(X)
AFROM(X) -> MARK(X)
MARK(from(X)) -> AFROM(mark(X))
ASEL(s(X), cons(Y, Z)) -> MARK(Z)

Rules:

afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
afirst(0, Z) -> nil
afirst(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
afirst(X1, X2) -> first(X1, X2)
asel(0, cons(X, Z)) -> mark(X)
asel(s(X), cons(Y, Z)) -> asel(mark(X), mark(Z))
asel(X1, X2) -> sel(X1, X2)
mark(from(X)) -> afrom(mark(X))
mark(first(X1, X2)) -> afirst(mark(X1), mark(X2))
mark(sel(X1, X2)) -> asel(mark(X1), mark(X2))
mark(cons(X1, X2)) -> cons(mark(X1), X2)
mark(s(X)) -> s(mark(X))
mark(0) -> 0
mark(nil) -> nil

On this DP problem, a Narrowing SCC transformation can be performed.
As a result of transforming the rule

MARK(first(X1, X2)) -> AFIRST(mark(X1), mark(X2))
14 new Dependency Pairs are created:

MARK(first(from(X'), X2)) -> AFIRST(afrom(mark(X')), mark(X2))
MARK(first(first(X1'', X2''), X2)) -> AFIRST(afirst(mark(X1''), mark(X2'')), mark(X2))
MARK(first(sel(X1'', X2''), X2)) -> AFIRST(asel(mark(X1''), mark(X2'')), mark(X2))
MARK(first(cons(X1'', X2''), X2)) -> AFIRST(cons(mark(X1''), X2''), mark(X2))
MARK(first(s(X'), X2)) -> AFIRST(s(mark(X')), mark(X2))
MARK(first(0, X2)) -> AFIRST(0, mark(X2))
MARK(first(nil, X2)) -> AFIRST(nil, mark(X2))
MARK(first(X1, from(X'))) -> AFIRST(mark(X1), afrom(mark(X')))
MARK(first(X1, first(X1'', X2''))) -> AFIRST(mark(X1), afirst(mark(X1''), mark(X2'')))
MARK(first(X1, sel(X1'', X2''))) -> AFIRST(mark(X1), asel(mark(X1''), mark(X2'')))
MARK(first(X1, cons(X1'', X2''))) -> AFIRST(mark(X1), cons(mark(X1''), X2''))
MARK(first(X1, s(X'))) -> AFIRST(mark(X1), s(mark(X')))
MARK(first(X1, 0)) -> AFIRST(mark(X1), 0)
MARK(first(X1, nil)) -> AFIRST(mark(X1), nil)

The transformation is resulting in one new DP problem:

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Nar`
`           →DP Problem 2`
`             ↳Nar`
`             ...`
`               →DP Problem 3`
`                 ↳Narrowing Transformation`

Dependency Pairs:

ASEL(s(X), cons(Y, sel(X1', X2'))) -> ASEL(mark(X), asel(mark(X1'), mark(X2')))
ASEL(s(X), cons(Y, first(X1', X2'))) -> ASEL(mark(X), afirst(mark(X1'), mark(X2')))
ASEL(s(X), cons(Y, from(X''))) -> ASEL(mark(X), afrom(mark(X'')))
ASEL(s(0), cons(Y, Z)) -> ASEL(0, mark(Z))
ASEL(s(s(X'')), cons(Y, Z)) -> ASEL(s(mark(X'')), mark(Z))
ASEL(s(sel(X1', X2')), cons(Y, Z)) -> ASEL(asel(mark(X1'), mark(X2')), mark(Z))
ASEL(s(first(X1', X2')), cons(Y, Z)) -> ASEL(afirst(mark(X1'), mark(X2')), mark(Z))
ASEL(s(from(X'')), cons(Y, Z)) -> ASEL(afrom(mark(X'')), mark(Z))
ASEL(s(X), cons(Y, Z)) -> MARK(Z)
MARK(first(X1, cons(X1'', X2''))) -> AFIRST(mark(X1), cons(mark(X1''), X2''))
MARK(first(X1, sel(X1'', X2''))) -> AFIRST(mark(X1), asel(mark(X1''), mark(X2'')))
MARK(first(X1, first(X1'', X2''))) -> AFIRST(mark(X1), afirst(mark(X1''), mark(X2'')))
MARK(first(X1, from(X'))) -> AFIRST(mark(X1), afrom(mark(X')))
MARK(first(s(X'), X2)) -> AFIRST(s(mark(X')), mark(X2))
MARK(first(sel(X1'', X2''), X2)) -> AFIRST(asel(mark(X1''), mark(X2'')), mark(X2))
MARK(first(first(X1'', X2''), X2)) -> AFIRST(afirst(mark(X1''), mark(X2'')), mark(X2))
AFIRST(s(X), cons(Y, Z)) -> MARK(Y)
MARK(first(from(X'), X2)) -> AFIRST(afrom(mark(X')), mark(X2))
MARK(s(X)) -> MARK(X)
MARK(cons(X1, X2)) -> MARK(X1)
MARK(sel(X1, X2)) -> MARK(X2)
MARK(sel(X1, X2)) -> MARK(X1)
ASEL(s(X), cons(Y, Z)) -> MARK(X)
MARK(sel(X1, X2)) -> ASEL(mark(X1), mark(X2))
MARK(first(X1, X2)) -> MARK(X2)
MARK(first(X1, X2)) -> MARK(X1)
MARK(from(X)) -> MARK(X)
AFROM(X) -> MARK(X)
MARK(from(X)) -> AFROM(mark(X))
ASEL(0, cons(X, Z)) -> MARK(X)
ASEL(s(X), cons(Y, cons(X1', X2'))) -> ASEL(mark(X), cons(mark(X1'), X2'))

Rules:

afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
afirst(0, Z) -> nil
afirst(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
afirst(X1, X2) -> first(X1, X2)
asel(0, cons(X, Z)) -> mark(X)
asel(s(X), cons(Y, Z)) -> asel(mark(X), mark(Z))
asel(X1, X2) -> sel(X1, X2)
mark(from(X)) -> afrom(mark(X))
mark(first(X1, X2)) -> afirst(mark(X1), mark(X2))
mark(sel(X1, X2)) -> asel(mark(X1), mark(X2))
mark(cons(X1, X2)) -> cons(mark(X1), X2)
mark(s(X)) -> s(mark(X))
mark(0) -> 0
mark(nil) -> nil

On this DP problem, a Narrowing SCC transformation can be performed.
As a result of transforming the rule

MARK(sel(X1, X2)) -> ASEL(mark(X1), mark(X2))
14 new Dependency Pairs are created:

MARK(sel(from(X'), X2)) -> ASEL(afrom(mark(X')), mark(X2))
MARK(sel(first(X1'', X2''), X2)) -> ASEL(afirst(mark(X1''), mark(X2'')), mark(X2))
MARK(sel(sel(X1'', X2''), X2)) -> ASEL(asel(mark(X1''), mark(X2'')), mark(X2))
MARK(sel(cons(X1'', X2''), X2)) -> ASEL(cons(mark(X1''), X2''), mark(X2))
MARK(sel(s(X'), X2)) -> ASEL(s(mark(X')), mark(X2))
MARK(sel(0, X2)) -> ASEL(0, mark(X2))
MARK(sel(nil, X2)) -> ASEL(nil, mark(X2))
MARK(sel(X1, from(X'))) -> ASEL(mark(X1), afrom(mark(X')))
MARK(sel(X1, first(X1'', X2''))) -> ASEL(mark(X1), afirst(mark(X1''), mark(X2'')))
MARK(sel(X1, sel(X1'', X2''))) -> ASEL(mark(X1), asel(mark(X1''), mark(X2'')))
MARK(sel(X1, cons(X1'', X2''))) -> ASEL(mark(X1), cons(mark(X1''), X2''))
MARK(sel(X1, s(X'))) -> ASEL(mark(X1), s(mark(X')))
MARK(sel(X1, 0)) -> ASEL(mark(X1), 0)
MARK(sel(X1, nil)) -> ASEL(mark(X1), nil)

The transformation is resulting in one new DP problem:

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Nar`
`           →DP Problem 2`
`             ↳Nar`
`             ...`
`               →DP Problem 4`
`                 ↳Polynomial Ordering`

Dependency Pairs:

MARK(sel(X1, cons(X1'', X2''))) -> ASEL(mark(X1), cons(mark(X1''), X2''))
MARK(sel(X1, sel(X1'', X2''))) -> ASEL(mark(X1), asel(mark(X1''), mark(X2'')))
MARK(sel(X1, first(X1'', X2''))) -> ASEL(mark(X1), afirst(mark(X1''), mark(X2'')))
MARK(sel(X1, from(X'))) -> ASEL(mark(X1), afrom(mark(X')))
MARK(sel(0, X2)) -> ASEL(0, mark(X2))
MARK(sel(s(X'), X2)) -> ASEL(s(mark(X')), mark(X2))
ASEL(s(X), cons(Y, cons(X1', X2'))) -> ASEL(mark(X), cons(mark(X1'), X2'))
ASEL(s(X), cons(Y, first(X1', X2'))) -> ASEL(mark(X), afirst(mark(X1'), mark(X2')))
ASEL(s(X), cons(Y, from(X''))) -> ASEL(mark(X), afrom(mark(X'')))
ASEL(s(0), cons(Y, Z)) -> ASEL(0, mark(Z))
ASEL(s(s(X'')), cons(Y, Z)) -> ASEL(s(mark(X'')), mark(Z))
ASEL(s(sel(X1', X2')), cons(Y, Z)) -> ASEL(asel(mark(X1'), mark(X2')), mark(Z))
ASEL(s(first(X1', X2')), cons(Y, Z)) -> ASEL(afirst(mark(X1'), mark(X2')), mark(Z))
ASEL(s(from(X'')), cons(Y, Z)) -> ASEL(afrom(mark(X'')), mark(Z))
MARK(sel(sel(X1'', X2''), X2)) -> ASEL(asel(mark(X1''), mark(X2'')), mark(X2))
ASEL(s(X), cons(Y, Z)) -> MARK(Z)
MARK(sel(first(X1'', X2''), X2)) -> ASEL(afirst(mark(X1''), mark(X2'')), mark(X2))
ASEL(s(X), cons(Y, Z)) -> MARK(X)
MARK(sel(from(X'), X2)) -> ASEL(afrom(mark(X')), mark(X2))
MARK(first(X1, cons(X1'', X2''))) -> AFIRST(mark(X1), cons(mark(X1''), X2''))
MARK(first(X1, sel(X1'', X2''))) -> AFIRST(mark(X1), asel(mark(X1''), mark(X2'')))
MARK(first(X1, first(X1'', X2''))) -> AFIRST(mark(X1), afirst(mark(X1''), mark(X2'')))
MARK(first(X1, from(X'))) -> AFIRST(mark(X1), afrom(mark(X')))
MARK(first(s(X'), X2)) -> AFIRST(s(mark(X')), mark(X2))
MARK(first(sel(X1'', X2''), X2)) -> AFIRST(asel(mark(X1''), mark(X2'')), mark(X2))
MARK(first(first(X1'', X2''), X2)) -> AFIRST(afirst(mark(X1''), mark(X2'')), mark(X2))
AFIRST(s(X), cons(Y, Z)) -> MARK(Y)
MARK(first(from(X'), X2)) -> AFIRST(afrom(mark(X')), mark(X2))
MARK(s(X)) -> MARK(X)
MARK(cons(X1, X2)) -> MARK(X1)
MARK(sel(X1, X2)) -> MARK(X2)
MARK(sel(X1, X2)) -> MARK(X1)
MARK(first(X1, X2)) -> MARK(X2)
MARK(first(X1, X2)) -> MARK(X1)
MARK(from(X)) -> MARK(X)
AFROM(X) -> MARK(X)
MARK(from(X)) -> AFROM(mark(X))
ASEL(0, cons(X, Z)) -> MARK(X)
ASEL(s(X), cons(Y, sel(X1', X2'))) -> ASEL(mark(X), asel(mark(X1'), mark(X2')))

Rules:

afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
afirst(0, Z) -> nil
afirst(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
afirst(X1, X2) -> first(X1, X2)
asel(0, cons(X, Z)) -> mark(X)
asel(s(X), cons(Y, Z)) -> asel(mark(X), mark(Z))
asel(X1, X2) -> sel(X1, X2)
mark(from(X)) -> afrom(mark(X))
mark(first(X1, X2)) -> afirst(mark(X1), mark(X2))
mark(sel(X1, X2)) -> asel(mark(X1), mark(X2))
mark(cons(X1, X2)) -> cons(mark(X1), X2)
mark(s(X)) -> s(mark(X))
mark(0) -> 0
mark(nil) -> nil

The following dependency pairs can be strictly oriented:

ASEL(s(first(X1', X2')), cons(Y, Z)) -> ASEL(afirst(mark(X1'), mark(X2')), mark(Z))
ASEL(s(from(X'')), cons(Y, Z)) -> ASEL(afrom(mark(X'')), mark(Z))
MARK(sel(first(X1'', X2''), X2)) -> ASEL(afirst(mark(X1''), mark(X2'')), mark(X2))
MARK(sel(from(X'), X2)) -> ASEL(afrom(mark(X')), mark(X2))

Additionally, the following usable rules w.r.t. to the implicit AFS can be oriented:

asel(0, cons(X, Z)) -> mark(X)
asel(s(X), cons(Y, Z)) -> asel(mark(X), mark(Z))
asel(X1, X2) -> sel(X1, X2)
mark(from(X)) -> afrom(mark(X))
mark(first(X1, X2)) -> afirst(mark(X1), mark(X2))
mark(sel(X1, X2)) -> asel(mark(X1), mark(X2))
mark(cons(X1, X2)) -> cons(mark(X1), X2)
mark(s(X)) -> s(mark(X))
mark(0) -> 0
mark(nil) -> nil
afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
afirst(0, Z) -> nil
afirst(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
afirst(X1, X2) -> first(X1, X2)

Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(from(x1)) =  0 POL(a__sel(x1, x2)) =  1 POL(MARK(x1)) =  1 POL(A__FROM(x1)) =  1 POL(sel(x1, x2)) =  0 POL(mark(x1)) =  1 POL(a__from(x1)) =  0 POL(a__first(x1, x2)) =  0 POL(A__FIRST(x1, x2)) =  1 POL(0) =  1 POL(first(x1, x2)) =  0 POL(cons(x1, x2)) =  0 POL(nil) =  0 POL(s(x1)) =  1 POL(A__SEL(x1, x2)) =  x1

resulting in one new DP problem.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Nar`
`           →DP Problem 2`
`             ↳Nar`
`             ...`
`               →DP Problem 5`
`                 ↳Polynomial Ordering`

Dependency Pairs:

MARK(sel(X1, cons(X1'', X2''))) -> ASEL(mark(X1), cons(mark(X1''), X2''))
MARK(sel(X1, sel(X1'', X2''))) -> ASEL(mark(X1), asel(mark(X1''), mark(X2'')))
MARK(sel(X1, first(X1'', X2''))) -> ASEL(mark(X1), afirst(mark(X1''), mark(X2'')))
MARK(sel(X1, from(X'))) -> ASEL(mark(X1), afrom(mark(X')))
MARK(sel(0, X2)) -> ASEL(0, mark(X2))
MARK(sel(s(X'), X2)) -> ASEL(s(mark(X')), mark(X2))
ASEL(s(X), cons(Y, cons(X1', X2'))) -> ASEL(mark(X), cons(mark(X1'), X2'))
ASEL(s(X), cons(Y, first(X1', X2'))) -> ASEL(mark(X), afirst(mark(X1'), mark(X2')))
ASEL(s(X), cons(Y, from(X''))) -> ASEL(mark(X), afrom(mark(X'')))
ASEL(s(0), cons(Y, Z)) -> ASEL(0, mark(Z))
ASEL(s(s(X'')), cons(Y, Z)) -> ASEL(s(mark(X'')), mark(Z))
ASEL(s(sel(X1', X2')), cons(Y, Z)) -> ASEL(asel(mark(X1'), mark(X2')), mark(Z))
MARK(sel(sel(X1'', X2''), X2)) -> ASEL(asel(mark(X1''), mark(X2'')), mark(X2))
ASEL(s(X), cons(Y, Z)) -> MARK(Z)
ASEL(s(X), cons(Y, Z)) -> MARK(X)
MARK(first(X1, cons(X1'', X2''))) -> AFIRST(mark(X1), cons(mark(X1''), X2''))
MARK(first(X1, sel(X1'', X2''))) -> AFIRST(mark(X1), asel(mark(X1''), mark(X2'')))
MARK(first(X1, first(X1'', X2''))) -> AFIRST(mark(X1), afirst(mark(X1''), mark(X2'')))
MARK(first(X1, from(X'))) -> AFIRST(mark(X1), afrom(mark(X')))
MARK(first(s(X'), X2)) -> AFIRST(s(mark(X')), mark(X2))
MARK(first(sel(X1'', X2''), X2)) -> AFIRST(asel(mark(X1''), mark(X2'')), mark(X2))
MARK(first(first(X1'', X2''), X2)) -> AFIRST(afirst(mark(X1''), mark(X2'')), mark(X2))
AFIRST(s(X), cons(Y, Z)) -> MARK(Y)
MARK(first(from(X'), X2)) -> AFIRST(afrom(mark(X')), mark(X2))
MARK(s(X)) -> MARK(X)
MARK(cons(X1, X2)) -> MARK(X1)
MARK(sel(X1, X2)) -> MARK(X2)
MARK(sel(X1, X2)) -> MARK(X1)
MARK(first(X1, X2)) -> MARK(X2)
MARK(first(X1, X2)) -> MARK(X1)
MARK(from(X)) -> MARK(X)
AFROM(X) -> MARK(X)
MARK(from(X)) -> AFROM(mark(X))
ASEL(0, cons(X, Z)) -> MARK(X)
ASEL(s(X), cons(Y, sel(X1', X2'))) -> ASEL(mark(X), asel(mark(X1'), mark(X2')))

Rules:

afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
afirst(0, Z) -> nil
afirst(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
afirst(X1, X2) -> first(X1, X2)
asel(0, cons(X, Z)) -> mark(X)
asel(s(X), cons(Y, Z)) -> asel(mark(X), mark(Z))
asel(X1, X2) -> sel(X1, X2)
mark(from(X)) -> afrom(mark(X))
mark(first(X1, X2)) -> afirst(mark(X1), mark(X2))
mark(sel(X1, X2)) -> asel(mark(X1), mark(X2))
mark(cons(X1, X2)) -> cons(mark(X1), X2)
mark(s(X)) -> s(mark(X))
mark(0) -> 0
mark(nil) -> nil

The following dependency pairs can be strictly oriented:

MARK(first(first(X1'', X2''), X2)) -> AFIRST(afirst(mark(X1''), mark(X2'')), mark(X2))
MARK(first(from(X'), X2)) -> AFIRST(afrom(mark(X')), mark(X2))

Additionally, the following usable rules w.r.t. to the implicit AFS can be oriented:

asel(0, cons(X, Z)) -> mark(X)
asel(s(X), cons(Y, Z)) -> asel(mark(X), mark(Z))
asel(X1, X2) -> sel(X1, X2)
mark(from(X)) -> afrom(mark(X))
mark(first(X1, X2)) -> afirst(mark(X1), mark(X2))
mark(sel(X1, X2)) -> asel(mark(X1), mark(X2))
mark(cons(X1, X2)) -> cons(mark(X1), X2)
mark(s(X)) -> s(mark(X))
mark(0) -> 0
mark(nil) -> nil
afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
afirst(0, Z) -> nil
afirst(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
afirst(X1, X2) -> first(X1, X2)

Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(from(x1)) =  0 POL(a__sel(x1, x2)) =  1 POL(MARK(x1)) =  1 POL(A__FROM(x1)) =  1 POL(sel(x1, x2)) =  0 POL(mark(x1)) =  1 POL(a__from(x1)) =  0 POL(a__first(x1, x2)) =  0 POL(A__FIRST(x1, x2)) =  x1 POL(0) =  0 POL(first(x1, x2)) =  0 POL(cons(x1, x2)) =  0 POL(nil) =  0 POL(s(x1)) =  1 POL(A__SEL(x1, x2)) =  1

resulting in one new DP problem.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Nar`
`           →DP Problem 2`
`             ↳Nar`
`             ...`
`               →DP Problem 6`
`                 ↳Remaining Obligation(s)`

The following remains to be proven:
Dependency Pairs:

MARK(sel(X1, cons(X1'', X2''))) -> ASEL(mark(X1), cons(mark(X1''), X2''))
MARK(sel(X1, sel(X1'', X2''))) -> ASEL(mark(X1), asel(mark(X1''), mark(X2'')))
MARK(sel(X1, first(X1'', X2''))) -> ASEL(mark(X1), afirst(mark(X1''), mark(X2'')))
MARK(sel(X1, from(X'))) -> ASEL(mark(X1), afrom(mark(X')))
MARK(sel(0, X2)) -> ASEL(0, mark(X2))
MARK(sel(s(X'), X2)) -> ASEL(s(mark(X')), mark(X2))
ASEL(s(X), cons(Y, cons(X1', X2'))) -> ASEL(mark(X), cons(mark(X1'), X2'))
ASEL(s(X), cons(Y, first(X1', X2'))) -> ASEL(mark(X), afirst(mark(X1'), mark(X2')))
ASEL(s(X), cons(Y, from(X''))) -> ASEL(mark(X), afrom(mark(X'')))
ASEL(s(0), cons(Y, Z)) -> ASEL(0, mark(Z))
ASEL(s(s(X'')), cons(Y, Z)) -> ASEL(s(mark(X'')), mark(Z))
ASEL(s(sel(X1', X2')), cons(Y, Z)) -> ASEL(asel(mark(X1'), mark(X2')), mark(Z))
MARK(sel(sel(X1'', X2''), X2)) -> ASEL(asel(mark(X1''), mark(X2'')), mark(X2))
ASEL(s(X), cons(Y, Z)) -> MARK(Z)
ASEL(s(X), cons(Y, Z)) -> MARK(X)
MARK(first(X1, cons(X1'', X2''))) -> AFIRST(mark(X1), cons(mark(X1''), X2''))
MARK(first(X1, sel(X1'', X2''))) -> AFIRST(mark(X1), asel(mark(X1''), mark(X2'')))
MARK(first(X1, first(X1'', X2''))) -> AFIRST(mark(X1), afirst(mark(X1''), mark(X2'')))
MARK(first(X1, from(X'))) -> AFIRST(mark(X1), afrom(mark(X')))
MARK(first(s(X'), X2)) -> AFIRST(s(mark(X')), mark(X2))
MARK(first(sel(X1'', X2''), X2)) -> AFIRST(asel(mark(X1''), mark(X2'')), mark(X2))
AFIRST(s(X), cons(Y, Z)) -> MARK(Y)
MARK(s(X)) -> MARK(X)
MARK(cons(X1, X2)) -> MARK(X1)
MARK(sel(X1, X2)) -> MARK(X2)
MARK(sel(X1, X2)) -> MARK(X1)
MARK(first(X1, X2)) -> MARK(X2)
MARK(first(X1, X2)) -> MARK(X1)
MARK(from(X)) -> MARK(X)
AFROM(X) -> MARK(X)
MARK(from(X)) -> AFROM(mark(X))
ASEL(0, cons(X, Z)) -> MARK(X)
ASEL(s(X), cons(Y, sel(X1', X2'))) -> ASEL(mark(X), asel(mark(X1'), mark(X2')))

Rules:

afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
afirst(0, Z) -> nil
afirst(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
afirst(X1, X2) -> first(X1, X2)
asel(0, cons(X, Z)) -> mark(X)
asel(s(X), cons(Y, Z)) -> asel(mark(X), mark(Z))
asel(X1, X2) -> sel(X1, X2)
mark(from(X)) -> afrom(mark(X))
mark(first(X1, X2)) -> afirst(mark(X1), mark(X2))
mark(sel(X1, X2)) -> asel(mark(X1), mark(X2))
mark(cons(X1, X2)) -> cons(mark(X1), X2)
mark(s(X)) -> s(mark(X))
mark(0) -> 0
mark(nil) -> nil

Termination of R could not be shown.
Duration:
0:25 minutes