YES We show the termination of the TRS R: app(app(mapbt(),f),app(leaf(),x)) -> app(leaf(),app(f,x)) app(app(mapbt(),f),app(app(app(branch(),x),l),r)) -> app(app(app(branch(),app(f,x)),app(app(mapbt(),f),l)),app(app(mapbt(),f),r)) Instead we prove termination of the uncurried system: app(branch_0(),y) -> branch_1(y) app(branch_1(x1),y) -> branch_2(x1,y) app(branch_2(x1,x2),y) -> branch_3(x1,x2,y) app(leaf_0(),y) -> leaf_1(y) app(mapbt_0(),y) -> mapbt_1(y) app(mapbt_1(x1),y) -> mapbt_2(x1,y) mapbt_2(f,leaf_1(x)) -> leaf_1(app(f,x)) mapbt_2(f,branch_3(x,l,r)) -> branch_3(app(f,x),mapbt_2(f,l),mapbt_2(f,r)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(mapbt_1(x1),y) -> mapbt_2#(x1,y) p2: mapbt_2#(f,leaf_1(x)) -> app#(f,x) p3: mapbt_2#(f,branch_3(x,l,r)) -> app#(f,x) p4: mapbt_2#(f,branch_3(x,l,r)) -> mapbt_2#(f,l) p5: mapbt_2#(f,branch_3(x,l,r)) -> mapbt_2#(f,r) and R consists of: r1: app(branch_0(),y) -> branch_1(y) r2: app(branch_1(x1),y) -> branch_2(x1,y) r3: app(branch_2(x1,x2),y) -> branch_3(x1,x2,y) r4: app(leaf_0(),y) -> leaf_1(y) r5: app(mapbt_0(),y) -> mapbt_1(y) r6: app(mapbt_1(x1),y) -> mapbt_2(x1,y) r7: mapbt_2(f,leaf_1(x)) -> leaf_1(app(f,x)) r8: mapbt_2(f,branch_3(x,l,r)) -> branch_3(app(f,x),mapbt_2(f,l),mapbt_2(f,r)) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4, p5} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(mapbt_1(x1),y) -> mapbt_2#(x1,y) p2: mapbt_2#(f,branch_3(x,l,r)) -> mapbt_2#(f,r) p3: mapbt_2#(f,branch_3(x,l,r)) -> mapbt_2#(f,l) p4: mapbt_2#(f,branch_3(x,l,r)) -> app#(f,x) p5: mapbt_2#(f,leaf_1(x)) -> app#(f,x) and R consists of: r1: app(branch_0(),y) -> branch_1(y) r2: app(branch_1(x1),y) -> branch_2(x1,y) r3: app(branch_2(x1,x2),y) -> branch_3(x1,x2,y) r4: app(leaf_0(),y) -> leaf_1(y) r5: app(mapbt_0(),y) -> mapbt_1(y) r6: app(mapbt_1(x1),y) -> mapbt_2(x1,y) r7: mapbt_2(f,leaf_1(x)) -> leaf_1(app(f,x)) r8: mapbt_2(f,branch_3(x,l,r)) -> branch_3(app(f,x),mapbt_2(f,l),mapbt_2(f,r)) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: app#_A(x1,x2) = 2 mapbt_1_A(x1) = max{4, x1 - 5} mapbt_2#_A(x1,x2) = 2 branch_3_A(x1,x2,x3) = max{3, x1 + 1, x2 - 6} leaf_1_A(x1) = max{3, x1 + 1} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: app#_A(x1,x2) = max{0, x1 - 10, x2 - 12} mapbt_1_A(x1) = max{9, x1 + 2} mapbt_2#_A(x1,x2) = max{0, x1 - 10, x2 - 12} branch_3_A(x1,x2,x3) = max{11, x1 + 10, x2 + 1, x3 + 1} leaf_1_A(x1) = x1 + 11 app#!_A(x1,x2) = max{4, x1 - 3, x2 - 29} mapbt_1!_A(x1) = max{2, x1 - 28} mapbt_2#!_A(x1,x2) = max{5, x1 - 2, x2 - 39} branch_3!_A(x1,x2,x3) = max{2, x1 - 16, x2 - 25, x3 - 14} leaf_1!_A(x1) = max{3, x1 - 29} partial status: pi(app#) = [] pi(mapbt_1) = [] pi(mapbt_2#) = [] pi(branch_3) = [1] pi(leaf_1) = [1] The following rules are removed: p1, p5 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: mapbt_2#(f,branch_3(x,l,r)) -> mapbt_2#(f,r) p2: mapbt_2#(f,branch_3(x,l,r)) -> mapbt_2#(f,l) p3: mapbt_2#(f,branch_3(x,l,r)) -> app#(f,x) and R consists of: r1: app(branch_0(),y) -> branch_1(y) r2: app(branch_1(x1),y) -> branch_2(x1,y) r3: app(branch_2(x1,x2),y) -> branch_3(x1,x2,y) r4: app(leaf_0(),y) -> leaf_1(y) r5: app(mapbt_0(),y) -> mapbt_1(y) r6: app(mapbt_1(x1),y) -> mapbt_2(x1,y) r7: mapbt_2(f,leaf_1(x)) -> leaf_1(app(f,x)) r8: mapbt_2(f,branch_3(x,l,r)) -> branch_3(app(f,x),mapbt_2(f,l),mapbt_2(f,r)) The estimated dependency graph contains the following SCCs: {p1, p2} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: mapbt_2#(f,branch_3(x,l,r)) -> mapbt_2#(f,r) p2: mapbt_2#(f,branch_3(x,l,r)) -> mapbt_2#(f,l) and R consists of: r1: app(branch_0(),y) -> branch_1(y) r2: app(branch_1(x1),y) -> branch_2(x1,y) r3: app(branch_2(x1,x2),y) -> branch_3(x1,x2,y) r4: app(leaf_0(),y) -> leaf_1(y) r5: app(mapbt_0(),y) -> mapbt_1(y) r6: app(mapbt_1(x1),y) -> mapbt_2(x1,y) r7: mapbt_2(f,leaf_1(x)) -> leaf_1(app(f,x)) r8: mapbt_2(f,branch_3(x,l,r)) -> branch_3(app(f,x),mapbt_2(f,l),mapbt_2(f,r)) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: mapbt_2#_A(x1,x2) = max{1, x2 - 1} branch_3_A(x1,x2,x3) = max{x1 + 3, x2 + 7, x3 + 3} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: mapbt_2#_A(x1,x2) = 0 branch_3_A(x1,x2,x3) = max{3, x1 - 8, x2 + 1, x3 - 3} mapbt_2#!_A(x1,x2) = max{x1 + 2, x2 + 10} branch_3!_A(x1,x2,x3) = max{2, x1 - 55, x2 - 16, x3 - 13} partial status: pi(mapbt_2#) = [] pi(branch_3) = [1, 3] The following rules are removed: p1, p2 Then no dependency pair remains.