Term Rewriting System R:
[X, Y, Z, X1, X2]
sel(s(X), cons(Y, Z)) -> sel(X, activate(Z))
sel(0, cons(X, Z)) -> X
sel(X1, X2) -> nsel(X1, X2)
first(0, Z) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(X, activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
sel1(s(X), cons(Y, Z)) -> sel1(X, activate(Z))
sel1(0, cons(X, Z)) -> quote(X)
first1(0, Z) -> nil1
first1(s(X), cons(Y, Z)) -> cons1(quote(Y), first1(X, activate(Z)))
quote(n0) -> 01
quote(ns(X)) -> s1(quote(activate(X)))
quote(nsel(X, Z)) -> sel1(activate(X), activate(Z))
quote1(ncons(X, Z)) -> cons1(quote(activate(X)), quote1(activate(Z)))
quote1(nnil) -> nil1
quote1(nfirst(X, Z)) -> first1(activate(X), activate(Z))
unquote(01) -> 0
unquote(s1(X)) -> s(unquote(X))
unquote1(nil1) -> nil
unquote1(cons1(X, Z)) -> fcons(unquote(X), unquote1(Z))
fcons(X, Z) -> cons(X, Z)
s(X) -> ns(X)
0 -> n0
cons(X1, X2) -> ncons(X1, X2)
nil -> nnil
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(n0) -> 0
activate(ncons(X1, X2)) -> cons(activate(X1), X2)
activate(nnil) -> nil
activate(nsel(X1, X2)) -> sel(activate(X1), activate(X2))
activate(X) -> X

Innermost Termination of R to be shown.



   R
Removing Redundant Rules for Innermost Termination



Removing the following rules from R which left hand sides contain non normal subterms

sel(s(X), cons(Y, Z)) -> sel(X, activate(Z))
sel(0, cons(X, Z)) -> X
first(0, Z) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(X, activate(Z)))
sel1(s(X), cons(Y, Z)) -> sel1(X, activate(Z))
sel1(0, cons(X, Z)) -> quote(X)
first1(0, Z) -> nil1
first1(s(X), cons(Y, Z)) -> cons1(quote(Y), first1(X, activate(Z)))


   R
RRRI
       →TRS2
Dependency Pair Analysis



R contains the following Dependency Pairs:

