YES We show the termination of the TRS R: app(app(app(comp(),f),g),x) -> app(f,app(g,x)) app(twice(),f) -> app(app(comp(),f),f) Instead we prove termination of the uncurried system: app(comp_0(),y) -> comp_1(y) app(comp_1(x1),y) -> comp_2(x1,y) app(comp_2(x1,x2),y) -> comp_3(x1,x2,y) app(twice_0(),y) -> twice_1(y) comp_3(f,g,x) -> app(f,app(g,x)) twice_1(f) -> comp_2(f,f) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(comp_2(x1,x2),y) -> comp_3#(x1,x2,y) p2: app#(twice_0(),y) -> twice_1#(y) p3: comp_3#(f,g,x) -> app#(f,app(g,x)) p4: comp_3#(f,g,x) -> app#(g,x) and R consists of: r1: app(comp_0(),y) -> comp_1(y) r2: app(comp_1(x1),y) -> comp_2(x1,y) r3: app(comp_2(x1,x2),y) -> comp_3(x1,x2,y) r4: app(twice_0(),y) -> twice_1(y) r5: comp_3(f,g,x) -> app(f,app(g,x)) r6: twice_1(f) -> comp_2(f,f) The estimated dependency graph contains the following SCCs: {p1, p3, p4} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(comp_2(x1,x2),y) -> comp_3#(x1,x2,y) p2: comp_3#(f,g,x) -> app#(g,x) p3: comp_3#(f,g,x) -> app#(f,app(g,x)) and R consists of: r1: app(comp_0(),y) -> comp_1(y) r2: app(comp_1(x1),y) -> comp_2(x1,y) r3: app(comp_2(x1,x2),y) -> comp_3(x1,x2,y) r4: app(twice_0(),y) -> twice_1(y) r5: comp_3(f,g,x) -> app(f,app(g,x)) r6: twice_1(f) -> comp_2(f,f) The set of usable rules consists of r1 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: app#_A(x1,x2) = max{5, x1 + 1} comp_2_A(x1,x2) = max{6, x1 + 4, x2 + 2} comp_3#_A(x1,x2,x3) = max{6, x1 + 4, x2 + 2} app_A(x1,x2) = max{3, x1 - 7, x2 - 4} comp_0_A = 6 comp_1_A(x1) = max{3, x1 - 4} base order 2: precedence: app# = comp_2 > comp_3# > app > comp_1 > comp_0 partial status: pi(app#) = [1] pi(comp_2) = [] pi(comp_3#) = [] pi(app) = [] pi(comp_0) = [] pi(comp_1) = [] The following rules are removed: p3 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(comp_2(x1,x2),y) -> comp_3#(x1,x2,y) p2: comp_3#(f,g,x) -> app#(g,x) and R consists of: r1: app(comp_0(),y) -> comp_1(y) r2: app(comp_1(x1),y) -> comp_2(x1,y) r3: app(comp_2(x1,x2),y) -> comp_3(x1,x2,y) r4: app(twice_0(),y) -> twice_1(y) r5: comp_3(f,g,x) -> app(f,app(g,x)) r6: twice_1(f) -> comp_2(f,f) 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#(comp_2(x1,x2),y) -> comp_3#(x1,x2,y) p2: comp_3#(f,g,x) -> app#(g,x) and R consists of: r1: app(comp_0(),y) -> comp_1(y) r2: app(comp_1(x1),y) -> comp_2(x1,y) r3: app(comp_2(x1,x2),y) -> comp_3(x1,x2,y) r4: app(twice_0(),y) -> twice_1(y) r5: comp_3(f,g,x) -> app(f,app(g,x)) r6: twice_1(f) -> comp_2(f,f) The set of usable rules consists of r1 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: app#_A(x1,x2) = max{1, x1 - 4} comp_2_A(x1,x2) = max{x1 + 9, x2 + 2} comp_3#_A(x1,x2,x3) = max{x1 + 4, x2 - 3} app_A(x1,x2) = max{2, x1 - 12, x2 - 3} comp_0_A = 1 comp_1_A(x1) = max{2, x1 - 3} base order 2: precedence: comp_2 > comp_3# = app > app# = comp_1 > comp_0 partial status: pi(app#) = [] pi(comp_2) = [1, 2] pi(comp_3#) = [] pi(app) = [] pi(comp_0) = [] pi(comp_1) = [] The following rules are removed: p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(comp_2(x1,x2),y) -> comp_3#(x1,x2,y) and R consists of: r1: app(comp_0(),y) -> comp_1(y) r2: app(comp_1(x1),y) -> comp_2(x1,y) r3: app(comp_2(x1,x2),y) -> comp_3(x1,x2,y) r4: app(twice_0(),y) -> twice_1(y) r5: comp_3(f,g,x) -> app(f,app(g,x)) r6: twice_1(f) -> comp_2(f,f) The estimated dependency graph contains the following SCCs: (no SCCs)