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)) Instead we prove termination of the uncurried system: app(add_0(),y) -> add_1(y) app(add_1(x1),y) -> add_2(x1,y) app(cons_0(),y) -> cons_1(y) app(cons_1(x1),y) -> cons_2(x1,y) app(id_0(),y) -> id_1(y) app(map_0(),y) -> map_1(y) app(map_1(x1),y) -> map_2(x1,y) app(s_0(),y) -> s_1(y) id_1(x) -> x add_1(|0|_0()) -> id_0() add_2(|0|_0(),y1) -> id_1(y1) add_2(s_1(x),y) -> s_1(add_2(x,y)) map_2(f,nil_0()) -> nil_0() map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(add_0(),y) -> add_1#(y) p2: app#(add_1(x1),y) -> add_2#(x1,y) p3: app#(id_0(),y) -> id_1#(y) p4: app#(map_1(x1),y) -> map_2#(x1,y) p5: add_2#(|0|_0(),y1) -> id_1#(y1) p6: add_2#(s_1(x),y) -> add_2#(x,y) p7: map_2#(f,cons_2(x,xs)) -> app#(f,x) p8: map_2#(f,cons_2(x,xs)) -> map_2#(f,xs) and R consists of: r1: app(add_0(),y) -> add_1(y) r2: app(add_1(x1),y) -> add_2(x1,y) r3: app(cons_0(),y) -> cons_1(y) r4: app(cons_1(x1),y) -> cons_2(x1,y) r5: app(id_0(),y) -> id_1(y) r6: app(map_0(),y) -> map_1(y) r7: app(map_1(x1),y) -> map_2(x1,y) r8: app(s_0(),y) -> s_1(y) r9: id_1(x) -> x r10: add_1(|0|_0()) -> id_0() r11: add_2(|0|_0(),y1) -> id_1(y1) r12: add_2(s_1(x),y) -> s_1(add_2(x,y)) r13: map_2(f,nil_0()) -> nil_0() r14: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) The estimated dependency graph contains the following SCCs: {p4, p7, p8} {p6} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: map_2#(f,cons_2(x,xs)) -> app#(f,x) p2: app#(map_1(x1),y) -> map_2#(x1,y) p3: map_2#(f,cons_2(x,xs)) -> map_2#(f,xs) and R consists of: r1: app(add_0(),y) -> add_1(y) r2: app(add_1(x1),y) -> add_2(x1,y) r3: app(cons_0(),y) -> cons_1(y) r4: app(cons_1(x1),y) -> cons_2(x1,y) r5: app(id_0(),y) -> id_1(y) r6: app(map_0(),y) -> map_1(y) r7: app(map_1(x1),y) -> map_2(x1,y) r8: app(s_0(),y) -> s_1(y) r9: id_1(x) -> x r10: add_1(|0|_0()) -> id_0() r11: add_2(|0|_0(),y1) -> id_1(y1) r12: add_2(s_1(x),y) -> s_1(add_2(x,y)) r13: map_2(f,nil_0()) -> nil_0() r14: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) The set of usable rules consists of r3, r4, r8 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: map_2#_A(x1,x2) = x1 + 5 cons_2_A(x1,x2) = max{2, x1 - 23, x2 - 23} app#_A(x1,x2) = max{4, x1 - 1} map_1_A(x1) = max{10, x1 + 7} app_A(x1,x2) = max{13, x1 - 8, x2 - 13} cons_0_A = 10 cons_1_A(x1) = max{1, x1 - 14} s_0_A = 7 s_1_A(x1) = max{9, x1 - 24} base order 2: precedence: map_1 > map_2# = app > app# > cons_2 = s_1 > cons_1 = s_0 > cons_0 partial status: pi(map_2#) = [1] pi(cons_2) = [] pi(app#) = [] pi(map_1) = [1] pi(app) = [] pi(cons_0) = [] pi(cons_1) = [] pi(s_0) = [] pi(s_1) = [] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(map_1(x1),y) -> map_2#(x1,y) p2: map_2#(f,cons_2(x,xs)) -> map_2#(f,xs) and R consists of: r1: app(add_0(),y) -> add_1(y) r2: app(add_1(x1),y) -> add_2(x1,y) r3: app(cons_0(),y) -> cons_1(y) r4: app(cons_1(x1),y) -> cons_2(x1,y) r5: app(id_0(),y) -> id_1(y) r6: app(map_0(),y) -> map_1(y) r7: app(map_1(x1),y) -> map_2(x1,y) r8: app(s_0(),y) -> s_1(y) r9: id_1(x) -> x r10: add_1(|0|_0()) -> id_0() r11: add_2(|0|_0(),y1) -> id_1(y1) r12: add_2(s_1(x),y) -> s_1(add_2(x,y)) r13: map_2(f,nil_0()) -> nil_0() r14: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) The estimated dependency graph contains the following SCCs: {p2} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: map_2#(f,cons_2(x,xs)) -> map_2#(f,xs) and R consists of: r1: app(add_0(),y) -> add_1(y) r2: app(add_1(x1),y) -> add_2(x1,y) r3: app(cons_0(),y) -> cons_1(y) r4: app(cons_1(x1),y) -> cons_2(x1,y) r5: app(id_0(),y) -> id_1(y) r6: app(map_0(),y) -> map_1(y) r7: app(map_1(x1),y) -> map_2(x1,y) r8: app(s_0(),y) -> s_1(y) r9: id_1(x) -> x r10: add_1(|0|_0()) -> id_0() r11: add_2(|0|_0(),y1) -> id_1(y1) r12: add_2(s_1(x),y) -> s_1(add_2(x,y)) r13: map_2(f,nil_0()) -> nil_0() r14: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: map_2#_A(x1,x2) = max{4, x2 + 3} cons_2_A(x1,x2) = max{x1 + 3, x2 + 5} base order 2: precedence: cons_2 > map_2# partial status: pi(map_2#) = [2] pi(cons_2) = [] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: add_2#(s_1(x),y) -> add_2#(x,y) and R consists of: r1: app(add_0(),y) -> add_1(y) r2: app(add_1(x1),y) -> add_2(x1,y) r3: app(cons_0(),y) -> cons_1(y) r4: app(cons_1(x1),y) -> cons_2(x1,y) r5: app(id_0(),y) -> id_1(y) r6: app(map_0(),y) -> map_1(y) r7: app(map_1(x1),y) -> map_2(x1,y) r8: app(s_0(),y) -> s_1(y) r9: id_1(x) -> x r10: add_1(|0|_0()) -> id_0() r11: add_2(|0|_0(),y1) -> id_1(y1) r12: add_2(s_1(x),y) -> s_1(add_2(x,y)) r13: map_2(f,nil_0()) -> nil_0() r14: map_2(f,cons_2(x,xs)) -> cons_2(app(f,x),map_2(f,xs)) The set of usable rules consists of r1, r3, r4, r5, r8, r9, r10, r13 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: add_2#_A(x1,x2) = max{x1 + 4, x2 + 9} s_1_A(x1) = max{7, x1 + 5} app_A(x1,x2) = max{15, x1 - 18, x2 + 6} add_0_A = 14 add_1_A(x1) = max{15, x1 - 7} cons_0_A = 17 cons_1_A(x1) = max{7, x1 - 1} cons_2_A(x1,x2) = max{8, x1 - 20, x2 - 28} id_0_A = 5 id_1_A(x1) = max{7, x1 + 1} s_0_A = 6 |0|_0_A = 6 map_2_A(x1,x2) = max{15, x1 - 38, x2 + 6} nil_0_A = 16 base order 2: precedence: add_2# = app > s_1 = add_1 = id_1 = map_2 > add_0 = cons_2 = s_0 = |0|_0 = nil_0 > cons_1 = id_0 > cons_0 partial status: pi(add_2#) = [1] pi(s_1) = [1] pi(app) = [] pi(add_0) = [] pi(add_1) = [] pi(cons_0) = [] pi(cons_1) = [] pi(cons_2) = [] pi(id_0) = [] pi(id_1) = [] pi(s_0) = [] pi(|0|_0) = [] pi(map_2) = [2] pi(nil_0) = [] The following rules are removed: p1 Then no dependency pair remains.