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: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = x1 + ((1,0),(1,0)) x2 + (12,3) app_A(x1,x2) = ((1,0),(0,0)) x1 + x2 + (4,4) map_A() = (2,2) cons_A() = (3,8) height_A() = (3,3) node_A() = (0,1) precedence: app# = app = map = cons = height > node partial status: pi(app#) = [] pi(app) = [2] pi(map) = [] pi(cons) = [] pi(height) = [] pi(node) = [] 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(map(),f),app(app(cons(),x),xs)) -> app#(f,x) p2: app#(height(),app(app(node(),x),xs)) -> app#(app(map(),height()),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: {p1, 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#(f,x) p2: app#(height(),app(app(node(),x),xs)) -> app#(app(map(),height()),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: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = ((0,0),(1,0)) x1 + ((1,0),(0,0)) x2 + (10,5) app_A(x1,x2) = ((1,0),(0,0)) x1 + ((1,0),(0,0)) x2 + (4,3) map_A() = (1,4) cons_A() = (1,6) height_A() = (2,2) node_A() = (0,1) precedence: app# = app = map = cons = height = node partial status: pi(app#) = [] pi(app) = [] pi(map) = [] pi(cons) = [] pi(height) = [] pi(node) = [] The next rules are strictly ordered: p2 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(f,x) 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: {p1} -- 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) 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: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = ((1,0),(0,0)) x2 app_A(x1,x2) = ((1,0),(0,0)) x1 + ((1,0),(0,0)) x2 + (1,1) map_A() = (1,1) cons_A() = (1,1) precedence: app = map > app# = cons partial status: pi(app#) = [] pi(app) = [] 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: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = ((0,0),(1,0)) x2 + (5,4) app_A(x1,x2) = ((1,0),(0,0)) x1 + ((1,0),(0,0)) x2 + (3,3) maxlist_A() = (1,1) cons_A() = (3,2) precedence: app# = app = maxlist = cons partial status: pi(app#) = [] pi(app) = [] 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: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = x1 + (3,1) app_A(x1,x2) = ((1,0),(1,1)) x2 + (3,0) le_A() = (1,2) s_A() = (2,3) precedence: app# = app = le = s partial status: pi(app#) = [1] pi(app) = [2] pi(le) = [] pi(s) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.