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: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: app#_A(x1,x2) = max{0, x1 - 9, x2 - 19} mapbt_1_A(x1) = max{8, x1 + 2} mapbt_2#_A(x1,x2) = max{0, x1 - 9, x2 - 19} branch_3_A(x1,x2,x3) = max{x1 + 16, x2 + 16, x3 + 17} leaf_1_A(x1) = x1 + 18 app#!_A(x1,x2) = max{6, x1 - 9, x2 - 1} mapbt_1!_A(x1) = max{3, x1 - 24} mapbt_2#!_A(x1,x2) = max{4, x1 - 8, x2 - 11} branch_3!_A(x1,x2,x3) = max{1, x1 - 12, x2 - 32, x3 - 21} leaf_1!_A(x1) = max{1, x1 - 8} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: app#_A(x1,x2) = max{0, x1 - 3, x2 - 19} mapbt_1_A(x1) = x1 + 2 mapbt_2#_A(x1,x2) = max{0, x1 - 3, x2 - 35} branch_3_A(x1,x2,x3) = max{34, x1 + 16, x2 + 8, x3} leaf_1_A(x1) = max{24, x1 + 16} app#!_A(x1,x2) = max{6, x1 - 3, x2 - 2} mapbt_1!_A(x1) = max{4, x1 - 12} mapbt_2#!_A(x1,x2) = max{5, x1 - 2, x2 - 17} branch_3!_A(x1,x2,x3) = max{0, x2 - 1, x3 - 9} leaf_1!_A(x1) = max{2, x1 - 21} partial status: pi(app#) = [1] pi(mapbt_1) = [1] pi(mapbt_2#) = [1] pi(branch_3) = [3] pi(leaf_1) = [1] The following rules are removed: p1, p4, 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) 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: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. 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 - 2, x2, x3 - 3} mapbt_2#!_A(x1,x2) = x2 + 5 branch_3!_A(x1,x2,x3) = max{12, x1 - 9, x2 + 9, x3 + 6} 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 - 3, x2 - 3, x3 - 5} mapbt_2#!_A(x1,x2) = max{5, x1 + 1} branch_3!_A(x1,x2,x3) = max{4, x1 - 5, x2 - 15, x3 - 3} partial status: pi(mapbt_2#) = [2] pi(branch_3) = [2, 3] The following rules are removed: p1, p2 Then no dependency pair remains.