Term Rewriting System R:
[x, y, n, u, v, w, z]
minus(x, 0) -> x
minus(s(x), s(y)) -> minus(x, y)
quot(0, s(y)) -> 0
quot(s(x), s(y)) -> s(quot(minus(x, y), s(y)))
app(nil, y) -> y
app(add(n, x), y) -> add(n, app(x, y))
reverse(nil) -> nil
reverse(add(n, x)) -> app(reverse(x), add(n, nil))
shuffle(nil) -> nil
shuffle(add(n, x)) -> add(n, shuffle(reverse(x)))
concat(leaf, y) -> y
concat(cons(u, v), y) -> cons(u, concat(v, y))
lessleaves(x, leaf) -> false
lessleaves(leaf, cons(w, z)) -> true
lessleaves(cons(u, v), cons(w, z)) -> lessleaves(concat(u, v), concat(w, z))

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:

MINUS(s(x), s(y)) -> MINUS(x, y)
QUOT(s(x), s(y)) -> QUOT(minus(x, y), s(y))
QUOT(s(x), s(y)) -> MINUS(x, y)
APP(add(n, x), y) -> APP(x, y)
REVERSE(add(n, x)) -> APP(reverse(x), add(n, nil))
REVERSE(add(n, x)) -> REVERSE(x)
SHUFFLE(add(n, x)) -> SHUFFLE(reverse(x))
SHUFFLE(add(n, x)) -> REVERSE(x)
CONCAT(cons(u, v), y) -> CONCAT(v, y)
LESSLEAVES(cons(u, v), cons(w, z)) -> LESSLEAVES(concat(u, v), concat(w, z))
LESSLEAVES(cons(u, v), cons(w, z)) -> CONCAT(u, v)
LESSLEAVES(cons(u, v), cons(w, z)) -> CONCAT(w, z)

Furthermore, R contains seven SCCs.


   R
OC
       →TRS2
DPs
           →DP Problem 1
Usable Rules (Innermost)
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
           →DP Problem 5
UsableRules
           →DP Problem 6
UsableRules
           →DP Problem 7
UsableRules


Dependency Pair:

MINUS(s(x), s(y)) -> MINUS(x, y)


Rules:


minus(x, 0) -> x
minus(s(x), s(y)) -> minus(x, y)
quot(0, s(y)) -> 0
quot(s(x), s(y)) -> s(quot(minus(x, y), s(y)))
app(nil, y) -> y
app(add(n, x), y) -> add(n, app(x, y))
reverse(nil) -> nil
reverse(add(n, x)) -> app(reverse(x), add(n, nil))
shuffle(nil) -> nil
shuffle(add(n, x)) -> add(n, shuffle(reverse(x)))
concat(leaf, y) -> y
concat(cons(u, v), y) -> cons(u, concat(v, y))
lessleaves(x, leaf) -> false
lessleaves(leaf, cons(w, z)) -> true
lessleaves(cons(u, v), cons(w, z)) -> lessleaves(concat(u, v), concat(w, z))


Strategy:

innermost




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


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
             ...
               →DP Problem 8
Size-Change Principle
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
           →DP Problem 5
UsableRules
           →DP Problem 6
UsableRules
           →DP Problem 7
UsableRules


Dependency Pair:

MINUS(s(x), s(y)) -> MINUS(x, y)


Rule:

none


Strategy:

innermost




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

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

We obtain no new DP problems.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
Usable Rules (Innermost)
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
           →DP Problem 5
UsableRules
           →DP Problem 6
UsableRules
           →DP Problem 7
UsableRules


Dependency Pair:

APP(add(n, x), y) -> APP(x, y)


Rules:


minus(x, 0) -> x
minus(s(x), s(y)) -> minus(x, y)
quot(0, s(y)) -> 0
quot(s(x), s(y)) -> s(quot(minus(x, y), s(y)))
app(nil, y) -> y
app(add(n, x), y) -> add(n, app(x, y))
reverse(nil) -> nil
reverse(add(n, x)) -> app(reverse(x), add(n, nil))
shuffle(nil) -> nil
shuffle(add(n, x)) -> add(n, shuffle(reverse(x)))
concat(leaf, y) -> y
concat(cons(u, v), y) -> cons(u, concat(v, y))
lessleaves(x, leaf) -> false
lessleaves(leaf, cons(w, z)) -> true
lessleaves(cons(u, v), cons(w, z)) -> lessleaves(concat(u, v), concat(w, z))


