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
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
DPs
       →DP Problem 1
Polynomial Ordering


Dependency Pairs:

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(app(app(f, x), u), z)
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(minus, y), x)
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(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(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(le, x), y)
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(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)), 0), z), 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(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(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
APP(perfectp, app(s, x)) -> APP(app(f, x), app(s, 0))
APP(perfectp, app(s, x)) -> APP(app(app(f, x), app(s, 0)), app(s, x))
APP(perfectp, app(s, x)) -> APP(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))


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))





The following dependency pairs can be strictly oriented:

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(app(le, x), y)
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(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)), 0), z), u) -> APP(app(minus, z), app(s, x))


Additionally, the following rules can be oriented:

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))


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(if)=  0  
  POL(0)=  0  
  POL(false)=  0  
  POL(perfectp)=  1  
  POL(minus)=  0  
  POL(true)=  0  
  POL(s)=  1  
  POL(le)=  0  
  POL(app(x1, x2))=  x1  
  POL(f)=  1  
  POL(APP(x1, x2))=  1 + x1  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
           →DP Problem 2
Polynomial Ordering


Dependency Pairs:

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(app(app(f, x), u), z)
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(f, app(s, x)), app(app(minus, y), x))
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(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)
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(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(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
APP(perfectp, app(s, x)) -> APP(app(f, x), app(s, 0))
APP(perfectp, app(s, x)) -> APP(app(app(f, x), app(s, 0)), app(s, x))
APP(perfectp, app(s, x)) -> APP(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))


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))





The following dependency pairs can be strictly oriented:

APP(perfectp, app(s, x)) -> APP(app(f, x), app(s, 0))
APP(perfectp, app(s, x)) -> APP(app(app(f, x), app(s, 0)), app(s, x))
APP(perfectp, app(s, x)) -> APP(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))


Additionally, the following rules can be oriented:

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))


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(if)=  0  
  POL(0)=  0  
  POL(false)=  0  
  POL(perfectp)=  1  
  POL(minus)=  0  
  POL(true)=  0  
  POL(s)=  0  
  POL(le)=  0  
  POL(app(x1, x2))=  0  
  POL(f)=  0  
  POL(APP(x1, x2))=  x1  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
           →DP Problem 2
Polo
             ...
               →DP Problem 3
Remaining Obligation(s)




The following remains to be proven:
Dependency Pairs:

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(app(app(f, x), u), z)
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(f, app(s, x)), app(app(minus, y), x))
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(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)
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(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(app(app(f, x), u), app(app(minus, z), app(s, x))), 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))




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