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: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = x1 + x2 + (2,3) app_A(x1,x2) = x1 + x2 + (0,2) map_A() = (0,2) cons_A() = (1,8) height_A() = (1,1) node_A() = (0,9) precedence: app# = app = map = cons > height = node partial status: pi(app#) = [2] pi(app) = [1, 2] pi(map) = [] pi(cons) = [] pi(height) = [] pi(node) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = (5,5) app_A(x1,x2) = x2 + (2,2) map_A() = (5,5) cons_A() = (6,6) height_A() = (1,1) node_A() = (4,4) precedence: cons > app# = app = map = 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: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = x1 + x2 + (5,4) app_A(x1,x2) = ((1,0),(0,0)) x1 + ((1,0),(0,0)) x2 + (2,3) map_A() = (2,2) cons_A() = (2,1) height_A() = (1,1) node_A() = (9,8) precedence: app# = app = map > height > cons > node partial status: pi(app#) = [1] pi(app) = [] pi(map) = [] pi(cons) = [] pi(height) = [] pi(node) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = (2,1) app_A(x1,x2) = (1,0) map_A() = (5,4) cons_A() = (3,2) height_A() = (3,2) node_A() = (4,3) precedence: app = map > app# = 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: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = ((1,0),(1,1)) x1 + (4,4) app_A(x1,x2) = x1 + ((1,0),(1,1)) x2 + (2,2) map_A() = (5,1) cons_A() = (1,1) precedence: app# = app = map = cons partial status: pi(app#) = [] pi(app) = [] pi(map) = [] pi(cons) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = (1,2) app_A(x1,x2) = ((1,0),(0,0)) x1 + ((1,0),(0,0)) x2 + (1,3) map_A() = (2,1) cons_A() = (2,3) precedence: app# = app > map = 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: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = ((1,0),(0,0)) x2 + (1,2) app_A(x1,x2) = x2 + (4,2) maxlist_A() = (3,1) cons_A() = (2,3) precedence: app# = app = maxlist = cons partial status: pi(app#) = [] pi(app) = [] pi(maxlist) = [] pi(cons) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = (0,0) app_A(x1,x2) = x2 + (0,2) maxlist_A() = (1,3) cons_A() = (0,1) precedence: cons > app# = app = maxlist partial status: pi(app#) = [] pi(app) = [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: lexicographic combination of reduction pairs: 1. 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),(1,1)) x2 + (4,11) app_A(x1,x2) = ((0,0),(1,0)) x1 + x2 + (3,1) le_A() = (5,5) s_A() = (6,4) precedence: app# > le > app = s partial status: pi(app#) = [2] pi(app) = [2] pi(le) = [] pi(s) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = ((1,0),(1,1)) x2 app_A(x1,x2) = x2 + (3,0) le_A() = (1,1) s_A() = (2,2) precedence: app# > app = le = s partial status: pi(app#) = [] 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.