Term Rewriting System R:
[x, y, u, z]
app(perfectp, 0) -> false
app(perfectp, app(s, x)) -> app(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))
app(app(app(app(f, 0), y), 0), u) -> true
app(app(app(app(f, 0), y), app(s, z)), u) -> false
app(app(app(app(f, app(s, x)), 0), z), u) -> app(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
app(app(app(app(f, app(s, x)), app(s, y)), z), u) -> app(app(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)), app(app(app(app(f, x), u), z), u))

Termination of R to be shown.



   R
Overlay and local confluence Check



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


   R
OC
       →TRS2
Dependency Pair Analysis



R contains the following Dependency Pairs:

APP(perfectp, app(s, x)) -> APP(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))
APP(perfectp, app(s, x)) -> APP(app(app(f, x), app(s, 0)), app(s, x))
APP(perfectp, app(s, x)) -> APP(app(f, x), app(s, 0))
APP(perfectp, app(s, x)) -> APP(f, x)
APP(perfectp, app(s, x)) -> APP(s, 0)
APP(app(app(app(f, app(s, x)), 0), z), u) -> APP(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
APP(app(app(app(f, app(s, x)), 0), z), u) -> APP(app(app(f, x), u), app(app(minus, z), app(s, x)))
APP(app(app(app(f, app(s, x)), 0), z), u) -> APP(app(f, x), u)
APP(app(app(app(f, app(s, x)), 0), z), u) -> APP(f, x)
APP(app(app(app(f, app(s, x)), 0), z), u) -> APP(app(minus, z), app(s, x))
APP(app(app(app(f, app(s, x)), 0), z), u) -> APP(minus, z)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) -> APP(app(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)), app(app(app(app(f, x), u), z), u))
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) -> APP(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u))
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) -> APP(if, app(app(le, x), y))
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) -> APP(app(le, x), y)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) -> APP(le, x)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) -> APP(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) -> APP(app(app(f, app(s, x)), app(app(minus, y), x)), z)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) -> APP(app(f, app(s, x)), app(app(minus, y), x))
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) -> APP(app(minus, y), x)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) -> APP(minus, y)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) -> APP(app(app(app(f, x), u), z), u)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) -> APP(app(app(f, x), u), z)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) -> APP(app(f, x), u)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) -> APP(f, x)

Furthermore, R contains one SCC.


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


Dependency Pairs:

APP(app(app(app(f, app(s, x)), 0), z), u) -> APP(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) -> APP(app(app(app(f, x), u), z), u)


Rules:


app(perfectp, 0) -> false
app(perfectp, app(s, x)) -> app(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))
app(app(app(app(f, 0), y), 0), u) -> true
app(app(app(app(f, 0), y), app(s, z)), u) -> false
app(app(app(app(f, app(s, x)), 0), z), u) -> app(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
app(app(app(app(f, app(s, x)), app(s, y)), z), u) -> app(app(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)), app(app(app(app(f, x), u), z), u))


Strategy:

innermost




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


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


Dependency Pairs:

APP(app(app(app(f, app(s, x)), 0), z), u) -> APP(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) -> APP(app(app(app(f, x), u), z), u)


Rule:

none


Strategy:

innermost




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


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


Dependency Pairs:

F(s(x), 0, z, u) -> F(x, u, minus(z, s(x)), u)
F(s(x), s(y), z, u) -> F(x, u, z, u)


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. F(s(x), 0, z, u) -> F(x, u, minus(z, s(x)), u)
  2. F(s(x), s(y), z, u) -> F(x, u, z, u)
and get the following Size-Change Graph(s):
{1, 2} , {1, 2}
1>1
4=2
4=4
{1, 2} , {1, 2}
1>1
3=3
4=2
4=4

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

DP: empty set
Oriented Rules: none

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

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

We obtain no new DP problems.

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