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