Term Rewriting System R:
[x, l, y]
app(rev, nil) -> nil
app(rev, app(app(cons, x), l)) -> app(app(cons, app(app(rev1, x), l)), app(app(rev2, x), l))
app(app(rev1, 0), nil) -> 0
app(app(rev1, app(s, x)), nil) -> app(s, x)
app(app(rev1, x), app(app(cons, y), l)) -> app(app(rev1, y), l)
app(app(rev2, x), nil) -> nil
app(app(rev2, x), app(app(cons, y), l)) -> app(rev, app(app(cons, x), app(app(rev2, y), l)))

Termination of R to be shown.



   R
Overlay and local confluence Check



The TRS is overlay and locally confluent (all critical pairs are trivially joinable).Hence, we can switch to innermost.


   R
OC
       →TRS2
Dependency Pair Analysis



R contains the following Dependency Pairs:

APP(rev, app(app(cons, x), l)) -> APP(app(cons, app(app(rev1, x), l)), app(app(rev2, x), l))
APP(rev, app(app(cons, x), l)) -> APP(cons, app(app(rev1, x), l))
APP(rev, app(app(cons, x), l)) -> APP(app(rev1, x), l)
APP(rev, app(app(cons, x), l)) -> APP(rev1, x)
APP(rev, app(app(cons, x), l)) -> APP(app(rev2, x), l)
APP(rev, app(app(cons, x), l)) -> APP(rev2, x)
APP(app(rev1, x), app(app(cons, y), l)) -> APP(app(rev1, y), l)
APP(app(rev1, x), app(app(cons, y), l)) -> APP(rev1, y)
APP(app(rev2, x), app(app(cons, y), l)) -> APP(rev, app(app(cons, x), app(app(rev2, y), l)))
APP(app(rev2, x), app(app(cons, y), l)) -> APP(app(cons, x), app(app(rev2, y), l))
APP(app(rev2, x), app(app(cons, y), l)) -> APP(cons, x)
APP(app(rev2, x), app(app(cons, y), l)) -> APP(app(rev2, y), l)
APP(app(rev2, x), app(app(cons, y), l)) -> APP(rev2, y)

Furthermore, R contains two SCCs.


   R
OC
       →TRS2
DPs
           →DP Problem 1
Usable Rules (Innermost)
           →DP Problem 2
UsableRules


Dependency Pair:

APP(app(rev1, x), app(app(cons, y), l)) -> APP(app(rev1, y), l)


Rules:


app(rev, nil) -> nil
app(rev, app(app(cons, x), l)) -> app(app(cons, app(app(rev1, x), l)), app(app(rev2, x), l))
app(app(rev1, 0), nil) -> 0
app(app(rev1, app(s, x)), nil) -> app(s, x)
app(app(rev1, x), app(app(cons, y), l)) -> app(app(rev1, y), l)
app(app(rev2, x), nil) -> nil
app(app(rev2, x), app(app(cons, y), l)) -> app(rev, app(app(cons, x), app(app(rev2, y), l)))


Strategy:

innermost




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


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
             ...
               →DP Problem 3
A-Transformation
           →DP Problem 2
UsableRules


Dependency Pair:

APP(app(rev1, x), app(app(cons, y), l)) -> APP(app(rev1, y), l)


Rule:

none


Strategy:

innermost




We have an applicative DP problem with proper arity. Thus we can use the A-Transformation to obtain one new DP problem which consists of the A-transformed TRSs.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
             ...
               →DP Problem 4
Size-Change Principle
           →DP Problem 2
UsableRules


Dependency Pair:

REV1(x, cons(y, l)) -> REV1(y, l)


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. REV1(x, cons(y, l)) -> REV1(y, l)
and get the following Size-Change Graph(s):
{1} , {1}
2>1
2>2

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

DP: empty set
Oriented Rules: none

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

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

We obtain no new DP problems.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
Usable Rules (Innermost)


Dependency Pairs:

