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 r1, r4, r7, r9, r16, r17 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: map_2#_A(x1,x2) = x1 + x2 + 19 cons_2_A(x1,x2) = x1 + x2 + 7 app#_A(x1,x2) = x1 + x2 + 18 map_1_A(x1) = x1 + 2 flatten_0_A() = 3 flatten_1#_A(x1) = x1 + 2 node_2_A(x1,x2) = x1 + x2 + 21 app_A(x1,x2) = x2 + 3 append_0_A() = 3 append_1_A(x1) = 2 cons_0_A() = 2 cons_1_A(x1) = 1 map_0_A() = 1 node_0_A() = 2 node_1_A(x1) = 1 append_2_A(x1,x2) = x1 + x2 + 4 nil_0_A() = 1 base order 2: precedence: app# > flatten_1# > map_2# = append_2 > cons_2 = app = append_0 > append_1 > cons_0 > map_1 = node_2 = cons_1 = node_0 = nil_0 > flatten_0 = map_0 = node_1 partial status: pi(map_2#) = [2] pi(cons_2) = [1] pi(app#) = [2] pi(map_1) = [1] pi(flatten_0) = [] pi(flatten_1#) = [1] pi(node_2) = [2] pi(app) = [2] pi(append_0) = [] pi(append_1) = [] pi(cons_0) = [] pi(cons_1) = [] pi(map_0) = [] pi(node_0) = [] pi(node_1) = [] pi(append_2) = [] pi(nil_0) = [] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(map_1(x1),y) -> map_2#(x1,y) 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: {p2} -- 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(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 r1, r4, r7, r9, r16, r17 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: map_2#_A(x1,x2) = x1 + x2 cons_2_A(x1,x2) = x1 + x2 + 5 app_A(x1,x2) = x2 + 7 append_0_A() = 2 append_1_A(x1) = 1 cons_0_A() = 7 cons_1_A(x1) = 6 map_0_A() = 5 map_1_A(x1) = 4 node_0_A() = 2 node_1_A(x1) = 1 append_2_A(x1,x2) = x1 + x2 + 2 nil_0_A() = 1 base order 2: precedence: map_2# = append_2 > cons_2 = node_0 > nil_0 > node_1 > app = append_0 = cons_0 = map_0 > append_1 = cons_1 = map_1 partial status: pi(map_2#) = [] pi(cons_2) = [2] pi(app) = [2] pi(append_0) = [] pi(append_1) = [] pi(cons_0) = [] pi(cons_1) = [] pi(map_0) = [] pi(map_1) = [] pi(node_0) = [] pi(node_1) = [] pi(append_2) = [] 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: 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 r1, r4, r7, r9, r16, r17 Take the reduction pair: generalized weighted path order (>=MG, >MG) 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 + 6 app_A(x1,x2) = x2 + 5 append_0_A() = 1 append_1_A(x1) = x1 + 2 cons_0_A() = 5 cons_1_A(x1) = 4 map_0_A() = 2 map_1_A(x1) = 1 node_0_A() = 2 node_1_A(x1) = 1 append_2_A(x1,x2) = x1 + x2 + 3 nil_0_A() = 1 base order 2: precedence: cons_0 > cons_1 > cons_2 = map_0 = append_2 > concat_1# > app = node_0 = nil_0 > append_1 = map_1 = node_1 > append_0 partial status: pi(concat_1#) = [] pi(cons_2) = [1] pi(app) = [] pi(append_0) = [] pi(append_1) = [1] pi(cons_0) = [] pi(cons_1) = [] pi(map_0) = [] pi(map_1) = [] pi(node_0) = [] pi(node_1) = [] 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: 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 r1, r7, r9, r16 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: append_2#_A(x1,x2) = x1 + x2 + 6 cons_2_A(x1,x2) = x1 + x2 + 5 app_A(x1,x2) = x2 + 3 append_0_A() = 2 append_1_A(x1) = 1 map_0_A() = 2 map_1_A(x1) = 1 node_0_A() = 3 node_1_A(x1) = 2 append_2_A(x1,x2) = x1 + x2 + 2 nil_0_A() = 1 base order 2: precedence: append_2# > cons_2 = app = node_0 > append_0 = node_1 = append_2 > append_1 = map_0 > map_1 = nil_0 partial status: pi(append_2#) = [1, 2] pi(cons_2) = [] pi(app) = [2] pi(append_0) = [] pi(append_1) = [] pi(map_0) = [] pi(map_1) = [] pi(node_0) = [] pi(node_1) = [] pi(append_2) = [2] pi(nil_0) = [] The following rules are removed: p1 Then no dependency pair remains.