YES We show the termination of the TRS R: 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)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: 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()) p2: app#(app(takeWhile(),p),app(app(cons(),x),xs)) -> app#(app(if(),app(p,x)),app(app(cons(),x),app(app(takeWhile(),p),xs))) p3: app#(app(takeWhile(),p),app(app(cons(),x),xs)) -> app#(if(),app(p,x)) p4: app#(app(takeWhile(),p),app(app(cons(),x),xs)) -> app#(p,x) p5: app#(app(takeWhile(),p),app(app(cons(),x),xs)) -> app#(app(cons(),x),app(app(takeWhile(),p),xs)) p6: app#(app(takeWhile(),p),app(app(cons(),x),xs)) -> app#(app(takeWhile(),p),xs) p7: 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)) p8: app#(app(dropWhile(),p),app(app(cons(),x),xs)) -> app#(app(if(),app(p,x)),app(app(dropWhile(),p),xs)) p9: app#(app(dropWhile(),p),app(app(cons(),x),xs)) -> app#(if(),app(p,x)) p10: app#(app(dropWhile(),p),app(app(cons(),x),xs)) -> app#(p,x) p11: app#(app(dropWhile(),p),app(app(cons(),x),xs)) -> app#(app(dropWhile(),p),xs) and R consists of: r1: app(app(app(if(),true()),x),y) -> x r2: app(app(app(if(),true()),x),y) -> y r3: app(app(takeWhile(),p),nil()) -> nil() r4: 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()) r5: app(app(dropWhile(),p),nil()) -> nil() r6: 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)) The estimated dependency graph contains the following SCCs: {p4, p6, p10, p11} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(takeWhile(),p),app(app(cons(),x),xs)) -> app#(p,x) p2: app#(app(dropWhile(),p),app(app(cons(),x),xs)) -> app#(app(dropWhile(),p),xs) p3: app#(app(dropWhile(),p),app(app(cons(),x),xs)) -> app#(p,x) p4: app#(app(takeWhile(),p),app(app(cons(),x),xs)) -> app#(app(takeWhile(),p),xs) and R consists of: r1: app(app(app(if(),true()),x),y) -> x r2: app(app(app(if(),true()),x),y) -> y r3: app(app(takeWhile(),p),nil()) -> nil() r4: 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()) r5: app(app(dropWhile(),p),nil()) -> nil() r6: 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)) The set of usable rules consists of (no rules) Take the reduction pair: max/plus interpretations on natural numbers: app#_A(x1,x2) = max{0, x1 - 2} app_A(x1,x2) = max{x1 - 3, x2 + 2} takeWhile_A = 4 cons_A = 3 dropWhile_A = 6 The next rules are strictly ordered: p3 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(takeWhile(),p),app(app(cons(),x),xs)) -> app#(p,x) p2: app#(app(dropWhile(),p),app(app(cons(),x),xs)) -> app#(app(dropWhile(),p),xs) p3: app#(app(takeWhile(),p),app(app(cons(),x),xs)) -> app#(app(takeWhile(),p),xs) and R consists of: r1: app(app(app(if(),true()),x),y) -> x r2: app(app(app(if(),true()),x),y) -> y r3: app(app(takeWhile(),p),nil()) -> nil() r4: 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()) r5: app(app(dropWhile(),p),nil()) -> nil() r6: 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)) The estimated dependency graph contains the following SCCs: {p1, p3} {p2} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(takeWhile(),p),app(app(cons(),x),xs)) -> app#(p,x) p2: app#(app(takeWhile(),p),app(app(cons(),x),xs)) -> app#(app(takeWhile(),p),xs) and R consists of: r1: app(app(app(if(),true()),x),y) -> x r2: app(app(app(if(),true()),x),y) -> y r3: app(app(takeWhile(),p),nil()) -> nil() r4: 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()) r5: app(app(dropWhile(),p),nil()) -> nil() r6: 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)) The set of usable rules consists of (no rules) Take the reduction pair: max/plus interpretations on natural numbers: app#_A(x1,x2) = max{1, x1, x2} app_A(x1,x2) = max{x1, x2 + 2} takeWhile_A = 0 cons_A = 2 The next rules are strictly ordered: p1 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(takeWhile(),p),app(app(cons(),x),xs)) -> app#(app(takeWhile(),p),xs) and R consists of: r1: app(app(app(if(),true()),x),y) -> x r2: app(app(app(if(),true()),x),y) -> y r3: app(app(takeWhile(),p),nil()) -> nil() r4: 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()) r5: app(app(dropWhile(),p),nil()) -> nil() r6: 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)) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(takeWhile(),p),app(app(cons(),x),xs)) -> app#(app(takeWhile(),p),xs) and R consists of: r1: app(app(app(if(),true()),x),y) -> x r2: app(app(app(if(),true()),x),y) -> y r3: app(app(takeWhile(),p),nil()) -> nil() r4: 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()) r5: app(app(dropWhile(),p),nil()) -> nil() r6: 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)) The set of usable rules consists of (no rules) Take the reduction pair: max/plus interpretations on natural numbers: app#_A(x1,x2) = x2 + 1 app_A(x1,x2) = max{x1, x2 + 3} takeWhile_A = 1 cons_A = 0 The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(dropWhile(),p),app(app(cons(),x),xs)) -> app#(app(dropWhile(),p),xs) and R consists of: r1: app(app(app(if(),true()),x),y) -> x r2: app(app(app(if(),true()),x),y) -> y r3: app(app(takeWhile(),p),nil()) -> nil() r4: 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()) r5: app(app(dropWhile(),p),nil()) -> nil() r6: 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)) The set of usable rules consists of (no rules) Take the reduction pair: max/plus interpretations on natural numbers: app#_A(x1,x2) = x2 app_A(x1,x2) = max{x1, x2 + 3} dropWhile_A = 0 cons_A = 2 The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.