Term Rewriting System R:
[f, g, x, y, z]
app(app(app(sort, f), g), nil) -> nil
app(app(app(sort, f), g), app(app(cons, x), y)) -> app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) -> app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) -> y
app(app(max, x), 0) -> x
app(app(max, app(s, x)), app(s, y)) -> app(app(max, x), y)
app(app(min, 0), y) -> 0
app(app(min, x), 0) -> 0
app(app(min, app(s, x)), app(s, y)) -> app(app(min, x), y)
app(asort, z) -> app(app(app(sort, min), max), z)
app(dsort, z) -> app(app(app(sort, max), min), z)

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(insert, f), g), app(app(app(sort, f), g), y))
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(insert, f), g)
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(insert, f)
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(sort, f), g), y)
APP(app(app(app(insert, f), g), nil), y) -> APP(app(cons, y), nil)
APP(app(app(app(insert, f), g), nil), y) -> APP(cons, y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(cons, app(app(f, x), y))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(f, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(f, x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(app(app(insert, f), g), z), app(app(g, x), y))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(app(insert, f), g), z)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(g, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(g, x)
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(asort, z) -> APP(app(app(sort, min), max), z)
APP(asort, z) -> APP(app(sort, min), max)
APP(asort, z) -> APP(sort, min)
APP(dsort, z) -> APP(app(app(sort, max), min), z)
APP(dsort, z) -> APP(app(sort, max), min)
APP(dsort, z) -> APP(sort, max)

Furthermore, R contains one SCC.


   R
DPs
       →DP Problem 1
Narrowing Transformation


Dependency Pairs:

APP(dsort, z) -> APP(app(sort, max), min)
APP(dsort, z) -> APP(app(app(sort, max), min), z)
APP(asort, z) -> APP(app(sort, min), max)
APP(asort, z) -> APP(app(app(sort, min), max), z)
APP(app(min, app(s, x)), app(s, y)) -> APP(app(min, x), y)
APP(app(max, app(s, x)), app(s, y)) -> APP(app(max, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(g, x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(g, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(app(insert, f), g), z)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(app(app(insert, f), g), z), app(app(g, x), y))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(f, x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(f, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
APP(app(app(app(insert, f), g), nil), y) -> APP(app(cons, y), nil)
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(sort, f), g), y)
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(insert, f), g)
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(insert, f), g), app(app(app(sort, f), g), y))
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)


Rules:


app(app(app(sort, f), g), nil) -> nil
app(app(app(sort, f), g), app(app(cons, x), y)) -> app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) -> app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) -> y
app(app(max, x), 0) -> x
app(app(max, app(s, x)), app(s, y)) -> app(app(max, x), y)
app(app(min, 0), y) -> 0
app(app(min, x), 0) -> 0
app(app(min, app(s, x)), app(s, y)) -> app(app(min, x), y)
app(asort, z) -> app(app(app(sort, min), max), z)
app(dsort, z) -> app(app(app(sort, max), min), z)





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, x), y)) -> APP(app(insert, f), g)
no new Dependency Pairs are created.
The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Narrowing Transformation


Dependency Pairs:

APP(dsort, z) -> APP(app(app(sort, max), min), z)
APP(asort, z) -> APP(app(sort, min), max)
APP(asort, z) -> APP(app(app(sort, min), max), z)
APP(app(min, app(s, x)), app(s, y)) -> APP(app(min, x), y)
APP(app(max, app(s, x)), app(s, y)) -> APP(app(max, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(g, x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(g, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(app(insert, f), g), z)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(app(app(insert, f), g), z), app(app(g, x), y))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(f, x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(f, x), y)
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(sort, f), g), y)
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(insert, f), g), app(app(app(sort, f), g), y))
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
APP(app(app(app(insert, f), g), nil), y) -> APP(app(cons, y), nil)
APP(dsort, z) -> APP(app(sort, max), min)


Rules:


app(app(app(sort, f), g), nil) -> nil
app(app(app(sort, f), g), app(app(cons, x), y)) -> app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) -> app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) -> y
app(app(max, x), 0) -> x
app(app(max, app(s, x)), app(s, y)) -> app(app(max, x), y)
app(app(min, 0), y) -> 0
app(app(min, x), 0) -> 0
app(app(min, app(s, x)), app(s, y)) -> app(app(min, x), y)
app(asort, z) -> app(app(app(sort, min), max), z)
app(dsort, z) -> app(app(app(sort, max), min), z)





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

APP(app(app(app(insert, f), g), nil), y) -> APP(app(cons, y), nil)
no new Dependency Pairs are created.
The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 3
Narrowing Transformation


Dependency Pairs:

APP(dsort, z) -> APP(app(sort, max), min)
APP(asort, z) -> APP(app(sort, min), max)
APP(asort, z) -> APP(app(app(sort, min), max), z)
APP(app(min, app(s, x)), app(s, y)) -> APP(app(min, x), y)
APP(app(max, app(s, x)), app(s, y)) -> APP(app(max, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(g, x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(g, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(app(insert, f), g), z)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(app(app(insert, f), g), z), app(app(g, x), y))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(f, x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(f, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(sort, f), g), y)
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(insert, f), g), app(app(app(sort, f), g), y))
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
APP(dsort, z) -> APP(app(app(sort, max), min), z)


