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)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(app(cons(),app(f,x)),app(app(map(),f),xs)) p2: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(cons(),app(f,x)) p3: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(f,x) p4: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(app(map(),f),xs) p5: app#(flatten(),app(app(node(),x),xs)) -> app#(app(cons(),x),app(concat(),app(app(map(),flatten()),xs))) p6: app#(flatten(),app(app(node(),x),xs)) -> app#(cons(),x) p7: app#(flatten(),app(app(node(),x),xs)) -> app#(concat(),app(app(map(),flatten()),xs)) p8: app#(flatten(),app(app(node(),x),xs)) -> app#(app(map(),flatten()),xs) p9: app#(flatten(),app(app(node(),x),xs)) -> app#(map(),flatten()) p10: app#(concat(),app(app(cons(),x),xs)) -> app#(app(append(),x),app(concat(),xs)) p11: app#(concat(),app(app(cons(),x),xs)) -> app#(append(),x) p12: app#(concat(),app(app(cons(),x),xs)) -> app#(concat(),xs) p13: app#(app(append(),app(app(cons(),x),xs)),ys) -> app#(app(cons(),x),app(app(append(),xs),ys)) p14: app#(app(append(),app(app(cons(),x),xs)),ys) -> app#(app(append(),xs),ys) p15: app#(app(append(),app(app(cons(),x),xs)),ys) -> app#(append(),xs) and R consists of: r1: app(app(map(),f),nil()) -> nil() r2: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs)) r3: app(flatten(),app(app(node(),x),xs)) -> app(app(cons(),x),app(concat(),app(app(map(),flatten()),xs))) r4: app(concat(),nil()) -> nil() r5: app(concat(),app(app(cons(),x),xs)) -> app(app(append(),x),app(concat(),xs)) r6: app(app(append(),nil()),xs) -> xs r7: app(app(append(),app(app(cons(),x),xs)),ys) -> app(app(cons(),x),app(app(append(),xs),ys)) The estimated dependency graph contains the following SCCs: {p3, p4, p8} {p12} {p14} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(f,x) p2: app#(flatten(),app(app(node(),x),xs)) -> app#(app(map(),flatten()),xs) p3: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(app(map(),f),xs) and R consists of: r1: app(app(map(),f),nil()) -> nil() r2: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs)) r3: app(flatten(),app(app(node(),x),xs)) -> app(app(cons(),x),app(concat(),app(app(map(),flatten()),xs))) r4: app(concat(),nil()) -> nil() r5: app(concat(),app(app(cons(),x),xs)) -> app(app(append(),x),app(concat(),xs)) r6: app(app(append(),nil()),xs) -> xs r7: app(app(append(),app(app(cons(),x),xs)),ys) -> app(app(cons(),x),app(app(append(),xs),ys)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. max/plus interpretations on natural numbers: app#_A(x1,x2) = x2 + 2 app_A(x1,x2) = max{x1 + 1, x2} map_A = 0 cons_A = 0 flatten_A = 3 node_A = 0 2. max/plus interpretations on natural numbers: app#_A(x1,x2) = 0 app_A(x1,x2) = 0 map_A = 0 cons_A = 0 flatten_A = 0 node_A = 0 The next rules are strictly ordered: p1 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(flatten(),app(app(node(),x),xs)) -> app#(app(map(),flatten()),xs) p2: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(app(map(),f),xs) and R consists of: r1: app(app(map(),f),nil()) -> nil() r2: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs)) r3: app(flatten(),app(app(node(),x),xs)) -> app(app(cons(),x),app(concat(),app(app(map(),flatten()),xs))) r4: app(concat(),nil()) -> nil() r5: app(concat(),app(app(cons(),x),xs)) -> app(app(append(),x),app(concat(),xs)) r6: app(app(append(),nil()),xs) -> xs r7: app(app(append(),app(app(cons(),x),xs)),ys) -> app(app(cons(),x),app(app(append(),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: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(app(map(),f),xs) and R consists of: r1: app(app(map(),f),nil()) -> nil() r2: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs)) r3: app(flatten(),app(app(node(),x),xs)) -> app(app(cons(),x),app(concat(),app(app(map(),flatten()),xs))) r4: app(concat(),nil()) -> nil() r5: app(concat(),app(app(cons(),x),xs)) -> app(app(append(),x),app(concat(),xs)) r6: app(app(append(),nil()),xs) -> xs r7: app(app(append(),app(app(cons(),x),xs)),ys) -> app(app(cons(),x),app(app(append(),xs),ys)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. max/plus interpretations on natural numbers: app#_A(x1,x2) = x2 + 2 app_A(x1,x2) = max{x1, x2 + 3} map_A = 0 cons_A = 1 2. max/plus interpretations on natural numbers: app#_A(x1,x2) = 0 app_A(x1,x2) = 0 map_A = 0 cons_A = 0 The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(concat(),app(app(cons(),x),xs)) -> app#(concat(),xs) and R consists of: r1: app(app(map(),f),nil()) -> nil() r2: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs)) r3: app(flatten(),app(app(node(),x),xs)) -> app(app(cons(),x),app(concat(),app(app(map(),flatten()),xs))) r4: app(concat(),nil()) -> nil() r5: app(concat(),app(app(cons(),x),xs)) -> app(app(append(),x),app(concat(),xs)) r6: app(app(append(),nil()),xs) -> xs r7: app(app(append(),app(app(cons(),x),xs)),ys) -> app(app(cons(),x),app(app(append(),xs),ys)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. max/plus interpretations on natural numbers: app#_A(x1,x2) = max{x1, x2 + 1} concat_A = 0 app_A(x1,x2) = max{x1, x2 + 1} cons_A = 1 2. max/plus interpretations on natural numbers: app#_A(x1,x2) = 0 concat_A = 0 app_A(x1,x2) = 0 cons_A = 0 The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(append(),app(app(cons(),x),xs)),ys) -> app#(app(append(),xs),ys) and R consists of: r1: app(app(map(),f),nil()) -> nil() r2: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs)) r3: app(flatten(),app(app(node(),x),xs)) -> app(app(cons(),x),app(concat(),app(app(map(),flatten()),xs))) r4: app(concat(),nil()) -> nil() r5: app(concat(),app(app(cons(),x),xs)) -> app(app(append(),x),app(concat(),xs)) r6: app(app(append(),nil()),xs) -> xs r7: app(app(append(),app(app(cons(),x),xs)),ys) -> app(app(cons(),x),app(app(append(),xs),ys)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. max/plus interpretations on natural numbers: app#_A(x1,x2) = max{0, x1 - 3} app_A(x1,x2) = max{x1, x2 + 2} append_A = 1 cons_A = 2 2. max/plus interpretations on natural numbers: app#_A(x1,x2) = 0 app_A(x1,x2) = 0 append_A = 0 cons_A = 0 The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.