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))) Instead we prove termination of the uncurried system: app(cons_0(),y) -> cons_1(y) app(cons_1(x1),y) -> cons_2(x1,y) app(height_0(),y) -> height_1(y) app(if_0(),y) -> if_1(y) app(if_1(x1),y) -> if_2(x1,y) app(le_0(),y) -> le_1(y) app(le_1(x1),y) -> le_2(x1,y) app(map_0(),y) -> map_1(y) app(map_1(x1),y) -> map_2(x1,y) app(maxlist_0(),y) -> maxlist_1(y) app(maxlist_1(x1),y) -> maxlist_2(x1,y) app(node_0(),y) -> node_1(y) app(node_1(x1),y) -> node_2(x1,y) app(s_0(),y) -> s_1(y) map_2(f,nil_0()) -> nil_0() map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) le_2(|0|_0(),y) -> true_0() le_2(s_1(x),|0|_0()) -> false_0() le_2(s_1(x),s_1(y)) -> le_2(x,y) maxlist_2(x,cons_2(y,ys)) -> if_2(le_2(x,y),maxlist_2(y,ys)) maxlist_2(x,nil_0()) -> x height_1(node_2(x,xs)) -> s_1(maxlist_2(|0|_0(),map_2(height_0(),xs))) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(height_0(),y) -> height_1#(y) p2: app#(le_1(x1),y) -> le_2#(x1,y) p3: app#(map_1(x1),y) -> map_2#(x1,y) p4: app#(maxlist_1(x1),y) -> maxlist_2#(x1,y) p5: map_2#(f,cons_2(x,xs)) -> app#(f,x) p6: map_2#(f,cons_2(x,xs)) -> map_2#(f,xs) p7: le_2#(s_1(x),s_1(y)) -> le_2#(x,y) p8: maxlist_2#(x,cons_2(y,ys)) -> le_2#(x,y) p9: maxlist_2#(x,cons_2(y,ys)) -> maxlist_2#(y,ys) p10: height_1#(node_2(x,xs)) -> maxlist_2#(|0|_0(),map_2(height_0(),xs)) p11: height_1#(node_2(x,xs)) -> map_2#(height_0(),xs) and R consists of: r1: app(cons_0(),y) -> cons_1(y) r2: app(cons_1(x1),y) -> cons_2(x1,y) r3: app(height_0(),y) -> height_1(y) r4: app(if_0(),y) -> if_1(y) r5: app(if_1(x1),y) -> if_2(x1,y) r6: app(le_0(),y) -> le_1(y) r7: app(le_1(x1),y) -> le_2(x1,y) r8: app(map_0(),y) -> map_1(y) r9: app(map_1(x1),y) -> map_2(x1,y) r10: app(maxlist_0(),y) -> maxlist_1(y) r11: app(maxlist_1(x1),y) -> maxlist_2(x1,y) r12: app(node_0(),y) -> node_1(y) r13: app(node_1(x1),y) -> node_2(x1,y) r14: app(s_0(),y) -> s_1(y) r15: map_2(f,nil_0()) -> nil_0() r16: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r17: le_2(|0|_0(),y) -> true_0() r18: le_2(s_1(x),|0|_0()) -> false_0() r19: le_2(s_1(x),s_1(y)) -> le_2(x,y) r20: maxlist_2(x,cons_2(y,ys)) -> if_2(le_2(x,y),maxlist_2(y,ys)) r21: maxlist_2(x,nil_0()) -> x r22: height_1(node_2(x,xs)) -> s_1(maxlist_2(|0|_0(),map_2(height_0(),xs))) The estimated dependency graph contains the following SCCs: {p1, p3, p5, p6, p11} {p9} {p7} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(height_0(),y) -> height_1#(y) p2: height_1#(node_2(x,xs)) -> map_2#(height_0(),xs) p3: map_2#(f,cons_2(x,xs)) -> map_2#(f,xs) p4: map_2#(f,cons_2(x,xs)) -> app#(f,x) p5: app#(map_1(x1),y) -> map_2#(x1,y) and R consists of: r1: app(cons_0(),y) -> cons_1(y) r2: app(cons_1(x1),y) -> cons_2(x1,y) r3: app(height_0(),y) -> height_1(y) r4: app(if_0(),y) -> if_1(y) r5: app(if_1(x1),y) -> if_2(x1,y) r6: app(le_0(),y) -> le_1(y) r7: app(le_1(x1),y) -> le_2(x1,y) r8: app(map_0(),y) -> map_1(y) r9: app(map_1(x1),y) -> map_2(x1,y) r10: app(maxlist_0(),y) -> maxlist_1(y) r11: app(maxlist_1(x1),y) -> maxlist_2(x1,y) r12: app(node_0(),y) -> node_1(y) r13: app(node_1(x1),y) -> node_2(x1,y) r14: app(s_0(),y) -> s_1(y) r15: map_2(f,nil_0()) -> nil_0() r16: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r17: le_2(|0|_0(),y) -> true_0() r18: le_2(s_1(x),|0|_0()) -> false_0() r19: le_2(s_1(x),s_1(y)) -> le_2(x,y) r20: maxlist_2(x,cons_2(y,ys)) -> if_2(le_2(x,y),maxlist_2(y,ys)) r21: maxlist_2(x,nil_0()) -> x r22: height_1(node_2(x,xs)) -> s_1(maxlist_2(|0|_0(),map_2(height_0(),xs))) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: app#_A(x1,x2) = 1 height_0_A = 2 height_1#_A(x1) = 1 node_2_A(x1,x2) = max{18, x1 - 3, x2 - 3} map_2#_A(x1,x2) = 1 cons_2_A(x1,x2) = max{2, x1 - 21, x2 - 21} map_1_A(x1) = max{2, x1 - 30} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: app#_A(x1,x2) = max{0, x1 - 8, x2 - 1} height_0_A = 7 height_1#_A(x1) = max{0, x1 - 7} node_2_A(x1,x2) = max{x1 + 5, x2 + 5} map_2#_A(x1,x2) = max{0, x1 - 8, x2 - 12} cons_2_A(x1,x2) = max{x1 + 11, x2 + 3} map_1_A(x1) = x1 + 6 app#!_A(x1,x2) = max{5, x1 - 21, x2 - 5} height_0!_A = 5 height_1#!_A(x1) = max{4, x1 - 6} node_2!_A(x1,x2) = max{6, x1 - 1, x2 - 1} map_2#!_A(x1,x2) = max{3, x1 - 21, x2 - 6} cons_2!_A(x1,x2) = max{0, x1 - 39, x2 - 42} map_1!_A(x1) = max{2, x1 - 20} partial status: pi(app#) = [] pi(height_0) = [] pi(height_1#) = [] pi(node_2) = [] pi(map_2#) = [] pi(cons_2) = [] pi(map_1) = [] The following rules are removed: p1, p2, p5 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: map_2#(f,cons_2(x,xs)) -> map_2#(f,xs) p2: map_2#(f,cons_2(x,xs)) -> app#(f,x) and R consists of: r1: app(cons_0(),y) -> cons_1(y) r2: app(cons_1(x1),y) -> cons_2(x1,y) r3: app(height_0(),y) -> height_1(y) r4: app(if_0(),y) -> if_1(y) r5: app(if_1(x1),y) -> if_2(x1,y) r6: app(le_0(),y) -> le_1(y) r7: app(le_1(x1),y) -> le_2(x1,y) r8: app(map_0(),y) -> map_1(y) r9: app(map_1(x1),y) -> map_2(x1,y) r10: app(maxlist_0(),y) -> maxlist_1(y) r11: app(maxlist_1(x1),y) -> maxlist_2(x1,y) r12: app(node_0(),y) -> node_1(y) r13: app(node_1(x1),y) -> node_2(x1,y) r14: app(s_0(),y) -> s_1(y) r15: map_2(f,nil_0()) -> nil_0() r16: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r17: le_2(|0|_0(),y) -> true_0() r18: le_2(s_1(x),|0|_0()) -> false_0() r19: le_2(s_1(x),s_1(y)) -> le_2(x,y) r20: maxlist_2(x,cons_2(y,ys)) -> if_2(le_2(x,y),maxlist_2(y,ys)) r21: maxlist_2(x,nil_0()) -> x r22: height_1(node_2(x,xs)) -> s_1(maxlist_2(|0|_0(),map_2(height_0(),xs))) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: map_2#(f,cons_2(x,xs)) -> map_2#(f,xs) and R consists of: r1: app(cons_0(),y) -> cons_1(y) r2: app(cons_1(x1),y) -> cons_2(x1,y) r3: app(height_0(),y) -> height_1(y) r4: app(if_0(),y) -> if_1(y) r5: app(if_1(x1),y) -> if_2(x1,y) r6: app(le_0(),y) -> le_1(y) r7: app(le_1(x1),y) -> le_2(x1,y) r8: app(map_0(),y) -> map_1(y) r9: app(map_1(x1),y) -> map_2(x1,y) r10: app(maxlist_0(),y) -> maxlist_1(y) r11: app(maxlist_1(x1),y) -> maxlist_2(x1,y) r12: app(node_0(),y) -> node_1(y) r13: app(node_1(x1),y) -> node_2(x1,y) r14: app(s_0(),y) -> s_1(y) r15: map_2(f,nil_0()) -> nil_0() r16: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r17: le_2(|0|_0(),y) -> true_0() r18: le_2(s_1(x),|0|_0()) -> false_0() r19: le_2(s_1(x),s_1(y)) -> le_2(x,y) r20: maxlist_2(x,cons_2(y,ys)) -> if_2(le_2(x,y),maxlist_2(y,ys)) r21: maxlist_2(x,nil_0()) -> x r22: height_1(node_2(x,xs)) -> s_1(maxlist_2(|0|_0(),map_2(height_0(),xs))) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: map_2#_A(x1,x2) = max{13, x2 - 1} cons_2_A(x1,x2) = max{x1 + 15, x2 + 5} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: map_2#_A(x1,x2) = 0 cons_2_A(x1,x2) = max{4, x1 - 1, x2 - 14} map_2#!_A(x1,x2) = 0 cons_2!_A(x1,x2) = max{0, x1 - 54, x2 - 104} partial status: pi(map_2#) = [] pi(cons_2) = [] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: maxlist_2#(x,cons_2(y,ys)) -> maxlist_2#(y,ys) and R consists of: r1: app(cons_0(),y) -> cons_1(y) r2: app(cons_1(x1),y) -> cons_2(x1,y) r3: app(height_0(),y) -> height_1(y) r4: app(if_0(),y) -> if_1(y) r5: app(if_1(x1),y) -> if_2(x1,y) r6: app(le_0(),y) -> le_1(y) r7: app(le_1(x1),y) -> le_2(x1,y) r8: app(map_0(),y) -> map_1(y) r9: app(map_1(x1),y) -> map_2(x1,y) r10: app(maxlist_0(),y) -> maxlist_1(y) r11: app(maxlist_1(x1),y) -> maxlist_2(x1,y) r12: app(node_0(),y) -> node_1(y) r13: app(node_1(x1),y) -> node_2(x1,y) r14: app(s_0(),y) -> s_1(y) r15: map_2(f,nil_0()) -> nil_0() r16: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r17: le_2(|0|_0(),y) -> true_0() r18: le_2(s_1(x),|0|_0()) -> false_0() r19: le_2(s_1(x),s_1(y)) -> le_2(x,y) r20: maxlist_2(x,cons_2(y,ys)) -> if_2(le_2(x,y),maxlist_2(y,ys)) r21: maxlist_2(x,nil_0()) -> x r22: height_1(node_2(x,xs)) -> s_1(maxlist_2(|0|_0(),map_2(height_0(),xs))) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: maxlist_2#_A(x1,x2) = max{11, x1 + 4, x2} cons_2_A(x1,x2) = max{11, x1 + 4, x2 + 9} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: maxlist_2#_A(x1,x2) = 0 cons_2_A(x1,x2) = max{15, x1 - 1, x2 - 6} maxlist_2#!_A(x1,x2) = 0 cons_2!_A(x1,x2) = max{6, x1 - 26, x2 - 82} partial status: pi(maxlist_2#) = [2] pi(cons_2) = [2] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: le_2#(s_1(x),s_1(y)) -> le_2#(x,y) and R consists of: r1: app(cons_0(),y) -> cons_1(y) r2: app(cons_1(x1),y) -> cons_2(x1,y) r3: app(height_0(),y) -> height_1(y) r4: app(if_0(),y) -> if_1(y) r5: app(if_1(x1),y) -> if_2(x1,y) r6: app(le_0(),y) -> le_1(y) r7: app(le_1(x1),y) -> le_2(x1,y) r8: app(map_0(),y) -> map_1(y) r9: app(map_1(x1),y) -> map_2(x1,y) r10: app(maxlist_0(),y) -> maxlist_1(y) r11: app(maxlist_1(x1),y) -> maxlist_2(x1,y) r12: app(node_0(),y) -> node_1(y) r13: app(node_1(x1),y) -> node_2(x1,y) r14: app(s_0(),y) -> s_1(y) r15: map_2(f,nil_0()) -> nil_0() r16: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r17: le_2(|0|_0(),y) -> true_0() r18: le_2(s_1(x),|0|_0()) -> false_0() r19: le_2(s_1(x),s_1(y)) -> le_2(x,y) r20: maxlist_2(x,cons_2(y,ys)) -> if_2(le_2(x,y),maxlist_2(y,ys)) r21: maxlist_2(x,nil_0()) -> x r22: height_1(node_2(x,xs)) -> s_1(maxlist_2(|0|_0(),map_2(height_0(),xs))) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: le_2#_A(x1,x2) = max{1, x1 - 1, x2 - 4} s_1_A(x1) = x1 + 30 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: le_2#_A(x1,x2) = 0 s_1_A(x1) = max{12, x1 - 3} le_2#!_A(x1,x2) = max{10, x2 - 1} s_1!_A(x1) = max{9, x1 - 53} partial status: pi(le_2#) = [] pi(s_1) = [1] The following rules are removed: p1 Then no dependency pair remains.