FROM(X) -> CONS(X, nfrom(ns(X)))
QUOTE(ns(X)) -> QUOTE(activate(X))
QUOTE(ns(X)) -> ACTIVATE(X)
QUOTE(nsel(X, Z)) -> ACTIVATE(X)
QUOTE(nsel(X, Z)) -> ACTIVATE(Z)
ACTIVATE(nfirst(X1, X2)) -> FIRST(activate(X1), activate(X2))
ACTIVATE(nfirst(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(nfirst(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(nfrom(X)) -> FROM(activate(X))
ACTIVATE(nfrom(X)) -> ACTIVATE(X)
ACTIVATE(ns(X)) -> S(activate(X))
ACTIVATE(ns(X)) -> ACTIVATE(X)
ACTIVATE(n0) -> 0'
ACTIVATE(ncons(X1, X2)) -> CONS(activate(X1), X2)
ACTIVATE(ncons(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(nnil) -> NIL
ACTIVATE(nsel(X1, X2)) -> SEL(activate(X1), activate(X2))
ACTIVATE(nsel(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(nsel(X1, X2)) -> ACTIVATE(X2)
QUOTE1(ncons(X, Z)) -> QUOTE(activate(X))
QUOTE1(ncons(X, Z)) -> ACTIVATE(X)
QUOTE1(ncons(X, Z)) -> QUOTE1(activate(Z))
QUOTE1(ncons(X, Z)) -> ACTIVATE(Z)
QUOTE1(nfirst(X, Z)) -> ACTIVATE(X)
QUOTE1(nfirst(X, Z)) -> ACTIVATE(Z)
UNQUOTE(01) -> 0'
UNQUOTE(s1(X)) -> S(unquote(X))
UNQUOTE(s1(X)) -> UNQUOTE(X)
UNQUOTE1(nil1) -> NIL
UNQUOTE1(cons1(X, Z)) -> FCONS(unquote(X), unquote1(Z))
UNQUOTE1(cons1(X, Z)) -> UNQUOTE(X)
UNQUOTE1(cons1(X, Z)) -> UNQUOTE1(Z)
FCONS(X, Z) -> CONS(X, Z)

Furthermore, R contains five SCCs.


   R
RRRI
       →TRS2
DPs
           →DP Problem 1
Size-Change Principle
           →DP Problem 2
SCP
           →DP Problem 3
Neg POLO
           →DP Problem 4
SCP
           →DP Problem 5
NonTerm


Dependency Pairs:

ACTIVATE(nsel(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(nsel(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(ncons(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(ns(X)) -> ACTIVATE(X)
ACTIVATE(nfrom(X)) -> ACTIVATE(X)
ACTIVATE(nfirst(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(nfirst(X1, X2)) -> ACTIVATE(X1)


Rules:


sel(X1, X2) -> nsel(X1, X2)
first(X1, X2) -> nfirst(X1, X2)
from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
cons(X1, X2) -> ncons(X1, X2)
quote(n0) -> 01
quote(ns(X)) -> s1(quote(activate(X)))
quote(nsel(X, Z)) -> sel1(activate(X), activate(Z))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(n0) -> 0
activate(ncons(X1, X2)) -> cons(activate(X1), X2)
activate(nnil) -> nil
activate(nsel(X1, X2)) -> sel(activate(X1), activate(X2))
activate(X) -> X
quote1(ncons(X, Z)) -> cons1(quote(activate(X)), quote1(activate(Z)))
quote1(nnil) -> nil1
quote1(nfirst(X, Z)) -> first1(activate(X), activate(Z))
unquote(01) -> 0
unquote(s1(X)) -> s(unquote(X))
0 -> n0
s(X) -> ns(X)
unquote1(nil1) -> nil
unquote1(cons1(X, Z)) -> fcons(unquote(X), unquote1(Z))
nil -> nnil
fcons(X, Z) -> cons(X, Z)





We number the DPs as follows:
  1. ACTIVATE(nsel(X1, X2)) -> ACTIVATE(X2)
  2. ACTIVATE(nsel(X1, X2)) -> ACTIVATE(X1)
  3. ACTIVATE(ncons(X1, X2)) -> ACTIVATE(X1)
  4. ACTIVATE(ns(X)) -> ACTIVATE(X)
  5. ACTIVATE(nfrom(X)) -> ACTIVATE(X)
  6. ACTIVATE(nfirst(X1, X2)) -> ACTIVATE(X2)
  7. ACTIVATE(nfirst(X1, X2)) -> ACTIVATE(X1)
and get the following Size-Change Graph(s):
{7, 6, 5, 4, 3, 2, 1} , {7, 6, 5, 4, 3, 2, 1}
1>1

which lead(s) to this/these maximal multigraph(s):
{7, 6, 5, 4, 3, 2, 1} , {7, 6, 5, 4, 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:
ncons(x1, x2) -> ncons(x1, x2)
nfrom(x1) -> nfrom(x1)
nsel(x1, x2) -> nsel(x1, x2)
ns(x1) -> ns(x1)
nfirst(x1, x2) -> nfirst(x1, x2)

We obtain no new DP problems.


   R
RRRI
       →TRS2
DPs
           →DP Problem 1
SCP
           →DP Problem 2
Size-Change Principle
           →DP Problem 3
Neg POLO
           →DP Problem 4
SCP
           →DP Problem 5
NonTerm


Dependency Pair:

UNQUOTE(s1(X)) -> UNQUOTE(X)


Rules:


sel(X1, X2) -> nsel(X1, X2)
first(X1, X2) -> nfirst(X1, X2)
from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
cons(X1, X2) -> ncons(X1, X2)
quote(n0) -> 01
quote(ns(X)) -> s1(quote(activate(X)))
quote(nsel(X, Z)) -> sel1(activate(X), activate(Z))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(n0) -> 0
activate(ncons(X1, X2)) -> cons(activate(X1), X2)
activate(nnil) -> nil
activate(nsel(X1, X2)) -> sel(activate(X1), activate(X2))
activate(X) -> X
quote1(ncons(X, Z)) -> cons1(quote(activate(X)), quote1(activate(Z)))
quote1(nnil) -> nil1
quote1(nfirst(X, Z)) -> first1(activate(X), activate(Z))
unquote(01) -> 0
unquote(s1(X)) -> s(unquote(X))
0 -> n0
s(X) -> ns(X)
unquote1(nil1) -> nil
unquote1(cons1(X, Z)) -> fcons(unquote(X), unquote1(Z))
nil -> nnil
fcons(X, Z) -> cons(X, Z)





We number the DPs as follows:
  1. UNQUOTE(s1(X)) -> UNQUOTE(X)
and get the following Size-Change Graph(s):
{1} , {1}
1>1

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

We obtain no new DP problems.


   R
RRRI
       →TRS2
DPs
           →DP Problem 1
SCP
           →DP Problem 2
SCP
           →DP Problem 3
Negative Polynomial Order
           →DP Problem 4
SCP
           →DP Problem 5
NonTerm


Dependency Pair:

QUOTE(ns(X)) -> QUOTE(activate(X))


Rules:


sel(X1, X2) -> nsel(X1, X2)
first(X1, X2) -> nfirst(X1, X2)
from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
cons(X1, X2) -> ncons(X1, X2)
quote(n0) -> 01
quote(ns(X)) -> s1(quote(activate(X)))
quote(nsel(X, Z)) -> sel1(activate(X), activate(Z))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(n0) -> 0
activate(ncons(X1, X2)) -> cons(activate(X1), X2)
activate(nnil) -> nil
activate(nsel(X1, X2)) -> sel(activate(X1), activate(X2))
activate(X) -> X
quote1(ncons(X, Z)) -> cons1(quote(activate(X)), quote1(activate(Z)))
quote1(nnil) -> nil1
quote1(nfirst(X, Z)) -> first1(activate(X), activate(Z))
unquote(01) -> 0
unquote(s1(X)) -> s(unquote(X))
0 -> n0
s(X) -> ns(X)
unquote1(nil1) -> nil
unquote1(cons1(X, Z)) -> fcons(unquote(X), unquote1(Z))
nil -> nnil
fcons(X, Z) -> cons(X, Z)





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

QUOTE(ns(X)) -> QUOTE(activate(X))


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

activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(n0) -> 0
activate(ncons(X1, X2)) -> cons(activate(X1), X2)
activate(nnil) -> nil
activate(nsel(X1, X2)) -> sel(activate(X1), activate(X2))
activate(X) -> X
first(X1, X2) -> nfirst(X1, X2)
from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
s(X) -> ns(X)
0 -> n0
cons(X1, X2) -> ncons(X1, X2)
nil -> nnil
sel(X1, X2) -> nsel(X1, X2)


Used ordering:
Polynomial Order with Interpretation:

POL( QUOTE(x1) ) = x1

POL( ns(x1) ) = x1 + 1

POL( activate(x1) ) = x1

POL( nfirst(x1, x2) ) = 0

POL( first(x1, x2) ) = 0

POL( nfrom(x1) ) = 0

POL( from(x1) ) = 0

POL( s(x1) ) = x1 + 1

POL( n0 ) = 0

POL( 0 ) = 0

POL( ncons(x1, x2) ) = 0

POL( cons(x1, x2) ) = 0

POL( nnil ) = 0

POL( nil ) = 0

POL( nsel(x1, x2) ) = 0

POL( sel(x1, x2) ) = 0


This results in one new DP problem.


   R
RRRI
       →TRS2
DPs
           →DP Problem 1
SCP
           →DP Problem 2
SCP
           →DP Problem 3
Neg POLO
             ...
               →DP Problem 6
Dependency Graph
           →DP Problem 4
SCP
           →DP Problem 5
NonTerm


Dependency Pair:


Rules:


sel(X1, X2) -> nsel(X1, X2)
first(X1, X2) -> nfirst(X1, X2)
from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
cons(X1, X2) -> ncons(X1, X2)
quote(n0) -> 01
quote(ns(X)) -> s1(quote(activate(X)))
quote(nsel(X, Z)) -> sel1(activate(X), activate(Z))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(n0) -> 0
activate(ncons(X1, X2)) -> cons(activate(X1), X2)
activate(nnil) -> nil
activate(nsel(X1, X2)) -> sel(activate(X1), activate(X2))
activate(X) -> X
quote1(ncons(X, Z)) -> cons1(quote(activate(X)), quote1(activate(Z)))
quote1(nnil) -> nil1
quote1(nfirst(X, Z)) -> first1(activate(X), activate(Z))
unquote(01) -> 0
unquote(s1(X)) -> s(unquote(X))
0 -> n0
s(X) -> ns(X)
unquote1(nil1) -> nil
unquote1(cons1(X, Z)) -> fcons(unquote(X), unquote1(Z))
nil -> nnil
fcons(X, Z) -> cons(X, Z)





Using the Dependency Graph resulted in no new DP problems.


   R
RRRI
       →TRS2
DPs
           →DP Problem 1
SCP
           →DP Problem 2
SCP
           →DP Problem 3
Neg POLO
           →DP Problem 4
Size-Change Principle
           →DP Problem 5
NonTerm


Dependency Pair:

UNQUOTE1(cons1(X, Z)) -> UNQUOTE1(Z)


Rules:


sel(X1, X2) -> nsel(X1, X2)
first(X1, X2) -> nfirst(X1, X2)
from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
cons(X1, X2) -> ncons(X1, X2)
quote(n0) -> 01
quote(ns(X)) -> s1(quote(activate(X)))
quote(nsel(X, Z)) -> sel1(activate(X), activate(Z))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(n0) -> 0
activate(ncons(X1, X2)) -> cons(activate(X1), X2)
activate(nnil) -> nil
activate(nsel(X1, X2)) -> sel(activate(X1), activate(X2))
activate(X) -> X
quote1(ncons(X, Z)) -> cons1(quote(activate(X)), quote1(activate(Z)))
quote1(nnil) -> nil1
quote1(nfirst(X, Z)) -> first1(activate(X), activate(Z))
unquote(01) -> 0
unquote(s1(X)) -> s(unquote(X))
0 -> n0
s(X) -> ns(X)
unquote1(nil1) -> nil
unquote1(cons1(X, Z)) -> fcons(unquote(X), unquote1(Z))
nil -> nnil
fcons(X, Z) -> cons(X, Z)





We number the DPs as follows:
  1. UNQUOTE1(cons1(X, Z)) -> UNQUOTE1(Z)
and get the following Size-Change Graph(s):
{1} , {1}
1>1

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

We obtain no new DP problems.


   R
RRRI
       →TRS2
DPs
           →DP Problem 1
SCP
           →DP Problem 2
SCP
           →DP Problem 3
Neg POLO
           →DP Problem 4
SCP
           →DP Problem 5
Non Termination


Dependency Pair:

QUOTE1(ncons(X, Z)) -> QUOTE1(activate(Z))


Rules:


sel(X1, X2) -> nsel(X1, X2)
first(X1, X2) -> nfirst(X1, X2)
from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
cons(X1, X2) -> ncons(X1, X2)
quote(n0) -> 01
quote(ns(X)) -> s1(quote(activate(X)))
quote(nsel(X, Z)) -> sel1(activate(X), activate(Z))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(n0) -> 0
activate(ncons(X1, X2)) -> cons(activate(X1), X2)
activate(nnil) -> nil
activate(nsel(X1, X2)) -> sel(activate(X1), activate(X2))
activate(X) -> X
quote1(ncons(X, Z)) -> cons1(quote(activate(X)), quote1(activate(Z)))
quote1(nnil) -> nil1
quote1(nfirst(X, Z)) -> first1(activate(X), activate(Z))
unquote(01) -> 0
unquote(s1(X)) -> s(unquote(X))
0 -> n0
s(X) -> ns(X)
unquote1(nil1) -> nil
unquote1(cons1(X, Z)) -> fcons(unquote(X), unquote1(Z))
nil -> nnil
fcons(X, Z) -> cons(X, Z)





Found an infinite P-chain over R:
P =

QUOTE1(ncons(X, Z)) -> QUOTE1(activate(Z))

R =

sel(X1, X2) -> nsel(X1, X2)
first(X1, X2) -> nfirst(X1, X2)
from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
cons(X1, X2) -> ncons(X1, X2)
quote(n0) -> 01
quote(ns(X)) -> s1(quote(activate(X)))
quote(nsel(X, Z)) -> sel1(activate(X), activate(Z))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(n0) -> 0
activate(ncons(X1, X2)) -> cons(activate(X1), X2)
activate(nnil) -> nil
activate(nsel(X1, X2)) -> sel(activate(X1), activate(X2))
activate(X) -> X
quote1(ncons(X, Z)) -> cons1(quote(activate(X)), quote1(activate(Z)))
quote1(nnil) -> nil1
quote1(nfirst(X, Z)) -> first1(activate(X), activate(Z))
unquote(01) -> 0
unquote(s1(X)) -> s(unquote(X))
0 -> n0
s(X) -> ns(X)
unquote1(nil1) -> nil
unquote1(cons1(X, Z)) -> fcons(unquote(X), unquote1(Z))
nil -> nnil
fcons(X, Z) -> cons(X, Z)

s = QUOTE1(activate(nfrom(X')))
evaluates to t =QUOTE1(activate(nfrom(ns(activate(X')))))

Thus, s starts an infinite chain as s matches t.

Innermost Non-Termination of R could be shown.
Duration:
0:06 minutes