Term Rewriting System R:
[x, y, f, g, h, t, l]
app(app(max, 0), x) -> x
app(app(max, x), 0) -> x
app(app(max, app(s, x)), app(s, y)) -> app(app(max, x), y)
app(app(min, 0), x) -> 0
app(app(min, x), 0) -> 0
app(app(min, app(s, x)), app(s, y)) -> app(app(min, x), y)
app(app(app(app(insert, f), g), nil), x) -> app(app(cons, x), nil)
app(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> app(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
app(app(app(sort, f), g), nil) -> nil
app(app(app(sort, f), g), app(app(cons, h), t)) -> app(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
app(ascendingsort, l) -> app(app(app(sort, min), max), l)
app(descendingsort, l) -> app(app(app(sort, max), min), 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(app(max, app(s, x)), app(s, y)) -> APP(app(max, x), y)
APP(app(max, app(s, x)), app(s, y)) -> APP(max, x)
APP(app(min, app(s, x)), app(s, y)) -> APP(app(min, x), y)
APP(app(min, app(s, x)), app(s, y)) -> APP(min, x)
APP(app(app(app(insert, f), g), nil), x) -> APP(app(cons, x), nil)
APP(app(app(app(insert, f), g), nil), x) -> APP(cons, x)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> APP(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> APP(cons, app(app(f, x), h))
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> APP(app(f, x), h)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> APP(f, x)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> APP(app(app(app(insert, f), g), t), app(app(g, x), h))
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> APP(app(app(insert, f), g), t)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> APP(app(g, x), h)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> APP(g, x)
APP(app(app(sort, f), g), app(app(cons, h), t)) -> APP(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
APP(app(app(sort, f), g), app(app(cons, h), t)) -> APP(app(app(insert, f), g), app(app(app(sort, f), g), t))
APP(app(app(sort, f), g), app(app(cons, h), t)) -> APP(app(insert, f), g)
APP(app(app(sort, f), g), app(app(cons, h), t)) -> APP(insert, f)
APP(app(app(sort, f), g), app(app(cons, h), t)) -> APP(app(app(sort, f), g), t)
APP(ascendingsort, l) -> APP(app(app(sort, min), max), l)
APP(ascendingsort, l) -> APP(app(sort, min), max)
APP(ascendingsort, l) -> APP(sort, min)
APP(descendingsort, l) -> APP(app(app(sort, max), min), l)
APP(descendingsort, l) -> APP(app(sort, max), min)
APP(descendingsort, l) -> APP(sort, max)

Furthermore, R contains three SCCs.


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


Dependency Pair:

APP(app(max, app(s, x)), app(s, y)) -> APP(app(max, x), y)


Rules:


app(app(max, 0), x) -> x
app(app(max, x), 0) -> x
app(app(max, app(s, x)), app(s, y)) -> app(app(max, x), y)
app(app(min, 0), x) -> 0
app(app(min, x), 0) -> 0
app(app(min, app(s, x)), app(s, y)) -> app(app(min, x), y)
app(app(app(app(insert, f), g), nil), x) -> app(app(cons, x), nil)
app(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> app(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
app(app(app(sort, f), g), nil) -> nil
app(app(app(sort, f), g), app(app(cons, h), t)) -> app(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
app(ascendingsort, l) -> app(app(app(sort, min), max), l)
app(descendingsort, l) -> app(app(app(sort, max), min), l)


Strategy:

innermost




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


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


Dependency Pair:

APP(app(max, app(s, x)), app(s, y)) -> APP(app(max, x), y)


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 5
Size-Change Principle
           →DP Problem 2
UsableRules
           →DP Problem 3
Nar


Dependency Pair:

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


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. MAX(s(x), s(y)) -> MAX(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
Nar


Dependency Pair:

APP(app(min, app(s, x)), app(s, y)) -> APP(app(min, x), y)


Rules:


app(app(max, 0), x) -> x
app(app(max, x), 0) -> x
app(app(max, app(s, x)), app(s, y)) -> app(app(max, x), y)
app(app(min, 0), x) -> 0
app(app(min, x), 0) -> 0
app(app(min, app(s, x)), app(s, y)) -> app(app(min, x), y)
app(app(app(app(insert, f), g), nil), x) -> app(app(cons, x), nil)
app(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> app(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
app(app(app(sort, f), g), nil) -> nil
app(app(app(sort, f), g), app(app(cons, h), t)) -> app(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
app(ascendingsort, l) -> app(app(app(sort, min), max), l)
app(descendingsort, l) -> app(app(app(sort, max), min), l)


Strategy:

innermost




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


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


Dependency Pair:

APP(app(min, app(s, x)), app(s, y)) -> APP(app(min, x), y)


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 2
UsableRules
             ...
               →DP Problem 7
Size-Change Principle
           →DP Problem 3
Nar


Dependency Pair:

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


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. MIN(s(x), s(y)) -> MIN(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
UsableRules
           →DP Problem 3
Narrowing Transformation


Dependency Pairs:

APP(descendingsort, l) -> APP(app(app(sort, max), min), l)
APP(ascendingsort, l) -> APP(app(app(sort, min), max), l)
APP(app(app(sort, f), g), app(app(cons, h), t)) -> APP(app(app(sort, f), g), t)
APP(app(app(sort, f), g), app(app(cons, h), t)) -> APP(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> APP(g, x)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> APP(app(g, x), h)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> APP(app(app(app(insert, f), g), t), app(app(g, x), h))
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> APP(f, x)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> APP(app(f, x), h)


Rules:


app(app(max, 0), x) -> x
app(app(max, x), 0) -> x
app(app(max, app(s, x)), app(s, y)) -> app(app(max, x), y)
app(app(min, 0), x) -> 0
app(app(min, x), 0) -> 0
app(app(min, app(s, x)), app(s, y)) -> app(app(min, x), y)
app(app(app(app(insert, f), g), nil), x) -> app(app(cons, x), nil)
app(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> app(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
app(app(app(sort, f), g), nil) -> nil
app(app(app(sort, f), g), app(app(cons, h), t)) -> app(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
app(ascendingsort, l) -> app(app(app(sort, min), max), l)
app(descendingsort, l) -> app(app(app(sort, max), min), l)


Strategy:

innermost




On this DP problem, a Narrowing SCC transformation can be performed.
As a result of transforming the rule

APP(app(app(sort, f), g), app(app(cons, h), t)) -> APP(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
two new Dependency Pairs are created:

APP(app(app(sort, f''), g''), app(app(cons, h), nil)) -> APP(app(app(app(insert, f''), g''), nil), h)
APP(app(app(sort, f''), g''), app(app(cons, h), app(app(cons, h''), t''))) -> APP(app(app(app(insert, f''), g''), app(app(app(app(insert, f''), g''), app(app(app(sort, f''), g''), t'')), h'')), h)

The transformation is resulting in one new DP problem:



   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
Nar
             ...
               →DP Problem 8
Remaining Obligation(s)




The following remains to be proven:
Dependency Pairs:

APP(ascendingsort, l) -> APP(app(app(sort, min), max), l)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> APP(g, x)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> APP(app(g, x), h)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> APP(app(app(app(insert, f), g), t), app(app(g, x), h))
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> APP(f, x)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> APP(app(f, x), h)
APP(app(app(sort, f''), g''), app(app(cons, h), app(app(cons, h''), t''))) -> APP(app(app(app(insert, f''), g''), app(app(app(app(insert, f''), g''), app(app(app(sort, f''), g''), t'')), h'')), h)
APP(app(app(sort, f), g), app(app(cons, h), t)) -> APP(app(app(sort, f), g), t)
APP(descendingsort, l) -> APP(app(app(sort, max), min), l)


Rules:


app(app(max, 0), x) -> x
app(app(max, x), 0) -> x
app(app(max, app(s, x)), app(s, y)) -> app(app(max, x), y)
app(app(min, 0), x) -> 0
app(app(min, x), 0) -> 0
app(app(min, app(s, x)), app(s, y)) -> app(app(min, x), y)
app(app(app(app(insert, f), g), nil), x) -> app(app(cons, x), nil)
app(app(app(app(insert, f), g), app(app(cons, h), t)), x) -> app(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
app(app(app(sort, f), g), nil) -> nil
app(app(app(sort, f), g), app(app(cons, h), t)) -> app(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
app(ascendingsort, l) -> app(app(app(sort, min), max), l)
app(descendingsort, l) -> app(app(app(sort, max), min), l)


Strategy:

innermost



The Proof could not be continued due to a Timeout.
Termination of R could not be shown.
Duration:
1:00 minutes