Term Rewriting System R:
[x, y, n, m]
app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(eq, x)
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(le, x)
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(app, x), y))
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app, x)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(ifmin, app'(app'(le, n), m))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(le, n)
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(add, n), x)
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(ifrm, app'(app'(eq, n), m))
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(eq, n)
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(rm, n)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(add, m), app'(app'(rm, n), x))
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(rm, n)
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x))))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(eq, n)
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(minsort, app'(app'(app, app'(app'(rm, n), x)), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(app, app'(app'(rm, n), x)), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app, app'(app'(rm, n), x))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(rm, n)
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(minsort, x)
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(add, n), y)

Furthermore, R contains one SCC.


   R
DPs
       →DP Problem 1
Narrowing Transformation


Dependency Pairs:

APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(add, n), y)
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(app, app'(app'(rm, n), x)), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(add, m), app'(app'(rm, n), x))
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(add, n), x)
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(app, x), y))
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))





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

APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(app, x), y))
two new Dependency Pairs are created:

APP'(app'(app, app'(app'(add, n), nil)), y'') -> APP'(app'(add, n), y'')
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), x''))), y'') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(app, x''), y'')))

The transformation is resulting in one new DP problem:



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


Dependency Pairs:

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), x''))), y'') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(app, x''), y'')))
APP'(app'(app, app'(app'(add, n), nil)), y'') -> APP'(app'(add, n), y'')
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(app, app'(app'(rm, n), x)), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(add, m), app'(app'(rm, n), x))
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(add, n), x)
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(add, n), y)


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))





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

APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(add, n), x)
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'(app'(app, app'(app'(add, n), nil)), y'') -> APP'(app'(add, n), y'')
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(add, n), y)
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(app, app'(app'(rm, n), x)), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(add, m), app'(app'(rm, n), x))
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), x''))), y'') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(app, x''), y'')))


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))





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

APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(add, m), app'(app'(rm, n), x))
two new Dependency Pairs are created:

APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), nil)) -> APP'(app'(add, m), nil)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), app'(app'(add, m''), x''))) -> APP'(app'(add, m), app'(app'(app'(ifrm, app'(app'(eq, n''), m'')), n''), app'(app'(add, m''), x'')))

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'(app'(app'(ifrm, false), n''), app'(app'(add, m), app'(app'(add, m''), x''))) -> APP'(app'(add, m), app'(app'(app'(ifrm, app'(app'(eq, n''), m'')), n''), app'(app'(add, m''), x'')))
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), nil)) -> APP'(app'(add, m), nil)
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), x''))), y'') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(app, x''), y'')))
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(add, n), y)
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(app, app'(app'(rm, n), x)), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(app, app'(app'(add, n), nil)), y'') -> APP'(app'(add, n), y'')


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))





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

APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil)
two new Dependency Pairs are created:

APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y) -> APP'(app'(minsort, app'(app'(app, nil), y)), nil)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)), nil)

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'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)), nil)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y) -> APP'(app'(minsort, app'(app'(app, nil), y)), nil)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), nil)) -> APP'(app'(add, m), nil)
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), x''))), y'') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(app, x''), y'')))
APP'(app'(app, app'(app'(add, n), nil)), y'') -> APP'(app'(add, n), y'')
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(add, n), y)
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(app, app'(app'(rm, n), x)), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), app'(app'(add, m''), x''))) -> APP'(app'(add, m), app'(app'(app'(ifrm, app'(app'(eq, n''), m'')), n''), app'(app'(add, m''), x'')))


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))





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

APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(app, app'(app'(rm, n), x)), y)
two new Dependency Pairs are created:

APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y) -> APP'(app'(app, nil), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)

The transformation is resulting in one new DP problem:



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


Dependency Pairs:

APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), app'(app'(add, m''), x''))) -> APP'(app'(add, m), app'(app'(app'(ifrm, app'(app'(eq, n''), m'')), n''), app'(app'(add, m''), x'')))
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y) -> APP'(app'(app, nil), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y) -> APP'(app'(minsort, app'(app'(app, nil), y)), nil)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), nil)) -> APP'(app'(add, m), nil)
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), x''))), y'') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(app, x''), y'')))
APP'(app'(app, app'(app'(add, n), nil)), y'') -> APP'(app'(add, n), y'')
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(add, n), y)
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)), nil)


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))





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

APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(add, n), y)
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 7
Narrowing Transformation


Dependency Pairs:

APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), app'(app'(add, m''), x''))) -> APP'(app'(add, m), app'(app'(app'(ifrm, app'(app'(eq, n''), m'')), n''), app'(app'(add, m''), x'')))
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y) -> APP'(app'(app, nil), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)), nil)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y) -> APP'(app'(minsort, app'(app'(app, nil), y)), nil)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), nil)) -> APP'(app'(add, m), nil)
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), x''))), y'') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(app, x''), y'')))
APP'(app'(app, app'(app'(add, n), nil)), y'') -> APP'(app'(add, n), y'')
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))





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

APP'(app'(app, app'(app'(add, n), nil)), y'') -> APP'(app'(add, n), y'')
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 8
Narrowing Transformation


Dependency Pairs:

APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y) -> APP'(app'(app, nil), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)), nil)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y) -> APP'(app'(minsort, app'(app'(app, nil), y)), nil)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), nil)) -> APP'(app'(add, m), nil)
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), x''))), y'') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(app, x''), y'')))
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), app'(app'(add, m''), x''))) -> APP'(app'(add, m), app'(app'(app'(ifrm, app'(app'(eq, n''), m'')), n''), app'(app'(add, m''), x'')))


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))





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

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), x''))), y'') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(app, x''), y'')))
two new Dependency Pairs are created:

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), nil))), y''') -> APP'(app'(add, n), app'(app'(add, n''), y'''))
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), x')))), y''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(app, x'), y'''))))

The transformation is resulting in one new DP problem:



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


Dependency Pairs:

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), x')))), y''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(app, x'), y'''))))
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), nil))), y''') -> APP'(app'(add, n), app'(app'(add, n''), y'''))
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), app'(app'(add, m''), x''))) -> APP'(app'(add, m), app'(app'(app'(ifrm, app'(app'(eq, n''), m'')), n''), app'(app'(add, m''), x'')))
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y) -> APP'(app'(app, nil), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)), nil)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y) -> APP'(app'(minsort, app'(app'(app, nil), y)), nil)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), nil)) -> APP'(app'(add, m), nil)
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))





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

APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), nil)) -> APP'(app'(add, m), 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 10
Narrowing Transformation


Dependency Pairs:

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), nil))), y''') -> APP'(app'(add, n), app'(app'(add, n''), y'''))
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y) -> APP'(app'(app, nil), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)), nil)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y) -> APP'(app'(minsort, app'(app'(app, nil), y)), nil)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), app'(app'(add, m''), x''))) -> APP'(app'(add, m), app'(app'(app'(ifrm, app'(app'(eq, n''), m'')), n''), app'(app'(add, m''), x'')))
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), x')))), y''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(app, x'), y'''))))


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))





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

APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y) -> APP'(app'(minsort, app'(app'(app, nil), y)), nil)
one new Dependency Pair is created:

APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y'') -> APP'(app'(minsort, y''), nil)

The transformation is resulting in one new DP problem:



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


Dependency Pairs:

APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y'') -> APP'(app'(minsort, y''), nil)
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), x')))), y''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(app, x'), y'''))))
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y) -> APP'(app'(app, nil), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)), nil)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), app'(app'(add, m''), x''))) -> APP'(app'(add, m), app'(app'(app'(ifrm, app'(app'(eq, n''), m'')), n''), app'(app'(add, m''), x'')))
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), nil))), y''') -> APP'(app'(add, n), app'(app'(add, n''), y'''))


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))





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

APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y) -> APP'(app'(app, nil), y)
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 12
Narrowing Transformation


