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(flatten(),app(app(node(),x),xs)) -> app(app(cons(),x),app(concat(),app(app(map(),flatten()),xs))) app(concat(),nil()) -> nil() app(concat(),app(app(cons(),x),xs)) -> app(app(append(),x),app(concat(),xs)) app(app(append(),nil()),xs) -> xs app(app(append(),app(app(cons(),x),xs)),ys) -> app(app(cons(),x),app(app(append(),xs),ys)) 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(concat_0(),y) -> concat_1(y) app(cons_0(),y) -> cons_1(y) app(cons_1(x1),y) -> cons_2(x1,y) app(flatten_0(),y) -> flatten_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) map_2(f,nil_0()) -> nil_0() map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) flatten_1(node_2(x,xs)) -> cons_2(x,concat_1(map_2(flatten_0(),xs))) concat_1(nil_0()) -> nil_0() concat_1(cons_2(x,xs)) -> append_2(x,concat_1(xs)) append_2(nil_0(),xs) -> xs append_2(cons_2(x,xs),ys) -> cons_2(x,append_2(xs,ys)) -- 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#(concat_0(),y) -> concat_1#(y) p3: app#(flatten_0(),y) -> flatten_1#(y) p4: app#(map_1(x1),y) -> map_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: flatten_1#(node_2(x,xs)) -> concat_1#(map_2(flatten_0(),xs)) p8: flatten_1#(node_2(x,xs)) -> map_2#(flatten_0(),xs) p9: concat_1#(cons_2(x,xs)) -> append_2#(x,concat_1(xs)) p10: concat_1#(cons_2(x,xs)) -> concat_1#(xs) p11: 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(concat_0(),y) -> concat_1(y) r4: app(cons_0(),y) -> cons_1(y) r5: app(cons_1(x1),y) -> cons_2(x1,y) r6: app(flatten_0(),y) -> flatten_1(y) r7: app(map_0(),y) -> map_1(y) r8: app(map_1(x1),y) -> map_2(x1,y) r9: app(node_0(),y) -> node_1(y) r10: app(node_1(x1),y) -> node_2(x1,y) r11: map_2(f,nil_0()) -> nil_0() r12: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r13: flatten_1(node_2(x,xs)) -> cons_2(x,concat_1(map_2(flatten_0(),xs))) r14: concat_1(nil_0()) -> nil_0() r15: concat_1(cons_2(x,xs)) -> append_2(x,concat_1(xs)) r16: append_2(nil_0(),xs) -> xs r17: append_2(cons_2(x,xs),ys) -> cons_2(x,append_2(xs,ys)) The estimated dependency graph contains the following SCCs: {p3, p4, p5, p6, p8} {p10} {p11} -- 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#(flatten_0(),y) -> flatten_1#(y) p5: flatten_1#(node_2(x,xs)) -> map_2#(flatten_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(concat_0(),y) -> concat_1(y) r4: app(cons_0(),y) -> cons_1(y) r5: app(cons_1(x1),y) -> cons_2(x1,y) r6: app(flatten_0(),y) -> flatten_1(y) r7: app(map_0(),y) -> map_1(y) r8: app(map_1(x1),y) -> map_2(x1,y) r9: app(node_0(),y) -> node_1(y) r10: app(node_1(x1),y) -> node_2(x1,y) r11: map_2(f,nil_0()) -> nil_0() r12: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r13: flatten_1(node_2(x,xs)) -> cons_2(x,concat_1(map_2(flatten_0(),xs))) r14: concat_1(nil_0()) -> nil_0() r15: concat_1(cons_2(x,xs)) -> append_2(x,concat_1(xs)) r16: append_2(nil_0(),xs) -> xs r17: append_2(cons_2(x,xs),ys) -> cons_2(x,append_2(xs,ys)) 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 + 7 cons_2_A(x1,x2) = x1 + x2 + 6 app#_A(x1,x2) = x1 + x2 + 7 map_1_A(x1) = x1 + 3 flatten_0_A() = 1 flatten_1#_A(x1) = x1 + 2 node_2_A(x1,x2) = x1 + x2 + 12 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: map_2#_A(x1,x2) = x2 cons_2_A(x1,x2) = x1 + x2 + 5 app#_A(x1,x2) = x2 map_1_A(x1) = x1 + 3 flatten_0_A() = 1 flatten_1#_A(x1) = x1 node_2_A(x1,x2) = x1 + x2 + 5 map_2#!_A(x1,x2) = 3 cons_2!_A(x1,x2) = x1 + x2 + 2 app#!_A(x1,x2) = 4 map_1!_A(x1) = 1 flatten_0!_A() = 12 flatten_1#!_A(x1) = x1 + 13 node_2!_A(x1,x2) = 11 partial status: pi(map_2#) = [] pi(cons_2) = [1] pi(app#) = [] pi(map_1) = [1] pi(flatten_0) = [] pi(flatten_1#) = [] pi(node_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: concat_1#(cons_2(x,xs)) -> concat_1#(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(concat_0(),y) -> concat_1(y) r4: app(cons_0(),y) -> cons_1(y) r5: app(cons_1(x1),y) -> cons_2(x1,y) r6: app(flatten_0(),y) -> flatten_1(y) r7: app(map_0(),y) -> map_1(y) r8: app(map_1(x1),y) -> map_2(x1,y) r9: app(node_0(),y) -> node_1(y) r10: app(node_1(x1),y) -> node_2(x1,y) r11: map_2(f,nil_0()) -> nil_0() r12: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r13: flatten_1(node_2(x,xs)) -> cons_2(x,concat_1(map_2(flatten_0(),xs))) r14: concat_1(nil_0()) -> nil_0() r15: concat_1(cons_2(x,xs)) -> append_2(x,concat_1(xs)) r16: append_2(nil_0(),xs) -> xs r17: append_2(cons_2(x,xs),ys) -> cons_2(x,append_2(xs,ys)) 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: concat_1#_A(x1) = x1 cons_2_A(x1,x2) = x1 + x2 + 7 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: concat_1#_A(x1) = x1 cons_2_A(x1,x2) = x1 + x2 + 9 concat_1#!_A(x1) = x1 + 6 cons_2!_A(x1,x2) = x1 + x2 + 5 partial status: pi(concat_1#) = [1] 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(concat_0(),y) -> concat_1(y) r4: app(cons_0(),y) -> cons_1(y) r5: app(cons_1(x1),y) -> cons_2(x1,y) r6: app(flatten_0(),y) -> flatten_1(y) r7: app(map_0(),y) -> map_1(y) r8: app(map_1(x1),y) -> map_2(x1,y) r9: app(node_0(),y) -> node_1(y) r10: app(node_1(x1),y) -> node_2(x1,y) r11: map_2(f,nil_0()) -> nil_0() r12: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) r13: flatten_1(node_2(x,xs)) -> cons_2(x,concat_1(map_2(flatten_0(),xs))) r14: concat_1(nil_0()) -> nil_0() r15: concat_1(cons_2(x,xs)) -> append_2(x,concat_1(xs)) r16: append_2(nil_0(),xs) -> xs r17: append_2(cons_2(x,xs),ys) -> cons_2(x,append_2(xs,ys)) 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) = x2 + 5 cons_2_A(x1,x2) = x1 + 4 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): 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 + 5 append_2#!_A(x1,x2) = x1 + 6 cons_2!_A(x1,x2) = x1 + x2 + 5 partial status: pi(append_2#) = [2] pi(cons_2) = [] The following rules are removed: p1 Then no dependency pair remains.