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

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

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

Furthermore, R contains one SCC.


   R
DPs
       →DP Problem 1
Narrowing Transformation


Dependency Pairs:

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


Rules:


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





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))
12 new Dependency Pairs are created:

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))
MARK(first(0, X2)) -> AFIRST(0, mark(X2))
MARK(first(nil, X2)) -> AFIRST(nil, mark(X2))
MARK(first(s(X'), X2)) -> AFIRST(s(mark(X')), mark(X2))
MARK(first(cons(X1'', X2''), X2)) -> AFIRST(cons(mark(X1''), X2''), 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(X1, 0)) -> AFIRST(mark(X1), 0)
MARK(first(X1, nil)) -> AFIRST(mark(X1), nil)
MARK(first(X1, s(X'))) -> AFIRST(mark(X1), s(mark(X')))
MARK(first(X1, cons(X1'', X2''))) -> AFIRST(mark(X1), cons(mark(X1''), X2''))

The transformation is resulting in one new DP problem:



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


Dependency Pairs:

MARK(first(X1, cons(X1'', X2''))) -> AFIRST(mark(X1), cons(mark(X1''), 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(s(X'), X2)) -> AFIRST(s(mark(X')), mark(X2))
MARK(first(from(X'), X2)) -> AFIRST(afrom(mark(X')), mark(X2))
AFIRST(s(X), cons(Y, Z)) -> MARK(Y)
MARK(first(first(X1'', X2''), X2)) -> AFIRST(afirst(mark(X1''), mark(X2'')), mark(X2))
MARK(s(X)) -> MARK(X)
MARK(from(X)) -> MARK(X)
AFROM(X) -> MARK(X)
MARK(from(X)) -> AFROM(mark(X))
MARK(first(X1, X2)) -> MARK(X2)
MARK(first(X1, X2)) -> MARK(X1)
MARK(cons(X1, X2)) -> MARK(X1)


Rules:


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





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

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

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

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:

MARK(first(first(X1'', X2''), cons(X1', X2'''))) -> AFIRST(afirst(mark(X1''), mark(X2'')), cons(mark(X1'), X2'''))
MARK(first(first(X1'', X2''), from(X'))) -> AFIRST(afirst(mark(X1''), mark(X2'')), afrom(mark(X')))
MARK(first(first(X1'', X2''), first(X1', X2'''))) -> AFIRST(afirst(mark(X1''), mark(X2'')), afirst(mark(X1'), mark(X2''')))
MARK(first(first(X1'', cons(X1', X2''')), X2)) -> AFIRST(afirst(mark(X1''), cons(mark(X1'), X2''')), mark(X2))
MARK(first(first(X1'', s(X')), X2)) -> AFIRST(afirst(mark(X1''), s(mark(X'))), mark(X2))
MARK(first(first(X1'', nil), X2)) -> AFIRST(afirst(mark(X1''), nil), mark(X2))
MARK(first(first(X1'', 0), X2)) -> AFIRST(afirst(mark(X1''), 0), mark(X2))
MARK(first(first(X1'', from(X')), X2)) -> AFIRST(afirst(mark(X1''), afrom(mark(X'))), mark(X2))
MARK(first(first(X1'', first(X1', X2''')), X2)) -> AFIRST(afirst(mark(X1''), afirst(mark(X1'), mark(X2'''))), mark(X2))
MARK(first(first(cons(X1', X2'''), X2''), X2)) -> AFIRST(afirst(cons(mark(X1'), X2'''), mark(X2'')), mark(X2))
MARK(first(first(s(X'), X2''), X2)) -> AFIRST(afirst(s(mark(X')), mark(X2'')), mark(X2))
MARK(first(first(nil, X2''), X2)) -> AFIRST(afirst(nil, mark(X2'')), mark(X2))
MARK(first(first(0, X2''), X2)) -> AFIRST(afirst(0, mark(X2'')), mark(X2))
MARK(first(first(from(X'), X2''), X2)) -> AFIRST(afirst(afrom(mark(X')), mark(X2'')), mark(X2))
MARK(first(first(first(X1', X2'''), X2''), X2)) -> AFIRST(afirst(afirst(mark(X1'), mark(X2''')), mark(X2'')), 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(s(X'), X2)) -> AFIRST(s(mark(X')), mark(X2))
MARK(first(from(X'), X2)) -> AFIRST(afrom(mark(X')), mark(X2))
MARK(cons(X1, X2)) -> MARK(X1)
MARK(s(X)) -> MARK(X)
MARK(from(X)) -> MARK(X)
AFROM(X) -> MARK(X)
MARK(from(X)) -> AFROM(mark(X))
MARK(first(X1, X2)) -> MARK(X2)
MARK(first(X1, X2)) -> MARK(X1)
AFIRST(s(X), cons(Y, Z)) -> MARK(Y)
MARK(first(X1, cons(X1'', X2''))) -> AFIRST(mark(X1), cons(mark(X1''), X2''))


Rules:


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





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

MARK(first(from(X'), X2)) -> AFIRST(afrom(mark(X')), mark(X2))
14 new Dependency Pairs are created:

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

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 4
Narrowing Transformation


Dependency Pairs:

MARK(first(from(X'), cons(X1', X2''))) -> AFIRST(afrom(mark(X')), cons(mark(X1'), X2''))
MARK(first(from(X'), from(X''))) -> AFIRST(afrom(mark(X')), afrom(mark(X'')))
MARK(first(from(X'), first(X1', X2''))) -> AFIRST(afrom(mark(X')), afirst(mark(X1'), mark(X2'')))
MARK(first(from(cons(X1', X2'')), X2)) -> AFIRST(afrom(cons(mark(X1'), X2'')), mark(X2))
MARK(first(from(s(X'')), X2)) -> AFIRST(afrom(s(mark(X''))), mark(X2))
MARK(first(from(nil), X2)) -> AFIRST(afrom(nil), mark(X2))
MARK(first(from(0), X2)) -> AFIRST(afrom(0), mark(X2))
MARK(first(from(from(X'')), X2)) -> AFIRST(afrom(afrom(mark(X''))), mark(X2))
MARK(first(from(first(X1', X2'')), X2)) -> AFIRST(afrom(afirst(mark(X1'), mark(X2''))), mark(X2))
MARK(first(first(X1'', X2''), from(X'))) -> AFIRST(afirst(mark(X1''), mark(X2'')), afrom(mark(X')))
MARK(first(first(X1'', X2''), first(X1', X2'''))) -> AFIRST(afirst(mark(X1''), mark(X2'')), afirst(mark(X1'), mark(X2''')))
MARK(first(first(X1'', cons(X1', X2''')), X2)) -> AFIRST(afirst(mark(X1''), cons(mark(X1'), X2''')), mark(X2))
MARK(first(first(X1'', s(X')), X2)) -> AFIRST(afirst(mark(X1''), s(mark(X'))), mark(X2))
MARK(first(first(X1'', nil), X2)) -> AFIRST(afirst(mark(X1''), nil), mark(X2))
MARK(first(first(X1'', 0), X2)) -> AFIRST(afirst(mark(X1''), 0), mark(X2))
MARK(first(first(X1'', from(X')), X2)) -> AFIRST(afirst(mark(X1''), afrom(mark(X'))), mark(X2))
MARK(first(first(X1'', first(X1', X2''')), X2)) -> AFIRST(afirst(mark(X1''), afirst(mark(X1'), mark(X2'''))), mark(X2))
MARK(first(first(cons(X1', X2'''), X2''), X2)) -> AFIRST(afirst(cons(mark(X1'), X2'''), mark(X2'')), mark(X2))
MARK(first(first(s(X'), X2''), X2)) -> AFIRST(afirst(s(mark(X')), mark(X2'')), mark(X2))
MARK(first(first(nil, X2''), X2)) -> AFIRST(afirst(nil, mark(X2'')), mark(X2))
MARK(first(first(0, X2''), X2)) -> AFIRST(afirst(0, mark(X2'')), mark(X2))
MARK(first(first(from(X'), X2''), X2)) -> AFIRST(afirst(afrom(mark(X')), mark(X2'')), mark(X2))
MARK(first(first(first(X1', X2'''), X2''), X2)) -> AFIRST(afirst(afirst(mark(X1'), mark(X2''')), mark(X2'')), mark(X2))
MARK(first(X1, cons(X1'', X2''))) -> AFIRST(mark(X1), cons(mark(X1''), 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(s(X'), X2)) -> AFIRST(s(mark(X')), mark(X2))
MARK(cons(X1, X2)) -> MARK(X1)
MARK(s(X)) -> MARK(X)
MARK(from(X)) -> MARK(X)
AFROM(X) -> MARK(X)
MARK(from(X)) -> AFROM(mark(X))
MARK(first(X1, X2)) -> MARK(X2)
MARK(first(X1, X2)) -> MARK(X1)
AFIRST(s(X), cons(Y, Z)) -> MARK(Y)
MARK(first(first(X1'', X2''), cons(X1', X2'''))) -> AFIRST(afirst(mark(X1''), mark(X2'')), cons(mark(X1'), X2'''))


Rules:


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





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

MARK(first(s(X'), X2)) -> AFIRST(s(mark(X')), mark(X2))
12 new Dependency Pairs are created:

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

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 5
Narrowing Transformation


Dependency Pairs:

MARK(first(s(X'), cons(X1', X2''))) -> AFIRST(s(mark(X')), cons(mark(X1'), X2''))
MARK(first(s(X'), from(X''))) -> AFIRST(s(mark(X')), afrom(mark(X'')))
MARK(first(s(X'), first(X1', X2''))) -> AFIRST(s(mark(X')), afirst(mark(X1'), mark(X2'')))
MARK(first(s(cons(X1', X2'')), X2)) -> AFIRST(s(cons(mark(X1'), X2'')), mark(X2))
MARK(first(s(s(X'')), X2)) -> AFIRST(s(s(mark(X''))), mark(X2))
MARK(first(s(nil), X2)) -> AFIRST(s(nil), mark(X2))
MARK(first(s(0), X2)) -> AFIRST(s(0), mark(X2))
MARK(first(s(from(X'')), X2)) -> AFIRST(s(afrom(mark(X''))), mark(X2))
MARK(first(s(first(X1', X2'')), X2)) -> AFIRST(s(afirst(mark(X1'), mark(X2''))), mark(X2))
MARK(first(from(X'), from(X''))) -> AFIRST(afrom(mark(X')), afrom(mark(X'')))
MARK(first(from(X'), first(X1', X2''))) -> AFIRST(afrom(mark(X')), afirst(mark(X1'), mark(X2'')))
MARK(first(from(cons(X1', X2'')), X2)) -> AFIRST(afrom(cons(mark(X1'), X2'')), mark(X2))
MARK(first(from(s(X'')), X2)) -> AFIRST(afrom(s(mark(X''))), mark(X2))
MARK(first(from(nil), X2)) -> AFIRST(afrom(nil), mark(X2))
MARK(first(from(0), X2)) -> AFIRST(afrom(0), mark(X2))
MARK(first(from(from(X'')), X2)) -> AFIRST(afrom(afrom(mark(X''))), mark(X2))
MARK(first(from(first(X1', X2'')), X2)) -> AFIRST(afrom(afirst(mark(X1'), mark(X2''))), mark(X2))
MARK(first(first(X1'', X2''), cons(X1', X2'''))) -> AFIRST(afirst(mark(X1''), mark(X2'')), cons(mark(X1'), X2'''))
MARK(first(first(X1'', X2''), from(X'))) -> AFIRST(afirst(mark(X1''), mark(X2'')), afrom(mark(X')))
MARK(first(first(X1'', X2''), first(X1', X2'''))) -> AFIRST(afirst(mark(X1''), mark(X2'')), afirst(mark(X1'), mark(X2''')))
MARK(first(first(X1'', cons(X1', X2''')), X2)) -> AFIRST(afirst(mark(X1''), cons(mark(X1'), X2''')), mark(X2))
MARK(first(first(X1'', s(X')), X2)) -> AFIRST(afirst(mark(X1''), s(mark(X'))), mark(X2))
MARK(first(first(X1'', nil), X2)) -> AFIRST(afirst(mark(X1''), nil), mark(X2))
MARK(first(first(X1'', 0), X2)) -> AFIRST(afirst(mark(X1''), 0), mark(X2))
MARK(first(first(X1'', from(X')), X2)) -> AFIRST(afirst(mark(X1''), afrom(mark(X'))), mark(X2))
MARK(first(first(X1'', first(X1', X2''')), X2)) -> AFIRST(afirst(mark(X1''), afirst(mark(X1'), mark(X2'''))), mark(X2))
MARK(first(first(cons(X1', X2'''), X2''), X2)) -> AFIRST(afirst(cons(mark(X1'), X2'''), mark(X2'')), mark(X2))
MARK(first(first(s(X'), X2''), X2)) -> AFIRST(afirst(s(mark(X')), mark(X2'')), mark(X2))
MARK(first(first(nil, X2''), X2)) -> AFIRST(afirst(nil, mark(X2'')), mark(X2))
MARK(first(first(0, X2''), X2)) -> AFIRST(afirst(0, mark(X2'')), mark(X2))
MARK(first(first(from(X'), X2''), X2)) -> AFIRST(afirst(afrom(mark(X')), mark(X2'')), mark(X2))
MARK(first(first(first(X1', X2'''), X2''), X2)) -> AFIRST(afirst(afirst(mark(X1'), mark(X2''')), mark(X2'')), mark(X2))
MARK(first(X1, cons(X1'', X2''))) -> AFIRST(mark(X1), cons(mark(X1''), 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(cons(X1, X2)) -> MARK(X1)
MARK(s(X)) -> MARK(X)
MARK(from(X)) -> MARK(X)
AFROM(X) -> MARK(X)
MARK(from(X)) -> AFROM(mark(X))
MARK(first(X1, X2)) -> MARK(X2)
MARK(first(X1, X2)) -> MARK(X1)
AFIRST(s(X), cons(Y, Z)) -> MARK(Y)
MARK(first(from(X'), cons(X1', X2''))) -> AFIRST(afrom(mark(X')), cons(mark(X1'), X2''))


Rules:


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





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

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

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

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 6
Narrowing Transformation


Dependency Pairs:

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


Rules:


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





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

MARK(first(X1, from(X'))) -> AFIRST(mark(X1), afrom(mark(X')))
14 new Dependency Pairs are created:

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

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 7
Narrowing Transformation


Dependency Pairs:

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


Rules:


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





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

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

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

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 8
Polynomial Ordering


Dependency Pairs:

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


Rules:


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





The following dependency pairs can be strictly oriented:

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


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

mark(first(X1, X2)) -> afirst(mark(X1), mark(X2))
mark(from(X)) -> afrom(mark(X))
mark(0) -> 0
mark(nil) -> nil
mark(s(X)) -> s(mark(X))
mark(cons(X1, X2)) -> cons(mark(X1), X2)
afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
afirst(0, X) -> 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))=  x1  
  POL(first(x1, x2))=  x1 + x2  
  POL(0)=  1  
  POL(MARK(x1))=  x1  
  POL(A__FIRST(x1, x2))=  x2  
  POL(cons(x1, x2))=  x1  
  POL(nil)=  0  
  POL(A__FROM(x1))=  x1  
  POL(s(x1))=  x1  
  POL(mark(x1))=  x1  
  POL(a__from(x1))=  x1  
  POL(a__first(x1, x2))=  x1 + x2  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 9
Polynomial Ordering


Dependency Pairs:

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


Rules:


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





The following dependency pairs can be strictly oriented:

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


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

mark(first(X1, X2)) -> afirst(mark(X1), mark(X2))
mark(from(X)) -> afrom(mark(X))
mark(0) -> 0
mark(nil) -> nil
mark(s(X)) -> s(mark(X))
mark(cons(X1, X2)) -> cons(mark(X1), X2)
afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
afirst(0, X) -> 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))=  x1  
  POL(first(x1, x2))=  x1 + x2  
  POL(0)=  1  
  POL(MARK(x1))=  x1  
  POL(A__FIRST(x1, x2))=  x2  
  POL(cons(x1, x2))=  x1  
  POL(nil)=  1  
  POL(A__FROM(x1))=  x1  
  POL(s(x1))=  x1  
  POL(mark(x1))=  x1  
  POL(a__from(x1))=  x1  
  POL(a__first(x1, x2))=  x1 + x2  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 10
Polynomial Ordering


Dependency Pairs:

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


Rules:


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





The following dependency pairs can be strictly oriented:

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


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

mark(first(X1, X2)) -> afirst(mark(X1), mark(X2))
mark(from(X)) -> afrom(mark(X))
mark(0) -> 0
mark(nil) -> nil
mark(s(X)) -> s(mark(X))
mark(cons(X1, X2)) -> cons(mark(X1), X2)
afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
afirst(0, X) -> 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))=  x1  
  POL(first(x1, x2))=  x1 + x2  
  POL(0)=  0  
  POL(MARK(x1))=  x1  
  POL(A__FIRST(x1, x2))=  x2  
  POL(cons(x1, x2))=  x1  
  POL(nil)=  0  
  POL(A__FROM(x1))=  x1  
  POL(s(x1))=  1 + x1  
  POL(mark(x1))=  x1  
  POL(a__from(x1))=  x1  
  POL(a__first(x1, x2))=  x1 + x2  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 11
Polynomial Ordering


Dependency Pairs:

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


Rules:


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





The following dependency pairs can be strictly oriented:

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


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

mark(first(X1, X2)) -> afirst(mark(X1), mark(X2))
mark(from(X)) -> afrom(mark(X))
mark(0) -> 0
mark(nil) -> nil
mark(s(X)) -> s(mark(X))
mark(cons(X1, X2)) -> cons(mark(X1), X2)
afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
afirst(0, X) -> 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))=  1 + x1  
  POL(first(x1, x2))=  x1 + x2  
  POL(0)=  0  
  POL(MARK(x1))=  x1  
  POL(A__FIRST(x1, x2))=  x2  
  POL(cons(x1, x2))=  x1  
  POL(nil)=  0  
  POL(A__FROM(x1))=  x1  
  POL(s(x1))=  0  
  POL(mark(x1))=  x1  
  POL(a__from(x1))=  1 + x1  
  POL(a__first(x1, x2))=  x1 + x2  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 12
Dependency Graph


Dependency Pairs:

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


Rules:


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





Using the Dependency Graph the DP problem was split into 1 DP problems.


   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 13
Polynomial Ordering


Dependency Pairs:

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


Rules:


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





The following dependency pairs can be strictly oriented:

MARK(first(first(X1'', cons(X1', X2''')), X2)) -> AFIRST(afirst(mark(X1''), cons(mark(X1'), X2''')), mark(X2))
MARK(first(first(cons(X1', X2'''), X2''), X2)) -> AFIRST(afirst(cons(mark(X1'), X2'''), mark(X2'')), mark(X2))
MARK(cons(X1, X2)) -> MARK(X1)
AFIRST(s(X), cons(Y, Z)) -> MARK(Y)


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

mark(first(X1, X2)) -> afirst(mark(X1), mark(X2))
mark(from(X)) -> afrom(mark(X))
mark(0) -> 0
mark(nil) -> nil
mark(s(X)) -> s(mark(X))
mark(cons(X1, X2)) -> cons(mark(X1), X2)
afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
afirst(0, X) -> 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))=  1 + x1  
  POL(first(x1, x2))=  x1 + x2  
  POL(0)=  0  
  POL(MARK(x1))=  x1  
  POL(A__FIRST(x1, x2))=  x2  
  POL(cons(x1, x2))=  1 + x1  
  POL(nil)=  0  
  POL(s(x1))=  0  
  POL(mark(x1))=  x1  
  POL(a__from(x1))=  1 + x1  
  POL(a__first(x1, x2))=  x1 + x2  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 14
Dependency Graph


Dependency Pairs:

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


Rules:


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





Using the Dependency Graph the DP problem was split into 1 DP problems.


   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 15
Polynomial Ordering


Dependency Pairs:

MARK(first(X1, X2)) -> MARK(X1)
MARK(first(X1, X2)) -> MARK(X2)


Rules:


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





The following dependency pairs can be strictly oriented:

MARK(first(X1, X2)) -> MARK(X1)
MARK(first(X1, X2)) -> MARK(X2)


There are no usable rules w.r.t. to the implicit AFS that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(MARK(x1))=  x1  
  POL(first(x1, x2))=  1 + x1 + x2  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 16
Dependency Graph


Dependency Pair:


Rules:


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





Using the Dependency Graph resulted in no new DP problems.

Termination of R successfully shown.
Duration:
0:38 minutes