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: 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) = max{1, x2 - 15} cons_2_A(x1,x2) = max{x1 + 14, x2} app#_A(x1,x2) = max{1, x2 - 1} map_1_A(x1) = max{2, x1 - 2} flatten_0_A = 0 flatten_1#_A(x1) = max{1, x1 - 42} node_2_A(x1,x2) = max{x1 + 40, x2 + 41} map_2#!_A(x1,x2) = 1 cons_2!_A(x1,x2) = max{x1 + 27, x2 + 8} app#!_A(x1,x2) = 1 map_1!_A(x1) = 2 flatten_0!_A = 2 flatten_1#!_A(x1) = 1 node_2!_A(x1,x2) = max{3, x1 - 3, x2 - 40} 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) = x1 + 1 cons_2!_A(x1,x2) = x1 + 5 app#!_A(x1,x2) = x1 + 1 map_1!_A(x1) = x1 + 2 flatten_0!_A() = 3 flatten_1#!_A(x1) = 2 node_2!_A(x1,x2) = 4 partial status: pi(map_2#) = [] pi(cons_2) = [1] pi(app#) = [] pi(map_1) = [1] pi(flatten_0) = [] pi(flatten_1#) = [] pi(node_2) = [1, 2] The following rules are removed: p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: map_2#(f,cons_2(x,xs)) -> app#(f,x) p2: map_2#(f,cons_2(x,xs)) -> map_2#(f,xs) p3: app#(flatten_0(),y) -> flatten_1#(y) p4: 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 estimated dependency graph contains the following SCCs: {p1, p2, p3, p4} -- 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#(flatten_0(),y) -> flatten_1#(y) p3: flatten_1#(node_2(x,xs)) -> map_2#(flatten_0(),xs) p4: map_2#(f,cons_2(x,xs)) -> map_2#(f,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: 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) = max{0, x1 - 1, x2 - 13} cons_2_A(x1,x2) = max{4, x1 - 2, x2 + 1} app#_A(x1,x2) = max{0, x1 - 1, x2 - 31} flatten_0_A = 0 flatten_1#_A(x1) = max{0, x1 - 31} node_2_A(x1,x2) = max{29, x1 + 4, x2 + 18} map_2#!_A(x1,x2) = max{x1 + 9, x2 - 5} cons_2!_A(x1,x2) = max{9, x2 - 11} app#!_A(x1,x2) = max{8, x1 - 1, x2 - 8} flatten_0!_A = 4 flatten_1#!_A(x1) = max{7, x1 - 19} node_2!_A(x1,x2) = max{5, x1 - 1, x2 + 3} 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 flatten_0_A() = 1 flatten_1#_A(x1) = x1 node_2_A(x1,x2) = x1 + x2 + 5 map_2#!_A(x1,x2) = x2 cons_2!_A(x1,x2) = x1 + x2 + 5 app#!_A(x1,x2) = x2 + 2 flatten_0!_A() = 0 flatten_1#!_A(x1) = x1 + 1 node_2!_A(x1,x2) = 1 partial status: pi(map_2#) = [] pi(cons_2) = [1] pi(app#) = [] pi(flatten_0) = [] pi(flatten_1#) = [] pi(node_2) = [1] The following rules are removed: p1, p2, p3, p4 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: 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: concat_1#_A(x1) = 0 cons_2_A(x1,x2) = max{2, x1 - 26, x2 - 27} concat_1#!_A(x1) = 10 cons_2!_A(x1,x2) = x1 + 16 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 + 5 concat_1#!_A(x1) = x1 + 11 cons_2!_A(x1,x2) = 10 partial status: pi(concat_1#) = [] pi(cons_2) = [1] 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: 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: append_2#_A(x1,x2) = 0 cons_2_A(x1,x2) = max{3, x2 - 8} append_2#!_A(x1,x2) = max{4, x2 + 1} cons_2!_A(x1,x2) = max{3, x2 - 8} 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 + 7 cons_2!_A(x1,x2) = x1 + x2 + 6 partial status: pi(append_2#) = [] pi(cons_2) = [1, 2] The following rules are removed: p1 Then no dependency pair remains.