Term Rewriting System R:
[xs, ys, x, y, p]
app(app(app(if, true), xs), ys) -> xs
app(app(app(if, false), xs), ys) -> ys
app(app(sub, x), 0) -> x
app(app(sub, app(s, x)), app(s, y)) -> app(app(sub, x), y)
app(app(gtr, 0), y) -> false
app(app(gtr, app(s, x)), 0) -> true
app(app(gtr, app(s, x)), app(s, y)) -> app(app(gtr, x), y)
app(app(d, x), 0) -> true
app(app(d, app(s, x)), app(s, y)) -> app(app(app(if, app(app(gtr, x), y)), false), app(app(d, app(s, x)), app(app(sub, y), x)))
app(len, nil) -> 0
app(len, app(app(cons, x), xs)) -> app(s, app(len, xs))
app(app(filter, p), nil) -> nil
app(app(filter, p), app(app(cons, x), xs)) -> app(app(app(if, app(p, x)), app(app(cons, x), app(app(filter, p), xs))), app(app(filter, p), xs))

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

APP(app(sub, app(s, x)), app(s, y)) -> APP(app(sub, x), y)
APP(app(sub, app(s, x)), app(s, y)) -> APP(sub, x)
APP(app(gtr, app(s, x)), app(s, y)) -> APP(app(gtr, x), y)
APP(app(gtr, app(s, x)), app(s, y)) -> APP(gtr, x)
APP(app(d, app(s, x)), app(s, y)) -> APP(app(app(if, app(app(gtr, x), y)), false), app(app(d, app(s, x)), app(app(sub, y), x)))
APP(app(d, app(s, x)), app(s, y)) -> APP(app(if, app(app(gtr, x), y)), false)
APP(app(d, app(s, x)), app(s, y)) -> APP(if, app(app(gtr, x), y))
APP(app(d, app(s, x)), app(s, y)) -> APP(app(gtr, x), y)
APP(app(d, app(s, x)), app(s, y)) -> APP(gtr, x)
APP(app(d, app(s, x)), app(s, y)) -> APP(app(d, app(s, x)), app(app(sub, y), x))
APP(app(d, app(s, x)), app(s, y)) -> APP(app(sub, y), x)
APP(app(d, app(s, x)), app(s, y)) -> APP(sub, y)
APP(len, app(app(cons, x), xs)) -> APP(s, app(len, xs))
APP(len, app(app(cons, x), xs)) -> APP(len, xs)
APP(app(filter, p), app(app(cons, x), xs)) -> APP(app(app(if, app(p, x)), app(app(cons, x), app(app(filter, p), xs))), app(app(filter, p), xs))
APP(app(filter, p), app(app(cons, x), xs)) -> APP(app(if, app(p, x)), app(app(cons, x), app(app(filter, p), xs)))
APP(app(filter, p), app(app(cons, x), xs)) -> APP(if, app(p, x))
APP(app(filter, p), app(app(cons, x), xs)) -> APP(p, x)
APP(app(filter, p), app(app(cons, x), xs)) -> APP(app(cons, x), app(app(filter, p), xs))
APP(app(filter, p), app(app(cons, x), xs)) -> APP(app(filter, p), xs)

Furthermore, R contains two SCCs.


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


Dependency Pair:

APP(len, app(app(cons, x), xs)) -> APP(len, xs)


Rules:


app(app(app(if, true), xs), ys) -> xs
app(app(app(if, false), xs), ys) -> ys
app(app(sub, x), 0) -> x
app(app(sub, app(s, x)), app(s, y)) -> app(app(sub, x), y)
app(app(gtr, 0), y) -> false
app(app(gtr, app(s, x)), 0) -> true
app(app(gtr, app(s, x)), app(s, y)) -> app(app(gtr, x), y)
app(app(d, x), 0) -> true
app(app(d, app(s, x)), app(s, y)) -> app(app(app(if, app(app(gtr, x), y)), false), app(app(d, app(s, x)), app(app(sub, y), x)))
app(len, nil) -> 0
app(len, app(app(cons, x), xs)) -> app(s, app(len, xs))
app(app(filter, p), nil) -> nil
app(app(filter, p), app(app(cons, x), xs)) -> app(app(app(if, app(p, x)), app(app(cons, x), app(app(filter, p), xs))), app(app(filter, p), xs))





