Term Rewriting System R:
[Z, X, Y, X1, X2]
afst(0, Z) -> nil
afst(s(X), cons(Y, Z)) -> cons(mark(Y), fst(X, Z))
afst(X1, X2) -> fst(X1, X2)
afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
aadd(0, X) -> mark(X)
aadd(s(X), Y) -> s(add(X, Y))
aadd(X1, X2) -> add(X1, X2)
alen(nil) -> 0
alen(cons(X, Z)) -> s(len(Z))
alen(X) -> len(X)
mark(fst(X1, X2)) -> afst(mark(X1), mark(X2))
mark(from(X)) -> afrom(mark(X))
mark(add(X1, X2)) -> aadd(mark(X1), mark(X2))
mark(len(X)) -> alen(mark(X))
mark(0) -> 0
mark(s(X)) -> s(X)
mark(nil) -> nil
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:

AFST(s(X), cons(Y, Z)) -> MARK(Y)
AFROM(X) -> MARK(X)
AADD(0, X) -> MARK(X)
MARK(fst(X1, X2)) -> AFST(mark(X1), mark(X2))
MARK(fst(X1, X2)) -> MARK(X1)
MARK(fst(X1, X2)) -> MARK(X2)
MARK(from(X)) -> AFROM(mark(X))
MARK(from(X)) -> MARK(X)
MARK(add(X1, X2)) -> AADD(mark(X1), mark(X2))
MARK(add(X1, X2)) -> MARK(X1)
MARK(add(X1, X2)) -> MARK(X2)
MARK(len(X)) -> ALEN(mark(X))
MARK(len(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(len(X)) -> MARK(X)
MARK(add(X1, X2)) -> MARK(X2)
MARK(add(X1, X2)) -> MARK(X1)
AADD(0, X) -> MARK(X)
MARK(add(X1, X2)) -> AADD(mark(X1), mark(X2))
MARK(from(X)) -> MARK(X)
AFROM(X) -> MARK(X)
MARK(from(X)) -> AFROM(mark(X))
MARK(fst(X1, X2)) -> MARK(X2)
MARK(fst(X1, X2)) -> MARK(X1)
MARK(fst(X1, X2)) -> AFST(mark(X1), mark(X2))
AFST(s(X), cons(Y, Z)) -> MARK(Y)


Rules:


afst(0, Z) -> nil
afst(s(X), cons(Y, Z)) -> cons(mark(Y), fst(X, Z))
afst(X1, X2) -> fst(X1, X2)
afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
aadd(0, X) -> mark(X)
aadd(s(X), Y) -> s(add(X, Y))
aadd(X1, X2) -> add(X1, X2)
alen(nil) -> 0
alen(cons(X, Z)) -> s(len(Z))
alen(X) -> len(X)
mark(fst(X1, X2)) -> afst(mark(X1), mark(X2))
mark(from(X)) -> afrom(mark(X))
mark(add(X1, X2)) -> aadd(mark(X1), mark(X2))
mark(len(X)) -> alen(mark(X))
mark(0) -> 0
mark(s(X)) -> s(X)
mark(nil) -> nil
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))
AFST(s(X), cons(Y, Z)) -> MARK(Y)


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

mark(len(X)) -> alen(mark(X))
mark(nil) -> nil
mark(s(X)) -> s(X)
afst(0, Z) -> nil
afst(X1, X2) -> fst(X1, X2)
alen(X) -> len(X)
mark(cons(X1, X2)) -> cons(mark(X1), X2)
mark(from(X)) -> afrom(mark(X))
alen(nil) -> 0
aadd(X1, X2) -> add(X1, X2)
afrom(X) -> cons(mark(X), from(s(X)))
afst(s(X), cons(Y, Z)) -> cons(mark(Y), fst(X, Z))
afrom(X) -> from(X)
aadd(0, X) -> mark(X)
mark(0) -> 0
mark(add(X1, X2)) -> aadd(mark(X1), mark(X2))
mark(fst(X1, X2)) -> afst(mark(X1), mark(X2))
aadd(s(X), Y) -> s(add(X, Y))
alen(cons(X, Z)) -> s(len(Z))


