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(app(append(),xs),nil()) -> xs app(app(append(),nil()),ys) -> ys app(app(append(),app(app(cons(),x),xs)),ys) -> app(app(cons(),x),app(app(append(),xs),ys)) app(app(zip(),nil()),yss) -> yss app(app(zip(),xss),nil()) -> xss app(app(zip(),app(app(cons(),xs),xss)),app(app(cons(),ys),yss)) -> app(app(cons(),app(app(append(),xs),ys)),app(app(zip(),xss),yss)) app(app(combine(),xs),nil()) -> xs app(app(combine(),xs),app(app(cons(),ys),yss)) -> app(app(combine(),app(app(zip(),xs),ys)),yss) app(levels(),app(app(node(),x),xs)) -> app(app(cons(),app(app(cons(),x),nil())),app(app(combine(),nil()),app(app(map(),levels()),xs))) -- 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#(app(append(),app(app(cons(),x),xs)),ys) -> app#(app(cons(),x),app(app(append(),xs),ys)) p6: app#(app(append(),app(app(cons(),x),xs)),ys) -> app#(app(append(),xs),ys) p7: app#(app(append(),app(app(cons(),x),xs)),ys) -> app#(append(),xs) p8: app#(app(zip(),app(app(cons(),xs),xss)),app(app(cons(),ys),yss)) -> app#(app(cons(),app(app(append(),xs),ys)),app(app(zip(),xss),yss)) p9: app#(app(zip(),app(app(cons(),xs),xss)),app(app(cons(),ys),yss)) -> app#(cons(),app(app(append(),xs),ys)) p10: app#(app(zip(),app(app(cons(),xs),xss)),app(app(cons(),ys),yss)) -> app#(app(append(),xs),ys) p11: app#(app(zip(),app(app(cons(),xs),xss)),app(app(cons(),ys),yss)) -> app#(append(),xs) p12: app#(app(zip(),app(app(cons(),xs),xss)),app(app(cons(),ys),yss)) -> app#(app(zip(),xss),yss) p13: app#(app(zip(),app(app(cons(),xs),xss)),app(app(cons(),ys),yss)) -> app#(zip(),xss) p14: app#(app(combine(),xs),app(app(cons(),ys),yss)) -> app#(app(combine(),app(app(zip(),xs),ys)),yss) p15: app#(app(combine(),xs),app(app(cons(),ys),yss)) -> app#(combine(),app(app(zip(),xs),ys)) p16: app#(app(combine(),xs),app(app(cons(),ys),yss)) -> app#(app(zip(),xs),ys) p17: app#(app(combine(),xs),app(app(cons(),ys),yss)) -> app#(zip(),xs) p18: app#(levels(),app(app(node(),x),xs)) -> app#(app(cons(),app(app(cons(),x),nil())),app(app(combine(),nil()),app(app(map(),levels()),xs))) p19: app#(levels(),app(app(node(),x),xs)) -> app#(cons(),app(app(cons(),x),nil())) p20: app#(levels(),app(app(node(),x),xs)) -> app#(app(cons(),x),nil()) p21: app#(levels(),app(app(node(),x),xs)) -> app#(cons(),x) p22: app#(levels(),app(app(node(),x),xs)) -> app#(app(combine(),nil()),app(app(map(),levels()),xs)) p23: app#(levels(),app(app(node(),x),xs)) -> app#(combine(),nil()) p24: app#(levels(),app(app(node(),x),xs)) -> app#(app(map(),levels()),xs) p25: app#(levels(),app(app(node(),x),xs)) -> app#(map(),levels()) 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(app(append(),xs),nil()) -> xs r4: app(app(append(),nil()),ys) -> ys r5: app(app(append(),app(app(cons(),x),xs)),ys) -> app(app(cons(),x),app(app(append(),xs),ys)) r6: app(app(zip(),nil()),yss) -> yss r7: app(app(zip(),xss),nil()) -> xss r8: app(app(zip(),app(app(cons(),xs),xss)),app(app(cons(),ys),yss)) -> app(app(cons(),app(app(append(),xs),ys)),app(app(zip(),xss),yss)) r9: app(app(combine(),xs),nil()) -> xs r10: app(app(combine(),xs),app(app(cons(),ys),yss)) -> app(app(combine(),app(app(zip(),xs),ys)),yss) r11: app(levels(),app(app(node(),x),xs)) -> app(app(cons(),app(app(cons(),x),nil())),app(app(combine(),nil()),app(app(map(),levels()),xs))) The estimated dependency graph contains the following SCCs: {p3, p4, p24} {p14} {p12} {p6} -- 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#(levels(),app(app(node(),x),xs)) -> app#(app(map(),levels()),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(app(append(),xs),nil()) -> xs r4: app(app(append(),nil()),ys) -> ys r5: app(app(append(),app(app(cons(),x),xs)),ys) -> app(app(cons(),x),app(app(append(),xs),ys)) r6: app(app(zip(),nil()),yss) -> yss r7: app(app(zip(),xss),nil()) -> xss r8: app(app(zip(),app(app(cons(),xs),xss)),app(app(cons(),ys),yss)) -> app(app(cons(),app(app(append(),xs),ys)),app(app(zip(),xss),yss)) r9: app(app(combine(),xs),nil()) -> xs r10: app(app(combine(),xs),app(app(cons(),ys),yss)) -> app(app(combine(),app(app(zip(),xs),ys)),yss) r11: app(levels(),app(app(node(),x),xs)) -> app(app(cons(),app(app(cons(),x),nil())),app(app(combine(),nil()),app(app(map(),levels()),xs))) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: app#_A(x1,x2) = max{20, x1, x2 + 10} app_A(x1,x2) = max{22, x1 + 3, x2 + 16} map_A = 21 cons_A = 22 levels_A = 9 node_A = 7 precedence: app = map = cons > levels = node > app# partial status: pi(app#) = [1, 2] pi(app) = [1, 2] pi(map) = [] pi(cons) = [] pi(levels) = [] pi(node) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: app#_A(x1,x2) = max{x1 + 10, x2 + 8} app_A(x1,x2) = max{5, x1, x2} map_A = 1 cons_A = 4 levels_A = 2 node_A = 6 precedence: app# = app > map = cons > levels = node partial status: pi(app#) = [1] pi(app) = [1, 2] pi(map) = [] pi(cons) = [] pi(levels) = [] pi(node) = [] The next rules are strictly ordered: p1, 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#(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(app(append(),xs),nil()) -> xs r4: app(app(append(),nil()),ys) -> ys r5: app(app(append(),app(app(cons(),x),xs)),ys) -> app(app(cons(),x),app(app(append(),xs),ys)) r6: app(app(zip(),nil()),yss) -> yss r7: app(app(zip(),xss),nil()) -> xss r8: app(app(zip(),app(app(cons(),xs),xss)),app(app(cons(),ys),yss)) -> app(app(cons(),app(app(append(),xs),ys)),app(app(zip(),xss),yss)) r9: app(app(combine(),xs),nil()) -> xs r10: app(app(combine(),xs),app(app(cons(),ys),yss)) -> app(app(combine(),app(app(zip(),xs),ys)),yss) r11: app(levels(),app(app(node(),x),xs)) -> app(app(cons(),app(app(cons(),x),nil())),app(app(combine(),nil()),app(app(map(),levels()),xs))) 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#(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(app(append(),xs),nil()) -> xs r4: app(app(append(),nil()),ys) -> ys r5: app(app(append(),app(app(cons(),x),xs)),ys) -> app(app(cons(),x),app(app(append(),xs),ys)) r6: app(app(zip(),nil()),yss) -> yss r7: app(app(zip(),xss),nil()) -> xss r8: app(app(zip(),app(app(cons(),xs),xss)),app(app(cons(),ys),yss)) -> app(app(cons(),app(app(append(),xs),ys)),app(app(zip(),xss),yss)) r9: app(app(combine(),xs),nil()) -> xs r10: app(app(combine(),xs),app(app(cons(),ys),yss)) -> app(app(combine(),app(app(zip(),xs),ys)),yss) r11: app(levels(),app(app(node(),x),xs)) -> app(app(cons(),app(app(cons(),x),nil())),app(app(combine(),nil()),app(app(map(),levels()),xs))) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: app#_A(x1,x2) = max{0, x2 - 4} app_A(x1,x2) = max{x1 + 6, x2 + 3} map_A = 2 cons_A = 3 precedence: app# = app = map = cons partial status: pi(app#) = [] pi(app) = [1, 2] pi(map) = [] pi(cons) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: app#_A(x1,x2) = 0 app_A(x1,x2) = max{x1 + 2, x2 + 6} map_A = 3 cons_A = 4 precedence: app# = app = map = cons partial status: pi(app#) = [] pi(app) = [1, 2] 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#(app(combine(),xs),app(app(cons(),ys),yss)) -> app#(app(combine(),app(app(zip(),xs),ys)),yss) 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(app(append(),xs),nil()) -> xs r4: app(app(append(),nil()),ys) -> ys r5: app(app(append(),app(app(cons(),x),xs)),ys) -> app(app(cons(),x),app(app(append(),xs),ys)) r6: app(app(zip(),nil()),yss) -> yss r7: app(app(zip(),xss),nil()) -> xss r8: app(app(zip(),app(app(cons(),xs),xss)),app(app(cons(),ys),yss)) -> app(app(cons(),app(app(append(),xs),ys)),app(app(zip(),xss),yss)) r9: app(app(combine(),xs),nil()) -> xs r10: app(app(combine(),xs),app(app(cons(),ys),yss)) -> app(app(combine(),app(app(zip(),xs),ys)),yss) r11: app(levels(),app(app(node(),x),xs)) -> app(app(cons(),app(app(cons(),x),nil())),app(app(combine(),nil()),app(app(map(),levels()),xs))) The set of usable rules consists of r3, r4, r5, r6, r7, r8 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) = ((0,0),(1,0)) x1 + ((1,0),(1,0)) x2 + (10,1) app_A(x1,x2) = x1 + x2 + (3,3) combine_A() = (2,4) cons_A() = (3,6) zip_A() = (1,5) append_A() = (2,4) nil_A() = (1,0) precedence: app# = cons > app = combine = zip = append > nil partial status: pi(app#) = [] pi(app) = [1, 2] pi(combine) = [] pi(cons) = [] pi(zip) = [] pi(append) = [] pi(nil) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = (9,9) app_A(x1,x2) = x1 + (4,4) combine_A() = (0,0) cons_A() = (6,6) zip_A() = (0,0) append_A() = (3,3) nil_A() = (1,0) precedence: combine = cons = zip > app# > app = append = nil partial status: pi(app#) = [] pi(app) = [1] pi(combine) = [] pi(cons) = [] pi(zip) = [] pi(append) = [] pi(nil) = [] 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(zip(),app(app(cons(),xs),xss)),app(app(cons(),ys),yss)) -> app#(app(zip(),xss),yss) 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(app(append(),xs),nil()) -> xs r4: app(app(append(),nil()),ys) -> ys r5: app(app(append(),app(app(cons(),x),xs)),ys) -> app(app(cons(),x),app(app(append(),xs),ys)) r6: app(app(zip(),nil()),yss) -> yss r7: app(app(zip(),xss),nil()) -> xss r8: app(app(zip(),app(app(cons(),xs),xss)),app(app(cons(),ys),yss)) -> app(app(cons(),app(app(append(),xs),ys)),app(app(zip(),xss),yss)) r9: app(app(combine(),xs),nil()) -> xs r10: app(app(combine(),xs),app(app(cons(),ys),yss)) -> app(app(combine(),app(app(zip(),xs),ys)),yss) r11: app(levels(),app(app(node(),x),xs)) -> app(app(cons(),app(app(cons(),x),nil())),app(app(combine(),nil()),app(app(map(),levels()),xs))) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: app#_A(x1,x2) = max{x1 + 4, x2 + 8} app_A(x1,x2) = max{x1 + 2, x2 + 4} zip_A = 2 cons_A = 3 precedence: app# = app = zip = cons partial status: pi(app#) = [1, 2] pi(app) = [1, 2] pi(zip) = [] pi(cons) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: app#_A(x1,x2) = max{0, x1 - 15, x2 - 8} app_A(x1,x2) = max{x1 + 5, x2 + 7} zip_A = 2 cons_A = 1 precedence: app# = app = zip = cons partial status: pi(app#) = [] pi(app) = [2] pi(zip) = [] 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(app(append(),xs),nil()) -> xs r4: app(app(append(),nil()),ys) -> ys r5: app(app(append(),app(app(cons(),x),xs)),ys) -> app(app(cons(),x),app(app(append(),xs),ys)) r6: app(app(zip(),nil()),yss) -> yss r7: app(app(zip(),xss),nil()) -> xss r8: app(app(zip(),app(app(cons(),xs),xss)),app(app(cons(),ys),yss)) -> app(app(cons(),app(app(append(),xs),ys)),app(app(zip(),xss),yss)) r9: app(app(combine(),xs),nil()) -> xs r10: app(app(combine(),xs),app(app(cons(),ys),yss)) -> app(app(combine(),app(app(zip(),xs),ys)),yss) r11: app(levels(),app(app(node(),x),xs)) -> app(app(cons(),app(app(cons(),x),nil())),app(app(combine(),nil()),app(app(map(),levels()),xs))) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: app#_A(x1,x2) = max{x1 + 4, x2 + 5} app_A(x1,x2) = max{x1 + 2, x2 + 4} append_A = 2 cons_A = 3 precedence: app = append > app# = cons partial status: pi(app#) = [1, 2] pi(app) = [1, 2] pi(append) = [] pi(cons) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: app#_A(x1,x2) = max{x1 - 15, x2 + 3} app_A(x1,x2) = max{x1 + 4, x2 + 7} append_A = 2 cons_A = 3 precedence: app# = app = append = cons partial status: pi(app#) = [] pi(app) = [1, 2] pi(append) = [] pi(cons) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.