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)

Innermost 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
Negative Polynomial Order


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)


Strategy:

innermost




The following Dependency Pairs can be strictly oriented using the given order.

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


Moreover, the following usable rules (regarding the implicit AFS) are oriented.

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


Used ordering:
Polynomial Order with Interpretation:

POL( MARK(x1) ) = x1

POL( cons(x1, x2) ) = x1 + 1

POL( from(x1) ) = x1 + 1

POL( first(x1, x2) ) = x1 + x2

POL( AFROM(x1) ) = x1

POL( s(x1) ) = x1

POL( AFIRST(x1, x2) ) = x2

POL( mark(x1) ) = x1

POL( afirst(x1, x2) ) = x1 + x2

POL( 0 ) = 0

POL( nil ) = 0

POL( afrom(x1) ) = x1 + 1


This results in one new DP problem.


   R
DPs
       →DP Problem 1
Neg POLO
           →DP Problem 2
Dependency Graph


Dependency Pairs:

MARK(s(X)) -> MARK(X)
AFROM(X) -> MARK(X)
MARK(first(X1, X2)) -> MARK(X2)
MARK(first(X1, X2)) -> MARK(X1)
MARK(first(X1, X2)) -> AFIRST(mark(X1), 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)


Strategy:

innermost




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


   R
DPs
       →DP Problem 1
Neg POLO
           →DP Problem 2
DGraph
             ...
               →DP Problem 3
Usable Rules (Innermost)


Dependency Pairs:

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


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)


Strategy:

innermost




As we are in the innermost case, we can delete all 11 non-usable-rules.


   R
DPs
       →DP Problem 1
Neg POLO
           →DP Problem 2
DGraph
             ...
               →DP Problem 4
Size-Change Principle


Dependency Pairs:

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


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. MARK(first(X1, X2)) -> MARK(X2)
  2. MARK(first(X1, X2)) -> MARK(X1)
  3. MARK(s(X)) -> MARK(X)
and get the following Size-Change Graph(s):
{1, 2, 3} , {1, 2, 3}
1>1

which lead(s) to this/these maximal multigraph(s):
{1, 2, 3} , {1, 2, 3}
1>1

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
first(x1, x2) -> first(x1, x2)
s(x1) -> s(x1)

We obtain no new DP problems.

Innermost Termination of R successfully shown.
Duration:
0:01 minutes