Strategy:

innermost




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


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
             ...
               →DP Problem 9
Size-Change Principle
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
           →DP Problem 5
UsableRules
           →DP Problem 6
UsableRules
           →DP Problem 7
UsableRules


Dependency Pair:

APP(add(n, x), y) -> APP(x, y)


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. APP(add(n, x), y) -> APP(x, y)
and get the following Size-Change Graph(s):
{1} , {1}
1>1
2=2

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

We obtain no new DP problems.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
Usable Rules (Innermost)
           →DP Problem 4
UsableRules
           →DP Problem 5
UsableRules
           →DP Problem 6
UsableRules
           →DP Problem 7
UsableRules


Dependency Pair:

CONCAT(cons(u, v), y) -> CONCAT(v, y)


Rules:


minus(x, 0) -> x
minus(s(x), s(y)) -> minus(x, y)
quot(0, s(y)) -> 0
quot(s(x), s(y)) -> s(quot(minus(x, y), s(y)))
app(nil, y) -> y
app(add(n, x), y) -> add(n, app(x, y))
reverse(nil) -> nil
reverse(add(n, x)) -> app(reverse(x), add(n, nil))
shuffle(nil) -> nil
shuffle(add(n, x)) -> add(n, shuffle(reverse(x)))
concat(leaf, y) -> y
concat(cons(u, v), y) -> cons(u, concat(v, y))
lessleaves(x, leaf) -> false
lessleaves(leaf, cons(w, z)) -> true
lessleaves(cons(u, v), cons(w, z)) -> lessleaves(concat(u, v), concat(w, z))


Strategy:

innermost




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


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
             ...
               →DP Problem 10
Size-Change Principle
           →DP Problem 4
UsableRules
           →DP Problem 5
UsableRules
           →DP Problem 6
UsableRules
           →DP Problem 7
UsableRules


Dependency Pair:

CONCAT(cons(u, v), y) -> CONCAT(v, y)


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. CONCAT(cons(u, v), y) -> CONCAT(v, y)
and get the following Size-Change Graph(s):
{1} , {1}
1>1
2=2

which lead(s) to this/these maximal multigraph(s):
{1} , {1}
1>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
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
Usable Rules (Innermost)
           →DP Problem 5
UsableRules
           →DP Problem 6
UsableRules
           →DP Problem 7
UsableRules


Dependency Pair:

QUOT(s(x), s(y)) -> QUOT(minus(x, y), s(y))


Rules:


minus(x, 0) -> x
minus(s(x), s(y)) -> minus(x, y)
quot(0, s(y)) -> 0
quot(s(x), s(y)) -> s(quot(minus(x, y), s(y)))
app(nil, y) -> y
app(add(n, x), y) -> add(n, app(x, y))
reverse(nil) -> nil
reverse(add(n, x)) -> app(reverse(x), add(n, nil))
shuffle(nil) -> nil
shuffle(add(n, x)) -> add(n, shuffle(reverse(x)))
concat(leaf, y) -> y
concat(cons(u, v), y) -> cons(u, concat(v, y))
lessleaves(x, leaf) -> false
lessleaves(leaf, cons(w, z)) -> true
lessleaves(cons(u, v), cons(w, z)) -> lessleaves(concat(u, v), concat(w, z))


Strategy:

innermost




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


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
             ...
               →DP Problem 11
Negative Polynomial Order
           →DP Problem 5
UsableRules
           →DP Problem 6
UsableRules
           →DP Problem 7
UsableRules


Dependency Pair:

QUOT(s(x), s(y)) -> QUOT(minus(x, y), s(y))


Rules:


minus(s(x), s(y)) -> minus(x, y)
minus(x, 0) -> x


Strategy:

innermost




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

QUOT(s(x), s(y)) -> QUOT(minus(x, y), s(y))


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

minus(s(x), s(y)) -> minus(x, y)
minus(x, 0) -> x


Used ordering:
Polynomial Order with Interpretation:

