YES We show the termination of the TRS R: app(app(map(),f),nil()) -> nil() app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs)) app(app(le(),|0|()),y) -> true() app(app(le(),app(s(),x)),|0|()) -> false() app(app(le(),app(s(),x)),app(s(),y)) -> app(app(le(),x),y) app(app(maxlist(),x),app(app(cons(),y),ys)) -> app(app(if(),app(app(le(),x),y)),app(app(maxlist(),y),ys)) app(app(maxlist(),x),nil()) -> x app(height(),app(app(node(),x),xs)) -> app(s(),app(app(maxlist(),|0|()),app(app(map(),height()),xs))) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(app(cons(),app(f,x)),app(app(map(),f),xs)) p2: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(cons(),app(f,x)) p3: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(f,x) p4: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(app(map(),f),xs) p5: app#(app(le(),app(s(),x)),app(s(),y)) -> app#(app(le(),x),y) p6: app#(app(le(),app(s(),x)),app(s(),y)) -> app#(le(),x) p7: app#(app(maxlist(),x),app(app(cons(),y),ys)) -> app#(app(if(),app(app(le(),x),y)),app(app(maxlist(),y),ys)) p8: app#(app(maxlist(),x),app(app(cons(),y),ys)) -> app#(if(),app(app(le(),x),y)) p9: app#(app(maxlist(),x),app(app(cons(),y),ys)) -> app#(app(le(),x),y) p10: app#(app(maxlist(),x),app(app(cons(),y),ys)) -> app#(le(),x) p11: app#(app(maxlist(),x),app(app(cons(),y),ys)) -> app#(app(maxlist(),y),ys) p12: app#(app(maxlist(),x),app(app(cons(),y),ys)) -> app#(maxlist(),y) p13: app#(height(),app(app(node(),x),xs)) -> app#(s(),app(app(maxlist(),|0|()),app(app(map(),height()),xs))) p14: app#(height(),app(app(node(),x),xs)) -> app#(app(maxlist(),|0|()),app(app(map(),height()),xs)) p15: app#(height(),app(app(node(),x),xs)) -> app#(maxlist(),|0|()) p16: app#(height(),app(app(node(),x),xs)) -> app#(app(map(),height()),xs) p17: app#(height(),app(app(node(),x),xs)) -> app#(map(),height()) and R consists of: r1: app(app(map(),f),nil()) -> nil() r2: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs)) r3: app(app(le(),|0|()),y) -> true() r4: app(app(le(),app(s(),x)),|0|()) -> false() r5: app(app(le(),app(s(),x)),app(s(),y)) -> app(app(le(),x),y) r6: app(app(maxlist(),x),app(app(cons(),y),ys)) -> app(app(if(),app(app(le(),x),y)),app(app(maxlist(),y),ys)) r7: app(app(maxlist(),x),nil()) -> x r8: app(height(),app(app(node(),x),xs)) -> app(s(),app(app(maxlist(),|0|()),app(app(map(),height()),xs))) The estimated dependency graph contains the following SCCs: {p3, p4, p16} {p11} {p5} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(f,x) p2: app#(height(),app(app(node(),x),xs)) -> app#(app(map(),height()),xs) p3: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(app(map(),f),xs) and R consists of: r1: app(app(map(),f),nil()) -> nil() r2: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs)) r3: app(app(le(),|0|()),y) -> true() r4: app(app(le(),app(s(),x)),|0|()) -> false() r5: app(app(le(),app(s(),x)),app(s(),y)) -> app(app(le(),x),y) r6: app(app(maxlist(),x),app(app(cons(),y),ys)) -> app(app(if(),app(app(le(),x),y)),app(app(maxlist(),y),ys)) r7: app(app(maxlist(),x),nil()) -> x r8: app(height(),app(app(node(),x),xs)) -> app(s(),app(app(maxlist(),|0|()),app(app(map(),height()),xs))) The set of usable rules consists of (no rules) Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: app#_A(x1,x2) = max{1, x1 - 12, x2 - 16} app_A(x1,x2) = max{26, x1 + 13, x2 + 18} map_A = 4 cons_A = 5 height_A = 3 node_A = 13 precedence: app# = app = map > cons = height = node partial status: pi(app#) = [] pi(app) = [1, 2] pi(map) = [] pi(cons) = [] pi(height) = [] pi(node) = [] 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#(height(),app(app(node(),x),xs)) -> app#(app(map(),height()),xs) p2: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(app(map(),f),xs) and R consists of: r1: app(app(map(),f),nil()) -> nil() r2: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs)) r3: app(app(le(),|0|()),y) -> true() r4: app(app(le(),app(s(),x)),|0|()) -> false() r5: app(app(le(),app(s(),x)),app(s(),y)) -> app(app(le(),x),y) r6: app(app(maxlist(),x),app(app(cons(),y),ys)) -> app(app(if(),app(app(le(),x),y)),app(app(maxlist(),y),ys)) r7: app(app(maxlist(),x),nil()) -> x r8: app(height(),app(app(node(),x),xs)) -> app(s(),app(app(maxlist(),|0|()),app(app(map(),height()),xs))) The estimated dependency graph contains the following SCCs: {p2} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(app(map(),f),xs) and R consists of: r1: app(app(map(),f),nil()) -> nil() r2: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs)) r3: app(app(le(),|0|()),y) -> true() r4: app(app(le(),app(s(),x)),|0|()) -> false() r5: app(app(le(),app(s(),x)),app(s(),y)) -> app(app(le(),x),y) r6: app(app(maxlist(),x),app(app(cons(),y),ys)) -> app(app(if(),app(app(le(),x),y)),app(app(maxlist(),y),ys)) r7: app(app(maxlist(),x),nil()) -> x r8: app(height(),app(app(node(),x),xs)) -> app(s(),app(app(maxlist(),|0|()),app(app(map(),height()),xs))) The set of usable rules consists of (no rules) Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: app#_A(x1,x2) = max{0, x2 - 5} app_A(x1,x2) = max{x1 + 7, x2 + 4} map_A = 3 cons_A = 4 precedence: app# = app = map = cons partial status: pi(app#) = [] pi(app) = [1, 2] pi(map) = [] pi(cons) = [] 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(maxlist(),x),app(app(cons(),y),ys)) -> app#(app(maxlist(),y),ys) and R consists of: r1: app(app(map(),f),nil()) -> nil() r2: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs)) r3: app(app(le(),|0|()),y) -> true() r4: app(app(le(),app(s(),x)),|0|()) -> false() r5: app(app(le(),app(s(),x)),app(s(),y)) -> app(app(le(),x),y) r6: app(app(maxlist(),x),app(app(cons(),y),ys)) -> app(app(if(),app(app(le(),x),y)),app(app(maxlist(),y),ys)) r7: app(app(maxlist(),x),nil()) -> x r8: app(height(),app(app(node(),x),xs)) -> app(s(),app(app(maxlist(),|0|()),app(app(map(),height()),xs))) The set of usable rules consists of (no rules) Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: app#_A(x1,x2) = max{x1 + 8, x2 + 13} app_A(x1,x2) = max{x1 + 2, x2 + 6} maxlist_A = 2 cons_A = 3 precedence: app# = app = maxlist = cons partial status: pi(app#) = [] pi(app) = [1, 2] pi(maxlist) = [] pi(cons) = [] 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(le(),app(s(),x)),app(s(),y)) -> app#(app(le(),x),y) and R consists of: r1: app(app(map(),f),nil()) -> nil() r2: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs)) r3: app(app(le(),|0|()),y) -> true() r4: app(app(le(),app(s(),x)),|0|()) -> false() r5: app(app(le(),app(s(),x)),app(s(),y)) -> app(app(le(),x),y) r6: app(app(maxlist(),x),app(app(cons(),y),ys)) -> app(app(if(),app(app(le(),x),y)),app(app(maxlist(),y),ys)) r7: app(app(maxlist(),x),nil()) -> x r8: app(height(),app(app(node(),x),xs)) -> app(s(),app(app(maxlist(),|0|()),app(app(map(),height()),xs))) The set of usable rules consists of (no rules) Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: app#_A(x1,x2) = max{x1 - 9, x2 + 4} app_A(x1,x2) = max{x1 + 2, x2 + 4} le_A = 2 s_A = 1 precedence: app# = app = le = s partial status: pi(app#) = [2] pi(app) = [] pi(le) = [] pi(s) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.