APP(app(rev2, x), app(app(cons, y), l)) -> APP(app(rev2, y), l)
APP(app(rev2, x), app(app(cons, y), l)) -> APP(rev, app(app(cons, x), app(app(rev2, y), l)))
APP(rev, app(app(cons, x), l)) -> APP(app(rev2, x), l)


Rules:


app(rev, nil) -> nil
app(rev, app(app(cons, x), l)) -> app(app(cons, app(app(rev1, x), l)), app(app(rev2, x), l))
app(app(rev1, 0), nil) -> 0
app(app(rev1, app(s, x)), nil) -> app(s, x)
app(app(rev1, x), app(app(cons, y), l)) -> app(app(rev1, y), l)
app(app(rev2, x), nil) -> nil
app(app(rev2, x), app(app(cons, y), l)) -> app(rev, app(app(cons, x), app(app(rev2, y), l)))


Strategy:

innermost




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


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
             ...
               →DP Problem 5
A-Transformation


Dependency Pairs:

APP(app(rev2, x), app(app(cons, y), l)) -> APP(app(rev2, y), l)
APP(app(rev2, x), app(app(cons, y), l)) -> APP(rev, app(app(cons, x), app(app(rev2, y), l)))
APP(rev, app(app(cons, x), l)) -> APP(app(rev2, x), l)


Rules:


app(app(rev2, x), app(app(cons, y), l)) -> app(rev, app(app(cons, x), app(app(rev2, y), l)))
app(app(rev1, 0), nil) -> 0
app(app(rev1, x), app(app(cons, y), l)) -> app(app(rev1, y), l)
app(rev, app(app(cons, x), l)) -> app(app(cons, app(app(rev1, x), l)), app(app(rev2, x), l))
app(app(rev1, app(s, x)), nil) -> app(s, x)
app(app(rev2, x), nil) -> nil


Strategy:

innermost




We have an applicative DP problem with proper arity. Thus we can use the A-Transformation to obtain one new DP problem which consists of the A-transformed TRSs.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
             ...
               →DP Problem 6
Negative Polynomial Order


Dependency Pairs:

REV2(x, cons(y, l)) -> REV2(y, l)
REV2(x, cons(y, l)) -> REV(cons(x, rev2(y, l)))
REV(cons(x, l)) -> REV2(x, l)


Rules:


rev2(x, cons(y, l)) -> rev(cons(x, rev2(y, l)))
rev2(x, nil) -> nil
rev(cons(x, l)) -> cons(rev1(x, l), rev2(x, l))
rev1(0, nil) -> 0
rev1(x, cons(y, l)) -> rev1(y, l)
rev1(s(x), nil) -> s(x)


Strategy:

innermost




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

REV2(x, cons(y, l)) -> REV2(y, l)
REV(cons(x, l)) -> REV2(x, l)


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

rev1(0, nil) -> 0
rev2(x, cons(y, l)) -> rev(cons(x, rev2(y, l)))
rev2(x, nil) -> nil
rev1(s(x), nil) -> s(x)
rev(cons(x, l)) -> cons(rev1(x, l), rev2(x, l))
rev1(x, cons(y, l)) -> rev1(y, l)


Used ordering:
Polynomial Order with Interpretation:

POL( REV2(x1, x2) ) = x2

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

POL( REV(x1) ) = x1

POL( rev2(x1, x2) ) = x2

POL( rev1(x1, x2) ) = 0

POL( 0 ) = 0

POL( rev(x1) ) = x1

POL( nil ) = 0

POL( s(x1) ) = 0


This results in one new DP problem.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
             ...
               →DP Problem 7
Dependency Graph


Dependency Pair:

REV2(x, cons(y, l)) -> REV(cons(x, rev2(y, l)))


Rules:


rev2(x, cons(y, l)) -> rev(cons(x, rev2(y, l)))
rev2(x, nil) -> nil
rev(cons(x, l)) -> cons(rev1(x, l), rev2(x, l))
rev1(0, nil) -> 0
rev1(x, cons(y, l)) -> rev1(y, l)
rev1(s(x), nil) -> s(x)


Strategy:

innermost




Using the Dependency Graph resulted in no new DP problems.

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