Rules:


app(app(app(sort, f), g), nil) -> nil
app(app(app(sort, f), g), app(app(cons, x), y)) -> app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) -> app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) -> y
app(app(max, x), 0) -> x
app(app(max, app(s, x)), app(s, y)) -> app(app(max, x), y)
app(app(min, 0), y) -> 0
app(app(min, x), 0) -> 0
app(app(min, app(s, x)), app(s, y)) -> app(app(min, x), y)
app(asort, z) -> app(app(app(sort, min), max), z)
app(dsort, z) -> app(app(app(sort, max), min), z)





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

APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(app(insert, f), g), z)
no new Dependency Pairs are created.
The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 4
Narrowing Transformation


Dependency Pairs:

APP(dsort, z) -> APP(app(app(sort, max), min), z)
APP(asort, z) -> APP(app(sort, min), max)
APP(asort, z) -> APP(app(app(sort, min), max), z)
APP(app(min, app(s, x)), app(s, y)) -> APP(app(min, x), y)
APP(app(max, app(s, x)), app(s, y)) -> APP(app(max, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(g, x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(g, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(app(app(insert, f), g), z), app(app(g, x), y))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(f, x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(f, x), y)
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(sort, f), g), y)
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(insert, f), g), app(app(app(sort, f), g), y))
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
APP(dsort, z) -> APP(app(sort, max), min)


Rules:


app(app(app(sort, f), g), nil) -> nil
app(app(app(sort, f), g), app(app(cons, x), y)) -> app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) -> app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) -> y
app(app(max, x), 0) -> x
app(app(max, app(s, x)), app(s, y)) -> app(app(max, x), y)
app(app(min, 0), y) -> 0
app(app(min, x), 0) -> 0
app(app(min, app(s, x)), app(s, y)) -> app(app(min, x), y)
app(asort, z) -> app(app(app(sort, min), max), z)
app(dsort, z) -> app(app(app(sort, max), min), z)





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

APP(asort, z) -> APP(app(sort, min), max)
no new Dependency Pairs are created.
The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 5
Narrowing Transformation


Dependency Pairs:

APP(dsort, z) -> APP(app(sort, max), min)
APP(asort, z) -> APP(app(app(sort, min), max), z)
APP(app(min, app(s, x)), app(s, y)) -> APP(app(min, x), y)
APP(app(max, app(s, x)), app(s, y)) -> APP(app(max, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(g, x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(g, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(app(app(insert, f), g), z), app(app(g, x), y))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(f, x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(f, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(sort, f), g), y)
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(insert, f), g), app(app(app(sort, f), g), y))
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
APP(dsort, z) -> APP(app(app(sort, max), min), z)


Rules:


app(app(app(sort, f), g), nil) -> nil
app(app(app(sort, f), g), app(app(cons, x), y)) -> app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) -> app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) -> y
app(app(max, x), 0) -> x
app(app(max, app(s, x)), app(s, y)) -> app(app(max, x), y)
app(app(min, 0), y) -> 0
app(app(min, x), 0) -> 0
app(app(min, app(s, x)), app(s, y)) -> app(app(min, x), y)
app(asort, z) -> app(app(app(sort, min), max), z)
app(dsort, z) -> app(app(app(sort, max), min), z)





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

APP(dsort, z) -> APP(app(sort, max), min)
no new Dependency Pairs are created.
The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 6
Remaining Obligation(s)




The following remains to be proven:
Dependency Pairs:

APP(dsort, z) -> APP(app(app(sort, max), min), z)
APP(app(min, app(s, x)), app(s, y)) -> APP(app(min, x), y)
APP(app(max, app(s, x)), app(s, y)) -> APP(app(max, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(g, x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(g, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(app(app(insert, f), g), z), app(app(g, x), y))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(f, x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(f, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> APP(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(sort, f), g), y)
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(insert, f), g), app(app(app(sort, f), g), y))
APP(app(app(sort, f), g), app(app(cons, x), y)) -> APP(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
APP(asort, z) -> APP(app(app(sort, min), max), z)


Rules:


app(app(app(sort, f), g), nil) -> nil
app(app(app(sort, f), g), app(app(cons, x), y)) -> app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) -> app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) -> app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) -> y
app(app(max, x), 0) -> x
app(app(max, app(s, x)), app(s, y)) -> app(app(max, x), y)
app(app(min, 0), y) -> 0
app(app(min, x), 0) -> 0
app(app(min, app(s, x)), app(s, y)) -> app(app(min, x), y)
app(asort, z) -> app(app(app(sort, min), max), z)
app(dsort, z) -> app(app(app(sort, max), min), z)




Termination of R could not be shown.
Duration:
0:01 minutes