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: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: app#_A(x1,x2) = max{0, x1 - 58, x2 - 29} height_0_A = 0 height_1#_A(x1) = max{0, x1 - 146} node_2_A(x1,x2) = max{x1 + 48, x2 + 101} map_2#_A(x1,x2) = max{0, x1 - 44, x2 - 45} cons_2_A(x1,x2) = max{x1 + 16, x2 + 5} map_1_A(x1) = max{57, x1 + 14} app#!_A(x1,x2) = max{9, x1 - 58, x2 - 5} height_0!_A = 1 height_1#!_A(x1) = max{8, x1 - 107} node_2!_A(x1,x2) = max{5, x1 - 2, x2 - 47} map_2#!_A(x1,x2) = max{7, x1 - 50, x2 - 6} cons_2!_A(x1,x2) = max{8, x1 - 115, x2 - 110} map_1!_A(x1) = max{6, x1 - 49} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: app#_A(x1,x2) = max{0, x1 - 45, x2 - 4} height_0_A = 32 height_1#_A(x1) = max{0, x1 - 18} node_2_A(x1,x2) = max{x1 + 4, x2 - 32} map_2#_A(x1,x2) = max{0, x1 - 45, x2 - 50} cons_2_A(x1,x2) = max{x1 + 46, x2 + 33} map_1_A(x1) = max{44, x1 + 12} app#!_A(x1,x2) = max{x1 - 45, x2 + 7} height_0!_A = 2 height_1#!_A(x1) = max{6, x1 - 5} node_2!_A(x1,x2) = max{10, x1 - 38, x2 - 125} map_2#!_A(x1,x2) = max{5, x1 - 45, x2 - 38} cons_2!_A(x1,x2) = max{4, x1 - 44, x2 - 71} map_1!_A(x1) = max{6, x1 - 46} partial status: pi(app#) = [1] pi(height_0) = [] pi(height_1#) = [] pi(node_2) = [2] pi(map_2#) = [1] pi(cons_2) = [2] pi(map_1) = [1] The following rules are removed: p1, p2, p4, 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) 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: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. 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{3, x1 - 63, x2 - 4} map_2#!_A(x1,x2) = max{0, x2 - 4} cons_2!_A(x1,x2) = max{7, x1 - 84, x2 - 3} 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{3, x1 - 13, x2 - 4} map_2#!_A(x1,x2) = max{6, x1 - 1, x2 - 12} cons_2!_A(x1,x2) = max{5, x1 - 51, x2 - 11} partial status: pi(map_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: 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: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. 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{0, x1 - 14, x2 - 14} maxlist_2#!_A(x1,x2) = max{3, x1 - 57, x2 - 13} cons_2!_A(x1,x2) = max{3, x1 - 57, x2 - 13} 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{3, x1 - 3, x2 - 28} maxlist_2#!_A(x1,x2) = max{4, x1 - 65, x2 - 66} cons_2!_A(x1,x2) = max{4, x1 - 65, x2 - 66} 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: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: le_2#_A(x1,x2) = 0 s_1_A(x1) = max{3, x1 - 3} le_2#!_A(x1,x2) = max{0, x2 - 59} s_1!_A(x1) = max{0, x1 - 58} 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{3, x1 - 3} le_2#!_A(x1,x2) = max{1, x2 - 20} s_1!_A(x1) = max{10, x1 - 19} partial status: pi(le_2#) = [2] pi(s_1) = [1] The following rules are removed: p1 Then no dependency pair remains.