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)

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)





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(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)
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)


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( afst(x1, x2) ) = x1 + x2

POL( afrom(x1) ) = x1 + 1

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

POL( alen(x1) ) = x1

POL( 0 ) = 0

POL( s(x1) ) = 0

POL( nil ) = 0


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)





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)





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(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)
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)


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( afst(x1, x2) ) = x1 + x2

POL( from(x1) ) = 0

POL( afrom(x1) ) = 0

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

POL( alen(x1) ) = x1

POL( 0 ) = 0

POL( s(x1) ) = 0

POL( nil ) = 0

POL( cons(x1, x2) ) = 0


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)





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
Size-Change Principle


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)





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):
{3, 2, 1} , {3, 2, 1}
1>1

which lead(s) to this/these maximal multigraph(s):
{3, 2, 1} , {3, 2, 1}
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.

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