Dependency Pairs:

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), x')))), y''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(app, x'), y'''))))
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), nil))), y''') -> APP'(app'(add, n), app'(app'(add, n''), y'''))
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)), nil)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), app'(app'(add, m''), x''))) -> APP'(app'(add, m), app'(app'(app'(ifrm, app'(app'(eq, n''), m'')), n''), app'(app'(add, m''), x'')))
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y'') -> APP'(app'(minsort, y''), nil)


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))





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

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), nil))), y''') -> APP'(app'(add, n), app'(app'(add, n''), y'''))
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 13
Narrowing Transformation


Dependency Pairs:

APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y'') -> APP'(app'(minsort, y''), nil)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)), nil)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), app'(app'(add, m''), x''))) -> APP'(app'(add, m), app'(app'(app'(ifrm, app'(app'(eq, n''), m'')), n''), app'(app'(add, m''), x'')))
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), x')))), y''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(app, x'), y'''))))


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))





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

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), x')))), y''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(app, x'), y'''))))
two new Dependency Pairs are created:

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), nil)))), y'''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), y'''')))
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), x''))))), y'''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(app, x''), y'''')))))

The transformation is resulting in one new DP problem:



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


Dependency Pairs:

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), x''))))), y'''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(app, x''), y'''')))))
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), nil)))), y'''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), y'''')))
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)), nil)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), app'(app'(add, m''), x''))) -> APP'(app'(add, m), app'(app'(app'(ifrm, app'(app'(eq, n''), m'')), n''), app'(app'(add, m''), x'')))
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y'') -> APP'(app'(minsort, y''), nil)


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))





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

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), nil)))), y'''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), y'''')))
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 15
Narrowing Transformation


Dependency Pairs:

APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y'') -> APP'(app'(minsort, y''), nil)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)), nil)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), app'(app'(add, m''), x''))) -> APP'(app'(add, m), app'(app'(app'(ifrm, app'(app'(eq, n''), m'')), n''), app'(app'(add, m''), x'')))
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), x''))))), y'''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(app, x''), y'''')))))


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))





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

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), x''))))), y'''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(app, x''), y'''')))))
two new Dependency Pairs are created:

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), nil))))), y''''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), y'''''))))
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), x')))))), y''''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), app'(app'(app, x'), y'''''))))))

The transformation is resulting in one new DP problem:



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


Dependency Pairs:

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), x')))))), y''''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), app'(app'(app, x'), y'''''))))))
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), nil))))), y''''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), y'''''))))
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)), nil)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), app'(app'(add, m''), x''))) -> APP'(app'(add, m), app'(app'(app'(ifrm, app'(app'(eq, n''), m'')), n''), app'(app'(add, m''), x'')))
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y'') -> APP'(app'(minsort, y''), nil)


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))





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

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), nil))))), y''''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), y'''''))))
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 17
Narrowing Transformation


Dependency Pairs:

APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y'') -> APP'(app'(minsort, y''), nil)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)), nil)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), app'(app'(add, m''), x''))) -> APP'(app'(add, m), app'(app'(app'(ifrm, app'(app'(eq, n''), m'')), n''), app'(app'(add, m''), x'')))
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), x')))))), y''''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), app'(app'(app, x'), y'''''))))))


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))





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

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), x')))))), y''''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), app'(app'(app, x'), y'''''))))))
two new Dependency Pairs are created:

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), nil)))))), y'''''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), y'''''')))))
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), app'(app'(add, n'2), x''))))))), y'''''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), app'(app'(add, n'2), app'(app'(app, x''), y'''''')))))))

The transformation is resulting in one new DP problem:



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


Dependency Pairs:

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), app'(app'(add, n'2), x''))))))), y'''''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), app'(app'(add, n'2), app'(app'(app, x''), y'''''')))))))
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), nil)))))), y'''''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), y'''''')))))
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)), nil)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), app'(app'(add, m''), x''))) -> APP'(app'(add, m), app'(app'(app'(ifrm, app'(app'(eq, n''), m'')), n''), app'(app'(add, m''), x'')))
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y'') -> APP'(app'(minsort, y''), nil)


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))





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

APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), nil)))))), y'''''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), y'''''')))))
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 19
Remaining Obligation(s)




The following remains to be proven:
Dependency Pairs:

APP'(app'(app'(ifminsort, true), app'(app'(add, n''), nil)), y'') -> APP'(app'(minsort, y''), nil)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)
APP'(app'(app'(ifminsort, true), app'(app'(add, n''), app'(app'(add, m'), x''))), y) -> APP'(app'(minsort, app'(app'(app, app'(app'(app'(ifrm, app'(app'(eq, n''), m')), n''), app'(app'(add, m'), x''))), y)), nil)
APP'(app'(app'(ifrm, false), n''), app'(app'(add, m), app'(app'(add, m''), x''))) -> APP'(app'(add, m), app'(app'(app'(ifrm, app'(app'(eq, n''), m'')), n''), app'(app'(add, m''), x'')))
APP'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> APP'(app'(minsort, x), app'(app'(add, n), y))
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> APP'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(min, app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(eq, n), app'(min, app'(app'(add, n), x)))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x))
APP'(app'(minsort, app'(app'(add, n), x)), y) -> APP'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
APP'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> APP'(app'(rm, n), x)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(eq, n), m)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(ifrm, app'(app'(eq, n), m)), n)
APP'(app'(rm, n), app'(app'(add, m), x)) -> APP'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
APP'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, m), x))
APP'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> APP'(min, app'(app'(add, n), x))
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(le, n), m)
APP'(min, app'(app'(add, n), app'(app'(add, m), x))) -> APP'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
APP'(app'(app, app'(app'(add, n), x)), y) -> APP'(app'(app, x), y)
APP'(app'(le, app'(s, x)), app'(s, y)) -> APP'(app'(le, x), y)
APP'(app'(eq, app'(s, x)), app'(s, y)) -> APP'(app'(eq, x), y)
APP'(app'(app, app'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), app'(app'(add, n'2), x''))))))), y'''''') -> APP'(app'(add, n), app'(app'(add, n''), app'(app'(add, n'''), app'(app'(add, n'0), app'(app'(add, n'1), app'(app'(add, n'2), app'(app'(app, x''), y'''''')))))))


Rules:


app'(app'(eq, 0), 0) -> true
app'(app'(eq, 0), app'(s, x)) -> false
app'(app'(eq, app'(s, x)), 0) -> false
app'(app'(eq, app'(s, x)), app'(s, y)) -> app'(app'(eq, x), y)
app'(app'(le, 0), y) -> true
app'(app'(le, app'(s, x)), 0) -> false
app'(app'(le, app'(s, x)), app'(s, y)) -> app'(app'(le, x), y)
app'(app'(app, nil), y) -> y
app'(app'(app, app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(app, x), y))
app'(min, app'(app'(add, n), nil)) -> n
app'(min, app'(app'(add, n), app'(app'(add, m), x))) -> app'(app'(ifmin, app'(app'(le, n), m)), app'(app'(add, n), app'(app'(add, m), x)))
app'(app'(ifmin, true), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, n), x))
app'(app'(ifmin, false), app'(app'(add, n), app'(app'(add, m), x))) -> app'(min, app'(app'(add, m), x))
app'(app'(rm, n), nil) -> nil
app'(app'(rm, n), app'(app'(add, m), x)) -> app'(app'(app'(ifrm, app'(app'(eq, n), m)), n), app'(app'(add, m), x))
app'(app'(app'(ifrm, true), n), app'(app'(add, m), x)) -> app'(app'(rm, n), x)
app'(app'(app'(ifrm, false), n), app'(app'(add, m), x)) -> app'(app'(add, m), app'(app'(rm, n), x))
app'(app'(minsort, nil), nil) -> nil
app'(app'(minsort, app'(app'(add, n), x)), y) -> app'(app'(app'(ifminsort, app'(app'(eq, n), app'(min, app'(app'(add, n), x)))), app'(app'(add, n), x)), y)
app'(app'(app'(ifminsort, true), app'(app'(add, n), x)), y) -> app'(app'(add, n), app'(app'(minsort, app'(app'(app, app'(app'(rm, n), x)), y)), nil))
app'(app'(app'(ifminsort, false), app'(app'(add, n), x)), y) -> app'(app'(minsort, x), app'(app'(add, n), y))




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