The following dependency pair can be strictly oriented:

APP(len, app(app(cons, x), xs)) -> APP(len, xs)


There are no usable rules using the Ce-refinement that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(len)=  0  
  POL(cons)=  1  
  POL(APP(x1, x2))=  x2  
  POL(app(x1, x2))=  x1 + x2  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
           →DP Problem 3
Dependency Graph
       →DP Problem 2
Remaining


Dependency Pair:


Rules:


app(app(app(if, true), xs), ys) -> xs
app(app(app(if, false), xs), ys) -> ys
app(app(sub, x), 0) -> x
app(app(sub, app(s, x)), app(s, y)) -> app(app(sub, x), y)
app(app(gtr, 0), y) -> false
app(app(gtr, app(s, x)), 0) -> true
app(app(gtr, app(s, x)), app(s, y)) -> app(app(gtr, x), y)
app(app(d, x), 0) -> true
app(app(d, app(s, x)), app(s, y)) -> app(app(app(if, app(app(gtr, x), y)), false), app(app(d, app(s, x)), app(app(sub, y), x)))
app(len, nil) -> 0
app(len, app(app(cons, x), xs)) -> app(s, app(len, xs))
app(app(filter, p), nil) -> nil
app(app(filter, p), app(app(cons, x), xs)) -> app(app(app(if, app(p, x)), app(app(cons, x), app(app(filter, p), xs))), app(app(filter, p), xs))





Using the Dependency Graph resulted in no new DP problems.


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




The following remains to be proven:
Dependency Pairs:

APP(app(filter, p), app(app(cons, x), xs)) -> APP(app(filter, p), xs)
APP(app(filter, p), app(app(cons, x), xs)) -> APP(app(cons, x), app(app(filter, p), xs))
APP(app(filter, p), app(app(cons, x), xs)) -> APP(p, x)
APP(app(filter, p), app(app(cons, x), xs)) -> APP(app(if, app(p, x)), app(app(cons, x), app(app(filter, p), xs)))
APP(app(filter, p), app(app(cons, x), xs)) -> APP(app(app(if, app(p, x)), app(app(cons, x), app(app(filter, p), xs))), app(app(filter, p), xs))
APP(app(d, app(s, x)), app(s, y)) -> APP(app(sub, y), x)
APP(app(d, app(s, x)), app(s, y)) -> APP(app(d, app(s, x)), app(app(sub, y), x))
APP(app(d, app(s, x)), app(s, y)) -> APP(app(gtr, x), y)
APP(app(d, app(s, x)), app(s, y)) -> APP(app(app(if, app(app(gtr, x), y)), false), app(app(d, app(s, x)), app(app(sub, y), x)))
APP(app(gtr, app(s, x)), app(s, y)) -> APP(app(gtr, x), y)
APP(app(sub, app(s, x)), app(s, y)) -> APP(app(sub, x), y)


Rules:


app(app(app(if, true), xs), ys) -> xs
app(app(app(if, false), xs), ys) -> ys
app(app(sub, x), 0) -> x
app(app(sub, app(s, x)), app(s, y)) -> app(app(sub, x), y)
app(app(gtr, 0), y) -> false
app(app(gtr, app(s, x)), 0) -> true
app(app(gtr, app(s, x)), app(s, y)) -> app(app(gtr, x), y)
app(app(d, x), 0) -> true
app(app(d, app(s, x)), app(s, y)) -> app(app(app(if, app(app(gtr, x), y)), false), app(app(d, app(s, x)), app(app(sub, y), x)))
app(len, nil) -> 0
app(len, app(app(cons, x), xs)) -> app(s, app(len, xs))
app(app(filter, p), nil) -> nil
app(app(filter, p), app(app(cons, x), xs)) -> app(app(app(if, app(p, x)), app(app(cons, x), app(app(filter, p), xs))), app(app(filter, p), xs))




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