Used ordering:
Polynomial Order with Interpretation:

POL( MARK(x1) ) = x1

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

POL( AFROM(x1) ) = x1

POL( len(x1) ) = x1

POL( AADD(x1, x2) ) = x2

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

POL( mark(x1) ) = x1

POL( AFST(x1, x2) ) = x2

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

POL( from(x1) ) = x1 + 1

POL( alen(x1) ) = x1

POL( nil ) = 0

POL( s(x1) ) = 0

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

POL( afrom(x1) ) = x1 + 1

POL( 0 ) = 0

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


This results in one new DP problem.


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


Dependency Pairs:

MARK(len(X)) -> MARK(X)
MARK(add(X1, X2)) -> MARK(X2)
MARK(add(X1, X2)) -> MARK(X1)
AADD(0, X) -> MARK(X)
MARK(add(X1, X2)) -> AADD(mark(X1), mark(X2))
AFROM(X) -> MARK(X)
MARK(fst(X1, X2)) -> MARK(X2)
MARK(fst(X1, X2)) -> MARK(X1)
MARK(fst(X1, X2)) -> AFST(mark(X1), mark(X2))


Rules:


afst(0, Z) -> nil
afst(s(X), cons(Y, Z)) -> cons(mark(Y), fst(X, Z))
afst(X1, X2) -> fst(X1, X2)
afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
aadd(0, X) -> mark(X)
aadd(s(X), Y) -> s(add(X, Y))
aadd(X1, X2) -> add(X1, X2)
alen(nil) -> 0
alen(cons(X, Z)) -> s(len(Z))
alen(X) -> len(X)
mark(fst(X1, X2)) -> afst(mark(X1), mark(X2))
mark(from(X)) -> afrom(mark(X))
mark(add(X1, X2)) -> aadd(mark(X1), mark(X2))
mark(len(X)) -> alen(mark(X))
mark(0) -> 0
mark(s(X)) -> s(X)
mark(nil) -> nil
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
Negative Polynomial Order


Dependency Pairs:

MARK(add(X1, X2)) -> MARK(X2)
MARK(add(X1, X2)) -> MARK(X1)
AADD(0, X) -> MARK(X)
MARK(add(X1, X2)) -> AADD(mark(X1), mark(X2))
MARK(fst(X1, X2)) -> MARK(X2)
MARK(fst(X1, X2)) -> MARK(X1)
MARK(len(X)) -> MARK(X)


Rules:


afst(0, Z) -> nil
afst(s(X), cons(Y, Z)) -> cons(mark(Y), fst(X, Z))
afst(X1, X2) -> fst(X1, X2)
afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
aadd(0, X) -> mark(X)
aadd(s(X), Y) -> s(add(X, Y))
aadd(X1, X2) -> add(X1, X2)
alen(nil) -> 0
alen(cons(X, Z)) -> s(len(Z))
alen(X) -> len(X)
mark(fst(X1, X2)) -> afst(mark(X1), mark(X2))
mark(from(X)) -> afrom(mark(X))
mark(add(X1, X2)) -> aadd(mark(X1), mark(X2))
mark(len(X)) -> alen(mark(X))
mark(0) -> 0
mark(s(X)) -> s(X)
mark(nil) -> nil
mark(cons(X1, X2)) -> cons(mark(X1), X2)


Strategy:

innermost




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

MARK(add(X1, X2)) -> MARK(X2)
MARK(add(X1, X2)) -> MARK(X1)
MARK(add(X1, X2)) -> AADD(mark(X1), mark(X2))


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

