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 r1, r2, r3, r4, r5 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: app#_A(x1,x2) = x2 + 4 mapbt_1_A(x1) = x1 + 2 mapbt_2#_A(x1,x2) = x2 + 3 branch_3_A(x1,x2,x3) = x1 + x2 + x3 + 5 leaf_1_A(x1) = x1 + 5 app_A(x1,x2) = x1 + x2 + 6 branch_0_A() = 1 branch_1_A(x1) = x1 + 2 branch_2_A(x1,x2) = x1 + x2 + 3 leaf_0_A() = 1 mapbt_0_A() = 1 base order 2: precedence: app > branch_3 = leaf_1 > mapbt_2# = branch_2 = leaf_0 > app# = mapbt_1 = branch_1 > branch_0 = mapbt_0 partial status: pi(app#) = [] pi(mapbt_1) = [1] pi(mapbt_2#) = [] pi(branch_3) = [1] pi(leaf_1) = [1] pi(app) = [] pi(branch_0) = [] pi(branch_1) = [1] pi(branch_2) = [2] pi(leaf_0) = [] pi(mapbt_0) = [] The following rules are removed: p1 -- 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) p4: 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 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 r1, r2, r3, r4, r5 Take the monotone reduction pair: generalized weighted path order (>=MG, >MG) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: mapbt_2#_A(x1,x2) = x1 + x2 + 5 branch_3_A(x1,x2,x3) = x1 + x2 + x3 + 4 app_A(x1,x2) = x1 + x2 + 5 branch_0_A() = 1 branch_1_A(x1) = x1 + 2 branch_2_A(x1,x2) = x1 + x2 + 3 leaf_0_A() = 1 leaf_1_A(x1) = x1 + 2 mapbt_0_A() = 1 mapbt_1_A(x1) = x1 + 2 base order 2: precedence: mapbt_2# > branch_3 = app > branch_2 = leaf_1 = mapbt_1 > branch_1 = leaf_0 = mapbt_0 > branch_0 partial status: pi(mapbt_2#) = [1, 2] pi(branch_3) = [1, 2, 3] pi(app) = [1, 2] pi(branch_0) = [] pi(branch_1) = [1] pi(branch_2) = [1, 2] pi(leaf_0) = [] pi(leaf_1) = [1] pi(mapbt_0) = [] pi(mapbt_1) = [1] The following rules are removed: p1 -- 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,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} -- 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,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 r1, r2, r3, r4, r5 Take the monotone reduction pair: generalized weighted path order (>=MG, >MG) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: mapbt_2#_A(x1,x2) = x1 + x2 + 5 branch_3_A(x1,x2,x3) = x1 + x2 + x3 + 4 app_A(x1,x2) = x1 + x2 + 5 branch_0_A() = 1 branch_1_A(x1) = x1 + 2 branch_2_A(x1,x2) = x1 + x2 + 3 leaf_0_A() = 1 leaf_1_A(x1) = x1 + 2 mapbt_0_A() = 1 mapbt_1_A(x1) = x1 + 2 base order 2: precedence: mapbt_2# > branch_3 = app > branch_2 = leaf_1 = mapbt_1 > branch_1 = leaf_0 = mapbt_0 > branch_0 partial status: pi(mapbt_2#) = [1, 2] pi(branch_3) = [1, 2, 3] pi(app) = [1, 2] pi(branch_0) = [] pi(branch_1) = [1] pi(branch_2) = [1, 2] pi(leaf_0) = [] pi(leaf_1) = [1] pi(mapbt_0) = [] pi(mapbt_1) = [1] The following rules are removed: p1 Then no dependency pair remains.