POL( QUOT(x1, x2) ) = x1

POL( s(x1) ) = x1 + 1

POL( minus(x1, x2) ) = x1


This results in one new DP problem.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
             ...
               →DP Problem 12
Dependency Graph
           →DP Problem 5
UsableRules
           →DP Problem 6
UsableRules
           →DP Problem 7
UsableRules


Dependency Pair:


Rules:


minus(s(x), s(y)) -> minus(x, y)
minus(x, 0) -> x


Strategy:

innermost




Using the Dependency Graph resulted in no new DP problems.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
           →DP Problem 5
Usable Rules (Innermost)
           →DP Problem 6
UsableRules
           →DP Problem 7
UsableRules


Dependency Pair:

REVERSE(add(n, x)) -> REVERSE(x)


Rules:


minus(x, 0) -> x
minus(s(x), s(y)) -> minus(x, y)
quot(0, s(y)) -> 0
quot(s(x), s(y)) -> s(quot(minus(x, y), s(y)))
app(nil, y) -> y
app(add(n, x), y) -> add(n, app(x, y))
reverse(nil) -> nil
reverse(add(n, x)) -> app(reverse(x), add(n, nil))
shuffle(nil) -> nil
shuffle(add(n, x)) -> add(n, shuffle(reverse(x)))
concat(leaf, y) -> y
concat(cons(u, v), y) -> cons(u, concat(v, y))
lessleaves(x, leaf) -> false
lessleaves(leaf, cons(w, z)) -> true
lessleaves(cons(u, v), cons(w, z)) -> lessleaves(concat(u, v), concat(w, z))


Strategy:

innermost




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


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
           →DP Problem 5
UsableRules
             ...
               →DP Problem 13
Size-Change Principle
           →DP Problem 6
UsableRules
           →DP Problem 7
UsableRules


Dependency Pair:

