YES We show the termination of the TRS R: app(app(app(compose(),f),g),x) -> app(g,app(f,x)) app(reverse(),l) -> app(app(reverse2(),l),nil()) app(app(reverse2(),nil()),l) -> l app(app(reverse2(),app(app(cons(),x),xs)),l) -> app(app(reverse2(),xs),app(app(cons(),x),l)) app(hd(),app(app(cons(),x),xs)) -> x app(tl(),app(app(cons(),x),xs)) -> xs last() -> app(app(compose(),hd()),reverse()) init() -> app(app(compose(),reverse()),app(app(compose(),tl()),reverse())) Instead we prove termination of the uncurried system: app(compose_0(),y) -> compose_1(y) app(compose_1(x1),y) -> compose_2(x1,y) app(compose_2(x1,x2),y) -> compose_3(x1,x2,y) app(cons_0(),y) -> cons_1(y) app(cons_1(x1),y) -> cons_2(x1,y) app(hd_0(),y) -> hd_1(y) app(reverse_0(),y) -> reverse_1(y) app(reverse2_0(),y) -> reverse2_1(y) app(reverse2_1(x1),y) -> reverse2_2(x1,y) app(tl_0(),y) -> tl_1(y) compose_3(f,g,x) -> app(g,app(f,x)) reverse_1(l) -> reverse2_2(l,nil_0()) reverse2_2(nil_0(),l) -> l reverse2_2(cons_2(x,xs),l) -> reverse2_2(xs,cons_2(x,l)) hd_1(cons_2(x,xs)) -> x tl_1(cons_2(x,xs)) -> xs last_0() -> compose_2(hd_0(),reverse_0()) init_0() -> compose_2(reverse_0(),compose_2(tl_0(),reverse_0())) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(compose_2(x1,x2),y) -> compose_3#(x1,x2,y) p2: app#(hd_0(),y) -> hd_1#(y) p3: app#(reverse_0(),y) -> reverse_1#(y) p4: app#(reverse2_1(x1),y) -> reverse2_2#(x1,y) p5: app#(tl_0(),y) -> tl_1#(y) p6: compose_3#(f,g,x) -> app#(g,app(f,x)) p7: compose_3#(f,g,x) -> app#(f,x) p8: reverse_1#(l) -> reverse2_2#(l,nil_0()) p9: reverse2_2#(cons_2(x,xs),l) -> reverse2_2#(xs,cons_2(x,l)) and R consists of: r1: app(compose_0(),y) -> compose_1(y) r2: app(compose_1(x1),y) -> compose_2(x1,y) r3: app(compose_2(x1,x2),y) -> compose_3(x1,x2,y) r4: app(cons_0(),y) -> cons_1(y) r5: app(cons_1(x1),y) -> cons_2(x1,y) r6: app(hd_0(),y) -> hd_1(y) r7: app(reverse_0(),y) -> reverse_1(y) r8: app(reverse2_0(),y) -> reverse2_1(y) r9: app(reverse2_1(x1),y) -> reverse2_2(x1,y) r10: app(tl_0(),y) -> tl_1(y) r11: compose_3(f,g,x) -> app(g,app(f,x)) r12: reverse_1(l) -> reverse2_2(l,nil_0()) r13: reverse2_2(nil_0(),l) -> l r14: reverse2_2(cons_2(x,xs),l) -> reverse2_2(xs,cons_2(x,l)) r15: hd_1(cons_2(x,xs)) -> x r16: tl_1(cons_2(x,xs)) -> xs r17: last_0() -> compose_2(hd_0(),reverse_0()) r18: init_0() -> compose_2(reverse_0(),compose_2(tl_0(),reverse_0())) The estimated dependency graph contains the following SCCs: {p1, p6, p7} {p9} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(compose_2(x1,x2),y) -> compose_3#(x1,x2,y) p2: compose_3#(f,g,x) -> app#(f,x) p3: compose_3#(f,g,x) -> app#(g,app(f,x)) and R consists of: r1: app(compose_0(),y) -> compose_1(y) r2: app(compose_1(x1),y) -> compose_2(x1,y) r3: app(compose_2(x1,x2),y) -> compose_3(x1,x2,y) r4: app(cons_0(),y) -> cons_1(y) r5: app(cons_1(x1),y) -> cons_2(x1,y) r6: app(hd_0(),y) -> hd_1(y) r7: app(reverse_0(),y) -> reverse_1(y) r8: app(reverse2_0(),y) -> reverse2_1(y) r9: app(reverse2_1(x1),y) -> reverse2_2(x1,y) r10: app(tl_0(),y) -> tl_1(y) r11: compose_3(f,g,x) -> app(g,app(f,x)) r12: reverse_1(l) -> reverse2_2(l,nil_0()) r13: reverse2_2(nil_0(),l) -> l r14: reverse2_2(cons_2(x,xs),l) -> reverse2_2(xs,cons_2(x,l)) r15: hd_1(cons_2(x,xs)) -> x r16: tl_1(cons_2(x,xs)) -> xs r17: last_0() -> compose_2(hd_0(),reverse_0()) r18: init_0() -> compose_2(reverse_0(),compose_2(tl_0(),reverse_0())) The set of usable rules consists of r1, r4, r5, r8, r17, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: app#_A(x1,x2) = max{3, x1} compose_2_A(x1,x2) = max{x1 + 6, x2 + 5} compose_3#_A(x1,x2,x3) = max{x1 + 6, x2 + 4} app_A(x1,x2) = max{3, x1 - 7, x2 - 7} compose_0_A = 1 compose_1_A(x1) = max{2, x1 - 7} cons_0_A = 6 cons_1_A(x1) = max{1, x1 - 8} cons_2_A(x1,x2) = max{2, x1 - 16, x2 - 17} reverse2_0_A = 1 reverse2_1_A(x1) = max{2, x1 - 8} last_0_A = 8 hd_0_A = 1 reverse_0_A = 1 init_0_A = 13 tl_0_A = 1 base order 2: precedence: last_0 = init_0 > app# = compose_2 > compose_3# = app = tl_0 > compose_1 = cons_0 = cons_2 = reverse2_1 = reverse_0 > compose_0 = cons_1 = reverse2_0 = hd_0 partial status: pi(app#) = [1] pi(compose_2) = [2] pi(compose_3#) = [2] pi(app) = [] pi(compose_0) = [] pi(compose_1) = [] pi(cons_0) = [] pi(cons_1) = [] pi(cons_2) = [] pi(reverse2_0) = [] pi(reverse2_1) = [] pi(last_0) = [] pi(hd_0) = [] pi(reverse_0) = [] pi(init_0) = [] pi(tl_0) = [] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: compose_3#(f,g,x) -> app#(f,x) p2: compose_3#(f,g,x) -> app#(g,app(f,x)) and R consists of: r1: app(compose_0(),y) -> compose_1(y) r2: app(compose_1(x1),y) -> compose_2(x1,y) r3: app(compose_2(x1,x2),y) -> compose_3(x1,x2,y) r4: app(cons_0(),y) -> cons_1(y) r5: app(cons_1(x1),y) -> cons_2(x1,y) r6: app(hd_0(),y) -> hd_1(y) r7: app(reverse_0(),y) -> reverse_1(y) r8: app(reverse2_0(),y) -> reverse2_1(y) r9: app(reverse2_1(x1),y) -> reverse2_2(x1,y) r10: app(tl_0(),y) -> tl_1(y) r11: compose_3(f,g,x) -> app(g,app(f,x)) r12: reverse_1(l) -> reverse2_2(l,nil_0()) r13: reverse2_2(nil_0(),l) -> l r14: reverse2_2(cons_2(x,xs),l) -> reverse2_2(xs,cons_2(x,l)) r15: hd_1(cons_2(x,xs)) -> x r16: tl_1(cons_2(x,xs)) -> xs r17: last_0() -> compose_2(hd_0(),reverse_0()) r18: init_0() -> compose_2(reverse_0(),compose_2(tl_0(),reverse_0())) The estimated dependency graph contains the following SCCs: (no SCCs) -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: reverse2_2#(cons_2(x,xs),l) -> reverse2_2#(xs,cons_2(x,l)) and R consists of: r1: app(compose_0(),y) -> compose_1(y) r2: app(compose_1(x1),y) -> compose_2(x1,y) r3: app(compose_2(x1,x2),y) -> compose_3(x1,x2,y) r4: app(cons_0(),y) -> cons_1(y) r5: app(cons_1(x1),y) -> cons_2(x1,y) r6: app(hd_0(),y) -> hd_1(y) r7: app(reverse_0(),y) -> reverse_1(y) r8: app(reverse2_0(),y) -> reverse2_1(y) r9: app(reverse2_1(x1),y) -> reverse2_2(x1,y) r10: app(tl_0(),y) -> tl_1(y) r11: compose_3(f,g,x) -> app(g,app(f,x)) r12: reverse_1(l) -> reverse2_2(l,nil_0()) r13: reverse2_2(nil_0(),l) -> l r14: reverse2_2(cons_2(x,xs),l) -> reverse2_2(xs,cons_2(x,l)) r15: hd_1(cons_2(x,xs)) -> x r16: tl_1(cons_2(x,xs)) -> xs r17: last_0() -> compose_2(hd_0(),reverse_0()) r18: init_0() -> compose_2(reverse_0(),compose_2(tl_0(),reverse_0())) The set of usable rules consists of r1, r2, r8, r17, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: reverse2_2#_A(x1,x2) = max{x1 + 14, x2 + 11} cons_2_A(x1,x2) = max{12, x1 - 12, x2} app_A(x1,x2) = max{15, x1 - 4, x2 - 17} compose_0_A = 1 compose_1_A(x1) = max{2, x1 - 18} compose_2_A(x1,x2) = max{3, x1 - 22, x2 - 17} reverse2_0_A = 2 reverse2_1_A(x1) = max{3, x1 - 18} last_0_A = 4 hd_0_A = 3 reverse_0_A = 3 init_0_A = 4 tl_0_A = 1 base order 2: precedence: app > reverse2_2# = last_0 = init_0 > cons_2 = compose_2 = reverse_0 = tl_0 > compose_1 = reverse2_1 = hd_0 > compose_0 = reverse2_0 partial status: pi(reverse2_2#) = [1] pi(cons_2) = [2] pi(app) = [] pi(compose_0) = [] pi(compose_1) = [] pi(compose_2) = [] pi(reverse2_0) = [] pi(reverse2_1) = [] pi(last_0) = [] pi(hd_0) = [] pi(reverse_0) = [] pi(init_0) = [] pi(tl_0) = [] The following rules are removed: p1 Then no dependency pair remains.