Term Rewriting System R:
[x, y, p, xs]
app(app(app(if, true), x), y) -> x
app(app(app(if, true), x), y) -> y
app(app(takeWhile, p), nil) -> nil
app(app(takeWhile, p), app(app(cons, x), xs)) -> app(app(app(if, app(p, x)), app(app(cons, x), app(app(takeWhile, p), xs))), nil)
app(app(dropWhile, p), nil) -> nil
app(app(dropWhile, p), app(app(cons, x), xs)) -> app(app(app(if, app(p, x)), app(app(dropWhile, p), xs)), app(app(cons, x), xs))

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

APP(app(takeWhile, p), app(app(cons, x), xs)) -> APP(app(app(if, app(p, x)), app(app(cons, x), app(app(takeWhile, p), xs))), nil)
APP(app(takeWhile, p), app(app(cons, x), xs)) -> APP(app(if, app(p, x)), app(app(cons, x), app(app(takeWhile, p), xs)))
APP(app(takeWhile, p), app(app(cons, x), xs)) -> APP(if, app(p, x))
APP(app(takeWhile, p), app(app(cons, x), xs)) -> APP(p, x)
APP(app(takeWhile, p), app(app(cons, x), xs)) -> APP(app(cons, x), app(app(takeWhile, p), xs))
APP(app(takeWhile, p), app(app(cons, x), xs)) -> APP(app(takeWhile, p), xs)
APP(app(dropWhile, p), app(app(cons, x), xs)) -> APP(app(app(if, app(p, x)), app(app(dropWhile, p), xs)), app(app(cons, x), xs))
APP(app(dropWhile, p), app(app(cons, x), xs)) -> APP(app(if, app(p, x)), app(app(dropWhile, p), xs))
APP(app(dropWhile, p), app(app(cons, x), xs)) -> APP(if, app(p, x))
APP(app(dropWhile, p), app(app(cons, x), xs)) -> APP(p, x)
APP(app(dropWhile, p), app(app(cons, x), xs)) -> APP(app(dropWhile, p), xs)

Furthermore, R contains one SCC.


   R
DPs
       →DP Problem 1
Narrowing Transformation


Dependency Pairs:

APP(app(dropWhile, p), app(app(cons, x), xs)) -> APP(app(dropWhile, p), xs)
APP(app(dropWhile, p), app(app(cons, x), xs)) -> APP(p, x)
APP(app(dropWhile, p), app(app(cons, x), xs)) -> APP(app(if, app(p, x)), app(app(dropWhile, p), xs))
APP(app(dropWhile, p), app(app(cons, x), xs)) -> APP(app(app(if, app(p, x)), app(app(dropWhile, p), xs)), app(app(cons, x), xs))
APP(app(takeWhile, p), app(app(cons, x), xs)) -> APP(app(takeWhile, p), xs)
APP(app(takeWhile, p), app(app(cons, x), xs)) -> APP(app(cons, x), app(app(takeWhile, p), xs))
APP(app(takeWhile, p), app(app(cons, x), xs)) -> APP(p, x)
APP(app(takeWhile, p), app(app(cons, x), xs)) -> APP(app(if, app(p, x)), app(app(cons, x), app(app(takeWhile, p), xs)))


Rules:


app(app(app(if, true), x), y) -> x
app(app(app(if, true), x), y) -> y
app(app(takeWhile, p), nil) -> nil
app(app(takeWhile, p), app(app(cons, x), xs)) -> app(app(app(if, app(p, x)), app(app(cons, x), app(app(takeWhile, p), xs))), nil)
app(app(dropWhile, p), nil) -> nil
app(app(dropWhile, p), app(app(cons, x), xs)) -> app(app(app(if, app(p, x)), app(app(dropWhile, p), xs)), app(app(cons, x), xs))





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

APP(app(takeWhile, p), app(app(cons, x), xs)) -> APP(app(cons, x), app(app(takeWhile, p), xs))
two new Dependency Pairs are created:

APP(app(takeWhile, p''), app(app(cons, x), nil)) -> APP(app(cons, x), nil)
APP(app(takeWhile, p''), app(app(cons, x), app(app(cons, x''), xs''))) -> APP(app(cons, x), app(app(app(if, app(p'', x'')), app(app(cons, x''), app(app(takeWhile, p''), xs''))), nil))

The transformation is resulting in one new DP problem:



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




The following remains to be proven:
Dependency Pairs:

APP(app(takeWhile, p''), app(app(cons, x), app(app(cons, x''), xs''))) -> APP(app(cons, x), app(app(app(if, app(p'', x'')), app(app(cons, x''), app(app(takeWhile, p''), xs''))), nil))
APP(app(dropWhile, p), app(app(cons, x), xs)) -> APP(p, x)
APP(app(dropWhile, p), app(app(cons, x), xs)) -> APP(app(if, app(p, x)), app(app(dropWhile, p), xs))
APP(app(dropWhile, p), app(app(cons, x), xs)) -> APP(app(app(if, app(p, x)), app(app(dropWhile, p), xs)), app(app(cons, x), xs))
APP(app(takeWhile, p), app(app(cons, x), xs)) -> APP(app(takeWhile, p), xs)
APP(app(takeWhile, p), app(app(cons, x), xs)) -> APP(p, x)
APP(app(takeWhile, p), app(app(cons, x), xs)) -> APP(app(if, app(p, x)), app(app(cons, x), app(app(takeWhile, p), xs)))
APP(app(dropWhile, p), app(app(cons, x), xs)) -> APP(app(dropWhile, p), xs)


Rules:


app(app(app(if, true), x), y) -> x
app(app(app(if, true), x), y) -> y
app(app(takeWhile, p), nil) -> nil
app(app(takeWhile, p), app(app(cons, x), xs)) -> app(app(app(if, app(p, x)), app(app(cons, x), app(app(takeWhile, p), xs))), nil)
app(app(dropWhile, p), nil) -> nil
app(app(dropWhile, p), app(app(cons, x), xs)) -> app(app(app(if, app(p, x)), app(app(dropWhile, p), xs)), app(app(cons, x), xs))




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