YES We show the termination of the TRS R: app(id(),x) -> x app(add(),|0|()) -> id() app(app(add(),app(s(),x)),y) -> app(s(),app(app(add(),x),y)) 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)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(add(),app(s(),x)),y) -> app#(s(),app(app(add(),x),y)) p2: app#(app(add(),app(s(),x)),y) -> app#(app(add(),x),y) p3: app#(app(add(),app(s(),x)),y) -> app#(add(),x) p4: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(app(cons(),app(f,x)),app(app(map(),f),xs)) p5: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(cons(),app(f,x)) p6: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(f,x) p7: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(app(map(),f),xs) and R consists of: r1: app(id(),x) -> x r2: app(add(),|0|()) -> id() r3: app(app(add(),app(s(),x)),y) -> app(s(),app(app(add(),x),y)) r4: app(app(map(),f),nil()) -> nil() r5: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs)) The estimated dependency graph contains the following SCCs: {p2, p6, p7} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(add(),app(s(),x)),y) -> app#(app(add(),x),y) p2: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(app(map(),f),xs) p3: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(f,x) and R consists of: r1: app(id(),x) -> x r2: app(add(),|0|()) -> id() r3: app(app(add(),app(s(),x)),y) -> app(s(),app(app(add(),x),y)) r4: app(app(map(),f),nil()) -> nil() r5: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs)) The set of usable rules consists of r2 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 + (8,5) app_A(x1,x2) = x1 + x2 + (2,2) add_A() = (1,6) s_A() = (2,7) map_A() = (5,1) cons_A() = (9,4) |0|_A() = (1,1) id_A() = (0,0) precedence: app# > s > app = add > map > cons = |0| = id partial status: pi(app#) = [] pi(app) = [2] pi(add) = [] pi(s) = [] pi(map) = [] pi(cons) = [] pi(|0|) = [] pi(id) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = (0,0) app_A(x1,x2) = (0,0) add_A() = (1,1) s_A() = (2,2) map_A() = (1,1) cons_A() = (2,2) |0|_A() = (3,3) id_A() = (2,2) precedence: id > s > map > cons > |0| > app# = app = add partial status: pi(app#) = [] pi(app) = [] pi(add) = [] pi(s) = [] pi(map) = [] pi(cons) = [] pi(|0|) = [] pi(id) = [] 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(add(),app(s(),x)),y) -> app#(app(add(),x),y) p2: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(f,x) and R consists of: r1: app(id(),x) -> x r2: app(add(),|0|()) -> id() r3: app(app(add(),app(s(),x)),y) -> app(s(),app(app(add(),x),y)) r4: app(app(map(),f),nil()) -> nil() r5: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs)) 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(add(),app(s(),x)),y) -> app#(app(add(),x),y) p2: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(f,x) and R consists of: r1: app(id(),x) -> x r2: app(add(),|0|()) -> id() r3: app(app(add(),app(s(),x)),y) -> app(s(),app(app(add(),x),y)) r4: app(app(map(),f),nil()) -> nil() r5: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs)) The set of usable rules consists of r2 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) = ((1,0),(0,0)) x1 + (3,3) app_A(x1,x2) = x2 + (2,1) add_A() = (3,4) s_A() = (4,5) map_A() = (1,1) cons_A() = (1,4) |0|_A() = (1,1) id_A() = (0,0) precedence: app# = app > add = s = map = cons = id > |0| partial status: pi(app#) = [] pi(app) = [] pi(add) = [] pi(s) = [] pi(map) = [] pi(cons) = [] pi(|0|) = [] pi(id) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = (3,4) app_A(x1,x2) = (0,3) add_A() = (1,1) s_A() = (2,2) map_A() = (1,1) cons_A() = (1,1) |0|_A() = (1,3) id_A() = (0,2) precedence: cons > add = s = id > app# = map > app = |0| partial status: pi(app#) = [] pi(app) = [] pi(add) = [] pi(s) = [] pi(map) = [] pi(cons) = [] pi(|0|) = [] pi(id) = [] 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#(app(map(),f),app(app(cons(),x),xs)) -> app#(f,x) and R consists of: r1: app(id(),x) -> x r2: app(add(),|0|()) -> id() r3: app(app(add(),app(s(),x)),y) -> app(s(),app(app(add(),x),y)) r4: app(app(map(),f),nil()) -> nil() r5: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),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#(f,x) and R consists of: r1: app(id(),x) -> x r2: app(add(),|0|()) -> id() r3: app(app(add(),app(s(),x)),y) -> app(s(),app(app(add(),x),y)) r4: app(app(map(),f),nil()) -> nil() r5: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),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: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = ((1,0),(1,1)) x1 + (4,4) app_A(x1,x2) = x1 + ((1,0),(1,1)) x2 + (2,2) map_A() = (5,1) cons_A() = (1,1) precedence: app# = app = map = cons partial status: pi(app#) = [] pi(app) = [] pi(map) = [] pi(cons) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = (1,2) app_A(x1,x2) = ((1,0),(0,0)) x1 + ((1,0),(0,0)) x2 + (1,3) map_A() = (2,1) cons_A() = (2,3) 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.