mark(len(X)) -> alen(mark(X))
mark(nil) -> nil
mark(s(X)) -> s(X)
afst(0, Z) -> nil
afst(X1, X2) -> fst(X1, X2)
alen(X) -> len(X)
mark(cons(X1, X2)) -> cons(mark(X1), X2)
mark(from(X)) -> afrom(mark(X))
alen(nil) -> 0
aadd(X1, X2) -> add(X1, X2)
afrom(X) -> cons(mark(X), from(s(X)))
afst(s(X), cons(Y, Z)) -> cons(mark(Y), fst(X, Z))
afrom(X) -> from(X)
aadd(0, X) -> mark(X)
mark(0) -> 0
mark(add(X1, X2)) -> aadd(mark(X1), mark(X2))
mark(fst(X1, X2)) -> afst(mark(X1), mark(X2))
aadd(s(X), Y) -> s(add(X, Y))
alen(cons(X, Z)) -> s(len(Z))


Used ordering:
Polynomial Order with Interpretation:

POL( MARK(x1) ) = x1

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

POL( AADD(x1, x2) ) = x2

POL( mark(x1) ) = x1

POL( len(x1) ) = x1

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

POL( alen(x1) ) = x1

POL( nil ) = 0

POL( s(x1) ) = 0

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

POL( cons(x1, x2) ) = 0

POL( from(x1) ) = 0

POL( afrom(x1) ) = 0

POL( 0 ) = 0

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


This results in one new DP problem.


   R
DPs
       →DP Problem 1
Neg POLO
           →DP Problem 2
DGraph
             ...
               →DP Problem 4
Dependency Graph


Dependency Pairs:

AADD(0, X) -> MARK(X)
MARK(fst(X1, X2)) -> MARK(X2)
MARK(fst(X1, X2)) -> MARK(X1)
MARK(len(X)) -> MARK(X)


Rules:


afst(0, Z) -> nil
afst(s(X), cons(Y, Z)) -> cons(mark(Y), fst(X, Z))
afst(X1, X2) -> fst(X1, X2)
afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
aadd(0, X) -> mark(X)
aadd(s(X), Y) -> s(add(X, Y))
aadd(X1, X2) -> add(X1, X2)
alen(nil) -> 0
alen(cons(X, Z)) -> s(len(Z))
alen(X) -> len(X)
mark(fst(X1, X2)) -> afst(mark(X1), mark(X2))
mark(from(X)) -> afrom(mark(X))
mark(add(X1, X2)) -> aadd(mark(X1), mark(X2))
mark(len(X)) -> alen(mark(X))
mark(0) -> 0
mark(s(X)) -> s(X)
mark(nil) -> nil
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 5
Usable Rules (Innermost)


Dependency Pairs:

MARK(len(X)) -> MARK(X)
MARK(fst(X1, X2)) -> MARK(X2)
MARK(fst(X1, X2)) -> MARK(X1)


Rules:


afst(0, Z) -> nil
afst(s(X), cons(Y, Z)) -> cons(mark(Y), fst(X, Z))
afst(X1, X2) -> fst(X1, X2)
afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
aadd(0, X) -> mark(X)
aadd(s(X), Y) -> s(add(X, Y))
aadd(X1, X2) -> add(X1, X2)
alen(nil) -> 0
alen(cons(X, Z)) -> s(len(Z))
alen(X) -> len(X)
mark(fst(X1, X2)) -> afst(mark(X1), mark(X2))
mark(from(X)) -> afrom(mark(X))
mark(add(X1, X2)) -> aadd(mark(X1), mark(X2))
mark(len(X)) -> alen(mark(X))
mark(0) -> 0
mark(s(X)) -> s(X)
mark(nil) -> nil
mark(cons(X1, X2)) -> cons(mark(X1), X2)


Strategy:

innermost




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


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


Dependency Pairs:

MARK(len(X)) -> MARK(X)
MARK(fst(X1, X2)) -> MARK(X2)
MARK(fst(X1, X2)) -> MARK(X1)


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. MARK(len(X)) -> MARK(X)
  2. MARK(fst(X1, X2)) -> MARK(X2)
  3. MARK(fst(X1, X2)) -> MARK(X1)
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:
len(x1) -> len(x1)
fst(x1, x2) -> fst(x1, x2)

We obtain no new DP problems.

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