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. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = x2 + (11,6) app_A(x1,x2) = ((1,0),(1,0)) x1 + x2 + (3,2) map_A() = (1,4) cons_A() = (12,5) flatten_A() = (8,5) node_A() = (7,7) precedence: app# = app = map = cons = flatten = node partial status: pi(app#) = [] pi(app) = [] pi(map) = [] pi(cons) = [] pi(flatten) = [] pi(node) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = x2 + (5,6) app_A(x1,x2) = x2 + (6,4) map_A() = (3,3) cons_A() = (4,5) flatten_A() = (1,1) node_A() = (2,2) precedence: app = map = flatten > app# > cons = node partial status: pi(app#) = [2] pi(app) = [] pi(map) = [] pi(cons) = [] pi(flatten) = [] pi(node) = [] The next rules are strictly ordered: p1, p2, p3 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. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = x1 + ((0,0),(1,0)) x2 + (1,1) concat_A() = (1,1) app_A(x1,x2) = ((1,0),(0,0)) x1 + ((1,0),(1,1)) x2 + (1,3) cons_A() = (3,3) precedence: cons > app# > concat = app partial status: pi(app#) = [1] pi(concat) = [] pi(app) = [2] pi(cons) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = (0,0) concat_A() = (1,1) app_A(x1,x2) = (2,2) cons_A() = (2,2) precedence: app = cons > app# = concat partial status: pi(app#) = [] pi(concat) = [] pi(app) = [] pi(cons) = [] 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. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = x1 + x2 + (3,3) app_A(x1,x2) = x2 + (2,2) append_A() = (1,1) cons_A() = (3,6) precedence: app# = app = append = cons partial status: pi(app#) = [] pi(app) = [] pi(append) = [] pi(cons) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = ((0,0),(1,0)) x1 + x2 + (7,1) app_A(x1,x2) = ((1,0),(0,0)) x2 + (3,3) append_A() = (1,1) cons_A() = (2,2) precedence: app = append > app# = cons partial status: pi(app#) = [2] pi(app) = [] pi(append) = [] pi(cons) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.