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