REVERSE(add(n, x)) -> REVERSE(x)


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. REVERSE(add(n, x)) -> REVERSE(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:
add(x1, x2) -> add(x1, x2)

We obtain no new DP problems.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
           →DP Problem 5
UsableRules
           →DP Problem 6
Usable Rules (Innermost)
           →DP Problem 7
UsableRules


Dependency Pair:

LESSLEAVES(cons(u, v), cons(w, z)) -> LESSLEAVES(concat(u, v), concat(w, z))


Rules:


minus(x, 0) -> x
minus(s(x), s(y)) -> minus(x, y)
quot(0, s(y)) -> 0
quot(s(x), s(y)) -> s(quot(minus(x, y), s(y)))
app(nil, y) -> y
app(add(n, x), y) -> add(n, app(x, y))
reverse(nil) -> nil
reverse(add(n, x)) -> app(reverse(x), add(n, nil))
shuffle(nil) -> nil
shuffle(add(n, x)) -> add(n, shuffle(reverse(x)))
concat(leaf, y) -> y
concat(cons(u, v), y) -> cons(u, concat(v, y))
lessleaves(x, leaf) -> false
lessleaves(leaf, cons(w, z)) -> true
lessleaves(cons(u, v), cons(w, z)) -> lessleaves(concat(u, v), concat(w, z))


Strategy:

innermost




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


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
           →DP Problem 5
UsableRules
           →DP Problem 6
UsableRules
             ...
               →DP Problem 14
Modular Removal of Rules
           →DP Problem 7
UsableRules


Dependency Pair:

LESSLEAVES(cons(u, v), cons(w, z)) -> LESSLEAVES(concat(u, v), concat(w, z))


Rules:


concat(cons(u, v), y) -> cons(u, concat(v, y))
concat(leaf, y) -> y


Strategy:

innermost




We have the following set of usable rules:

concat(cons(u, v), y) -> cons(u, concat(v, y))
concat(leaf, y) -> y
To remove rules and DPs from this DP problem we used the following monotonic and CE-compatible order: Polynomial ordering.
Polynomial interpretation:
  POL(cons(x1, x2))=  x1 + x2  
  POL(LESS_LEAVES(x1, x2))=  x1 + x2  
  POL(leaf)=  0  
  POL(concat(x1, x2))=  x1 + x2  

We have the following set D of usable symbols: {cons, LESSLEAVES, concat}
No Dependency Pairs can be deleted.
The following rules can be deleted as they contain symbols in their lhs which do not occur in D:

concat(leaf, y) -> y


The result of this processor delivers one new DP problem.



   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
           →DP Problem 5
UsableRules
           →DP Problem 6
UsableRules
             ...
               →DP Problem 15
Modular Removal of Rules
           →DP Problem 7
UsableRules


Dependency Pair:

LESSLEAVES(cons(u, v), cons(w, z)) -> LESSLEAVES(concat(u, v), concat(w, z))


Rule:


concat(cons(u, v), y) -> cons(u, concat(v, y))


Strategy:

innermost




We have the following set of usable rules:

concat(cons(u, v), y) -> cons(u, concat(v, y))
To remove rules and DPs from this DP problem we used the following monotonic and CE-compatible order: Polynomial ordering.
Polynomial interpretation:
  POL(cons(x1, x2))=  1 + x1 + x2  
  POL(LESS_LEAVES(x1, x2))=  1 + x1 + x2  
  POL(concat(x1, x2))=  x1 + x2  

We have the following set D of usable symbols: {cons, LESSLEAVES, concat}
The following Dependency Pairs can be deleted as the lhs is strictly greater than the corresponding rhs:

LESSLEAVES(cons(u, v), cons(w, z)) -> LESSLEAVES(concat(u, v), concat(w, z))

No Rules can be deleted.

After the removal, there are no SCCs in the dependency graph which results in no DP problems which have to be solved.



   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
           →DP Problem 5
UsableRules
           →DP Problem 6
UsableRules
           →DP Problem 7
Usable Rules (Innermost)


Dependency Pair:

SHUFFLE(add(n, x)) -> SHUFFLE(reverse(x))


Rules:


minus(x, 0) -> x
minus(s(x), s(y)) -> minus(x, y)
quot(0, s(y)) -> 0
quot(s(x), s(y)) -> s(quot(minus(x, y), s(y)))
app(nil, y) -> y
app(add(n, x), y) -> add(n, app(x, y))
reverse(nil) -> nil
reverse(add(n, x)) -> app(reverse(x), add(n, nil))
shuffle(nil) -> nil
shuffle(add(n, x)) -> add(n, shuffle(reverse(x)))
concat(leaf, y) -> y
concat(cons(u, v), y) -> cons(u, concat(v, y))
lessleaves(x, leaf) -> false
lessleaves(leaf, cons(w, z)) -> true
lessleaves(cons(u, v), cons(w, z)) -> lessleaves(concat(u, v), concat(w, z))


Strategy:

innermost




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


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
           →DP Problem 4
UsableRules
           →DP Problem 5
UsableRules
           →DP Problem 6
UsableRules
           →DP Problem 7
UsableRules
             ...
               →DP Problem 16
Modular Removal of Rules


Dependency Pair:

SHUFFLE(add(n, x)) -> SHUFFLE(reverse(x))


Rules:


app(nil, y) -> y
app(add(n, x), y) -> add(n, app(x, y))
reverse(nil) -> nil
reverse(add(n, x)) -> app(reverse(x), add(n, nil))


Strategy:

innermost




We have the following set of usable rules:

app(nil, y) -> y
app(add(n, x), y) -> add(n, app(x, y))
reverse(nil) -> nil
reverse(add(n, x)) -> app(reverse(x), add(n, nil))
To remove rules and DPs from this DP problem we used the following monotonic and CE-compatible order: Polynomial ordering.
Polynomial interpretation:
  POL(reverse(x1))=  x1  
  POL(SHUFFLE(x1))=  1 + x1  
  POL(nil)=  0  
  POL(app(x1, x2))=  x1 + x2  
  POL(add(x1, x2))=  1 + x1 + x2  

We have the following set D of usable symbols: {reverse, SHUFFLE, nil, app, add}
The following Dependency Pairs can be deleted as the lhs is strictly greater than the corresponding rhs:

SHUFFLE(add(n, x)) -> SHUFFLE(reverse(x))

No Rules can be deleted.

After the removal, there are no SCCs in the dependency graph which results in no DP problems which have to be solved.


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