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

Innermost 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
Usable Rules (Innermost)


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(takeWhile, p), app(app(cons, x), xs)) -> APP(app(takeWhile, p), xs)
APP(app(takeWhile, p), app(app(cons, x), xs)) -> APP(p, x)


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


Strategy:

innermost




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


   R
DPs
       →DP Problem 1
UsableRules
           →DP Problem 2
Size-Change Principle


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(takeWhile, p), app(app(cons, x), xs)) -> APP(app(takeWhile, p), xs)
APP(app(takeWhile, p), app(app(cons, x), xs)) -> APP(p, x)


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. APP(app(dropWhile, p), app(app(cons, x), xs)) -> APP(app(dropWhile, p), xs)
  2. APP(app(dropWhile, p), app(app(cons, x), xs)) -> APP(p, x)
  3. APP(app(takeWhile, p), app(app(cons, x), xs)) -> APP(app(takeWhile, p), xs)
  4. APP(app(takeWhile, p), app(app(cons, x), xs)) -> APP(p, x)
and get the following Size-Change Graph(s):
{1} , {1}
1=1
2>2
{2} , {2}
1>1
2>2
{3} , {3}
1=1
2>2
{4} , {4}
1>1
2>2

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

DP: empty set
Oriented Rules: none

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

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

We obtain no new DP problems.

Innermost Termination of R successfully shown.
Duration:
0:01 minutes