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(append(),xs),nil()) -> xs app(app(append(),nil()),ys) -> ys app(app(append(),app(app(cons(),x),xs)),ys) -> app(app(cons(),x),app(app(append(),xs),ys)) app(app(zip(),nil()),yss) -> yss app(app(zip(),xss),nil()) -> xss app(app(zip(),app(app(cons(),xs),xss)),app(app(cons(),ys),yss)) -> app(app(cons(),app(app(append(),xs),ys)),app(app(zip(),xss),yss)) app(app(combine(),xs),nil()) -> xs app(app(combine(),xs),app(app(cons(),ys),yss)) -> app(app(combine(),app(app(zip(),xs),ys)),yss) app(levels(),app(app(node(),x),xs)) -> app(app(cons(),app(app(cons(),x),nil())),app(app(combine(),nil()),app(app(map(),levels()),xs))) Instead we prove termination of the uncurried system: app(append_0(),y) -> append_1(y) app(append_1(x1),y) -> append_2(x1,y) app(combine_0(),y) -> combine_1(y) app(combine_1(x1),y) -> combine_2(x1,y) app(cons_0(),y) -> cons_1(y) app(cons_1(x1),y) -> cons_2(x1,y) app(levels_0(),y) -> levels_1(y) app(map_0(),y) -> map_1(y) app(map_1(x1),y) -> map_2(x1,y) app(node_0(),y) -> node_1(y) app(node_1(x1),y) -> node_2(x1,y) app(zip_0(),y) -> zip_1(y) app(zip_1(x1),y) -> zip_2(x1,y) map_2(f,nil_0()) -> nil_0() map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) append_2(xs,nil_0()) -> xs append_2(nil_0(),ys) -> ys append_2(cons_2(x,xs),ys) -> cons_2(x,append_2(xs,ys)) zip_2(nil_0(),yss) -> yss zip_2(xss,nil_0()) -> xss zip_2(cons_2(xs,xss),cons_2(ys,yss)) -> cons_2(append_2(xs,ys),zip_2(xss,yss)) combine_2(xs,nil_0()) -> xs combine_2(xs,cons_2(ys,yss)) -> combine_2(zip_2(xs,ys),yss) levels_1(node_2(x,xs)) -> cons_2(cons_2(x,nil_0()),combine_2(nil_0(),map_2(levels_0(),xs))) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(append_1(x1),y) -> append_2#(x1,y) p2: app#(combine_1(x1),y) -> combine_2#(x1,y) p3: app#(levels_0(),y) -> levels_1#(y) p4: app#(map_1(x1),y) -> map_2#(x1,y) p5: app#(zip_1(x1),y) -> zip_2#(x1,y) p6: map_2#(f,cons_2(x,xs)) -> app#(f,x) p7: map_2#(f,cons_2(x,xs)) -> map_2#(f,xs) p8: append_2#(cons_2(x,xs),ys) -> append_2#(xs,ys) p9: zip_2#(cons_2(xs,xss),cons_2(ys,yss)) -> append_2#(xs,ys) p10: zip_2#(cons_2(xs,xss),cons_2(ys,yss)) -> zip_2#(xss,yss) p11: combine_2#(xs,cons_2(ys,yss)) -> combine_2#(zip_2(xs,ys),yss) p12: combine_2#(xs,cons_2(ys,yss)) -> zip_2#(xs,ys) p13: levels_1#(node_2(x,xs)) -> combine_2#(nil_0(),map_2(levels_0(),xs)) p14: levels_1#(node_2(x,xs)) -> map_2#(levels_0(),xs) and R consists of: r1: app(append_0(),y) -> append_1(y) r2: app(append_1(x1),y) -> append_2(x1,y) r3: app(combine_0(),y) -> combine_1(y) r4: app(combine_1(x1),y) -> combine_2(x1,y) r5: app(cons_0(),y) -> cons_1(y) r6: app(cons_1(x1),y) -> cons_2(x1,y) r7: app(levels_0(),y) -> levels_1(y) r8: app(map_0(),y) -> map_1(y) r9: app(map_1(x1),y) -> map_2(x1,y) r10: app(node_0(),y) -> node_1(y) r11: app(node_1(x1),y) -> node_2(x1,y) r12: app(zip_0(),y) -> zip_1(y) r13: app(zip_1(x1),y) -> zip_2(x1,y) r14: map_2(f,nil_0()) -> nil_0() r15: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r16: append_2(xs,nil_0()) -> xs r17: append_2(nil_0(),ys) -> ys r18: append_2(cons_2(x,xs),ys) -> cons_2(x,append_2(xs,ys)) r19: zip_2(nil_0(),yss) -> yss r20: zip_2(xss,nil_0()) -> xss r21: zip_2(cons_2(xs,xss),cons_2(ys,yss)) -> cons_2(append_2(xs,ys),zip_2(xss,yss)) r22: combine_2(xs,nil_0()) -> xs r23: combine_2(xs,cons_2(ys,yss)) -> combine_2(zip_2(xs,ys),yss) r24: levels_1(node_2(x,xs)) -> cons_2(cons_2(x,nil_0()),combine_2(nil_0(),map_2(levels_0(),xs))) The estimated dependency graph contains the following SCCs: {p3, p4, p6, p7, p14} {p11} {p10} {p8} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: map_2#(f,cons_2(x,xs)) -> app#(f,x) p2: app#(map_1(x1),y) -> map_2#(x1,y) p3: map_2#(f,cons_2(x,xs)) -> map_2#(f,xs) p4: app#(levels_0(),y) -> levels_1#(y) p5: levels_1#(node_2(x,xs)) -> map_2#(levels_0(),xs) and R consists of: r1: app(append_0(),y) -> append_1(y) r2: app(append_1(x1),y) -> append_2(x1,y) r3: app(combine_0(),y) -> combine_1(y) r4: app(combine_1(x1),y) -> combine_2(x1,y) r5: app(cons_0(),y) -> cons_1(y) r6: app(cons_1(x1),y) -> cons_2(x1,y) r7: app(levels_0(),y) -> levels_1(y) r8: app(map_0(),y) -> map_1(y) r9: app(map_1(x1),y) -> map_2(x1,y) r10: app(node_0(),y) -> node_1(y) r11: app(node_1(x1),y) -> node_2(x1,y) r12: app(zip_0(),y) -> zip_1(y) r13: app(zip_1(x1),y) -> zip_2(x1,y) r14: map_2(f,nil_0()) -> nil_0() r15: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r16: append_2(xs,nil_0()) -> xs r17: append_2(nil_0(),ys) -> ys r18: append_2(cons_2(x,xs),ys) -> cons_2(x,append_2(xs,ys)) r19: zip_2(nil_0(),yss) -> yss r20: zip_2(xss,nil_0()) -> xss r21: zip_2(cons_2(xs,xss),cons_2(ys,yss)) -> cons_2(append_2(xs,ys),zip_2(xss,yss)) r22: combine_2(xs,nil_0()) -> xs r23: combine_2(xs,cons_2(ys,yss)) -> combine_2(zip_2(xs,ys),yss) r24: levels_1(node_2(x,xs)) -> cons_2(cons_2(x,nil_0()),combine_2(nil_0(),map_2(levels_0(),xs))) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: map_2#_A(x1,x2) = x1 + x2 + 3 cons_2_A(x1,x2) = x1 + x2 + 4 app#_A(x1,x2) = x1 + x2 + 5 map_1_A(x1) = x1 + 1 levels_0_A() = 5 levels_1#_A(x1) = x1 node_2_A(x1,x2) = x1 + x2 + 9 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: map_2#_A(x1,x2) = max{0, x1 - 41, x2 - 35} cons_2_A(x1,x2) = max{x1 + 1, x2 + 34} app#_A(x1,x2) = max{0, x1 - 49, x2 - 35} map_1_A(x1) = max{48, x1 + 15} levels_0_A = 40 levels_1#_A(x1) = max{0, x1 - 50} node_2_A(x1,x2) = max{48, x1 + 10, x2 + 28} map_2#!_A(x1,x2) = max{6, x1 - 62, x2 - 41} cons_2!_A(x1,x2) = max{7, x1 - 38, x2 - 70} app#!_A(x1,x2) = max{8, x1 - 77, x2 - 39} map_1!_A(x1) = max{2, x1 - 62} levels_0!_A = 5 levels_1#!_A(x1) = max{6, x1 - 69} node_2!_A(x1,x2) = max{x1 + 6, x2 - 23} partial status: pi(map_2#) = [] pi(cons_2) = [1, 2] pi(app#) = [2] pi(map_1) = [1] pi(levels_0) = [] pi(levels_1#) = [1] pi(node_2) = [2] The following rules are removed: p1, p2, p3, p4, p5 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: combine_2#(xs,cons_2(ys,yss)) -> combine_2#(zip_2(xs,ys),yss) and R consists of: r1: app(append_0(),y) -> append_1(y) r2: app(append_1(x1),y) -> append_2(x1,y) r3: app(combine_0(),y) -> combine_1(y) r4: app(combine_1(x1),y) -> combine_2(x1,y) r5: app(cons_0(),y) -> cons_1(y) r6: app(cons_1(x1),y) -> cons_2(x1,y) r7: app(levels_0(),y) -> levels_1(y) r8: app(map_0(),y) -> map_1(y) r9: app(map_1(x1),y) -> map_2(x1,y) r10: app(node_0(),y) -> node_1(y) r11: app(node_1(x1),y) -> node_2(x1,y) r12: app(zip_0(),y) -> zip_1(y) r13: app(zip_1(x1),y) -> zip_2(x1,y) r14: map_2(f,nil_0()) -> nil_0() r15: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r16: append_2(xs,nil_0()) -> xs r17: append_2(nil_0(),ys) -> ys r18: append_2(cons_2(x,xs),ys) -> cons_2(x,append_2(xs,ys)) r19: zip_2(nil_0(),yss) -> yss r20: zip_2(xss,nil_0()) -> xss r21: zip_2(cons_2(xs,xss),cons_2(ys,yss)) -> cons_2(append_2(xs,ys),zip_2(xss,yss)) r22: combine_2(xs,nil_0()) -> xs r23: combine_2(xs,cons_2(ys,yss)) -> combine_2(zip_2(xs,ys),yss) r24: levels_1(node_2(x,xs)) -> cons_2(cons_2(x,nil_0()),combine_2(nil_0(),map_2(levels_0(),xs))) The set of usable rules consists of r16, r17, r18, r19, r20, r21 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: combine_2#_A(x1,x2) = x1 + x2 + 2 cons_2_A(x1,x2) = x1 + x2 + 6 zip_2_A(x1,x2) = x1 + x2 + 5 append_2_A(x1,x2) = x1 + x2 + 5 nil_0_A() = 1 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: combine_2#_A(x1,x2) = max{0, x1 - 59, x2 - 25} cons_2_A(x1,x2) = max{24, x1 - 25, x2} zip_2_A(x1,x2) = max{10, x1, x2 + 9} append_2_A(x1,x2) = max{18, x1, x2 + 1} nil_0_A = 3 combine_2#!_A(x1,x2) = max{17, x1 - 34, x2 - 25} cons_2!_A(x1,x2) = max{16, x1 - 26, x2 + 11} zip_2!_A(x1,x2) = max{20, x1 - 33, x2 - 33} append_2!_A(x1,x2) = max{79, x1 + 55, x2 + 30} nil_0!_A = 3 partial status: pi(combine_2#) = [] pi(cons_2) = [1] pi(zip_2) = [2] pi(append_2) = [1] pi(nil_0) = [] 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: zip_2#(cons_2(xs,xss),cons_2(ys,yss)) -> zip_2#(xss,yss) and R consists of: r1: app(append_0(),y) -> append_1(y) r2: app(append_1(x1),y) -> append_2(x1,y) r3: app(combine_0(),y) -> combine_1(y) r4: app(combine_1(x1),y) -> combine_2(x1,y) r5: app(cons_0(),y) -> cons_1(y) r6: app(cons_1(x1),y) -> cons_2(x1,y) r7: app(levels_0(),y) -> levels_1(y) r8: app(map_0(),y) -> map_1(y) r9: app(map_1(x1),y) -> map_2(x1,y) r10: app(node_0(),y) -> node_1(y) r11: app(node_1(x1),y) -> node_2(x1,y) r12: app(zip_0(),y) -> zip_1(y) r13: app(zip_1(x1),y) -> zip_2(x1,y) r14: map_2(f,nil_0()) -> nil_0() r15: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r16: append_2(xs,nil_0()) -> xs r17: append_2(nil_0(),ys) -> ys r18: append_2(cons_2(x,xs),ys) -> cons_2(x,append_2(xs,ys)) r19: zip_2(nil_0(),yss) -> yss r20: zip_2(xss,nil_0()) -> xss r21: zip_2(cons_2(xs,xss),cons_2(ys,yss)) -> cons_2(append_2(xs,ys),zip_2(xss,yss)) r22: combine_2(xs,nil_0()) -> xs r23: combine_2(xs,cons_2(ys,yss)) -> combine_2(zip_2(xs,ys),yss) r24: levels_1(node_2(x,xs)) -> cons_2(cons_2(x,nil_0()),combine_2(nil_0(),map_2(levels_0(),xs))) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: zip_2#_A(x1,x2) = x1 + x2 cons_2_A(x1,x2) = x2 + 3 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: zip_2#_A(x1,x2) = 0 cons_2_A(x1,x2) = max{25, x1 - 45, x2 - 45} zip_2#!_A(x1,x2) = 1 cons_2!_A(x1,x2) = max{0, x1 - 43} partial status: pi(zip_2#) = [1, 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: append_2#(cons_2(x,xs),ys) -> append_2#(xs,ys) and R consists of: r1: app(append_0(),y) -> append_1(y) r2: app(append_1(x1),y) -> append_2(x1,y) r3: app(combine_0(),y) -> combine_1(y) r4: app(combine_1(x1),y) -> combine_2(x1,y) r5: app(cons_0(),y) -> cons_1(y) r6: app(cons_1(x1),y) -> cons_2(x1,y) r7: app(levels_0(),y) -> levels_1(y) r8: app(map_0(),y) -> map_1(y) r9: app(map_1(x1),y) -> map_2(x1,y) r10: app(node_0(),y) -> node_1(y) r11: app(node_1(x1),y) -> node_2(x1,y) r12: app(zip_0(),y) -> zip_1(y) r13: app(zip_1(x1),y) -> zip_2(x1,y) r14: map_2(f,nil_0()) -> nil_0() r15: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r16: append_2(xs,nil_0()) -> xs r17: append_2(nil_0(),ys) -> ys r18: append_2(cons_2(x,xs),ys) -> cons_2(x,append_2(xs,ys)) r19: zip_2(nil_0(),yss) -> yss r20: zip_2(xss,nil_0()) -> xss r21: zip_2(cons_2(xs,xss),cons_2(ys,yss)) -> cons_2(append_2(xs,ys),zip_2(xss,yss)) r22: combine_2(xs,nil_0()) -> xs r23: combine_2(xs,cons_2(ys,yss)) -> combine_2(zip_2(xs,ys),yss) r24: levels_1(node_2(x,xs)) -> cons_2(cons_2(x,nil_0()),combine_2(nil_0(),map_2(levels_0(),xs))) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: append_2#_A(x1,x2) = x1 cons_2_A(x1,x2) = x1 + x2 + 3 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: append_2#_A(x1,x2) = 0 cons_2_A(x1,x2) = max{38, x1 - 57, x2 - 57} append_2#!_A(x1,x2) = max{0, x2 - 1} cons_2!_A(x1,x2) = max{8, x1 - 28, x2 - 50} partial status: pi(append_2#) = [] pi(cons_2) = [1] The following rules are removed: p1 Then no dependency pair remains.