YES We show the termination of the TRS R: ap(ap(map(),f),xs) -> ap(ap(ap(if(),ap(isEmpty(),xs)),f),xs) ap(ap(ap(if(),true()),f),xs) -> nil() ap(ap(ap(if(),false()),f),xs) -> ap(ap(cons(),ap(f,ap(last(),xs))),ap(ap(map(),f),ap(dropLast(),xs))) ap(isEmpty(),nil()) -> true() ap(isEmpty(),ap(ap(cons(),x),xs)) -> false() ap(last(),ap(ap(cons(),x),nil())) -> x ap(last(),ap(ap(cons(),x),ap(ap(cons(),y),ys))) -> ap(last(),ap(ap(cons(),y),ys)) ap(dropLast(),nil()) -> nil() ap(dropLast(),ap(ap(cons(),x),nil())) -> nil() ap(dropLast(),ap(ap(cons(),x),ap(ap(cons(),y),ys))) -> ap(ap(cons(),x),ap(dropLast(),ap(ap(cons(),y),ys))) Instead we prove termination of the uncurried system: ap(cons_0(),y) -> cons_1(y) ap(cons_1(x1),y) -> cons_2(x1,y) ap(dropLast_0(),y) -> dropLast_1(y) ap(if_0(),y) -> if_1(y) ap(if_1(x1),y) -> if_2(x1,y) ap(if_2(x1,x2),y) -> if_3(x1,x2,y) ap(isEmpty_0(),y) -> isEmpty_1(y) ap(last_0(),y) -> last_1(y) ap(map_0(),y) -> map_1(y) ap(map_1(x1),y) -> map_2(x1,y) map_2(f,xs) -> if_3(isEmpty_1(xs),f,xs) if_3(true_0(),f,xs) -> nil_0() if_3(false_0(),f,xs) -> cons_2(ap(f,last_1(xs)),map_2(f,dropLast_1(xs))) isEmpty_1(nil_0()) -> true_0() isEmpty_1(cons_2(x,xs)) -> false_0() last_1(cons_2(x,nil_0())) -> x last_1(cons_2(x,cons_2(y,ys))) -> last_1(cons_2(y,ys)) dropLast_1(nil_0()) -> nil_0() dropLast_1(cons_2(x,nil_0())) -> nil_0() dropLast_1(cons_2(x,cons_2(y,ys))) -> cons_2(x,dropLast_1(cons_2(y,ys))) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: ap#(dropLast_0(),y) -> dropLast_1#(y) p2: ap#(if_2(x1,x2),y) -> if_3#(x1,x2,y) p3: ap#(isEmpty_0(),y) -> isEmpty_1#(y) p4: ap#(last_0(),y) -> last_1#(y) p5: ap#(map_1(x1),y) -> map_2#(x1,y) p6: map_2#(f,xs) -> if_3#(isEmpty_1(xs),f,xs) p7: map_2#(f,xs) -> isEmpty_1#(xs) p8: if_3#(false_0(),f,xs) -> ap#(f,last_1(xs)) p9: if_3#(false_0(),f,xs) -> last_1#(xs) p10: if_3#(false_0(),f,xs) -> map_2#(f,dropLast_1(xs)) p11: if_3#(false_0(),f,xs) -> dropLast_1#(xs) p12: last_1#(cons_2(x,cons_2(y,ys))) -> last_1#(cons_2(y,ys)) p13: dropLast_1#(cons_2(x,cons_2(y,ys))) -> dropLast_1#(cons_2(y,ys)) and R consists of: r1: ap(cons_0(),y) -> cons_1(y) r2: ap(cons_1(x1),y) -> cons_2(x1,y) r3: ap(dropLast_0(),y) -> dropLast_1(y) r4: ap(if_0(),y) -> if_1(y) r5: ap(if_1(x1),y) -> if_2(x1,y) r6: ap(if_2(x1,x2),y) -> if_3(x1,x2,y) r7: ap(isEmpty_0(),y) -> isEmpty_1(y) r8: ap(last_0(),y) -> last_1(y) r9: ap(map_0(),y) -> map_1(y) r10: ap(map_1(x1),y) -> map_2(x1,y) r11: map_2(f,xs) -> if_3(isEmpty_1(xs),f,xs) r12: if_3(true_0(),f,xs) -> nil_0() r13: if_3(false_0(),f,xs) -> cons_2(ap(f,last_1(xs)),map_2(f,dropLast_1(xs))) r14: isEmpty_1(nil_0()) -> true_0() r15: isEmpty_1(cons_2(x,xs)) -> false_0() r16: last_1(cons_2(x,nil_0())) -> x r17: last_1(cons_2(x,cons_2(y,ys))) -> last_1(cons_2(y,ys)) r18: dropLast_1(nil_0()) -> nil_0() r19: dropLast_1(cons_2(x,nil_0())) -> nil_0() r20: dropLast_1(cons_2(x,cons_2(y,ys))) -> cons_2(x,dropLast_1(cons_2(y,ys))) The estimated dependency graph contains the following SCCs: {p2, p5, p6, p8, p10} {p13} {p12} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: if_3#(false_0(),f,xs) -> ap#(f,last_1(xs)) p2: ap#(map_1(x1),y) -> map_2#(x1,y) p3: map_2#(f,xs) -> if_3#(isEmpty_1(xs),f,xs) p4: if_3#(false_0(),f,xs) -> map_2#(f,dropLast_1(xs)) p5: ap#(if_2(x1,x2),y) -> if_3#(x1,x2,y) and R consists of: r1: ap(cons_0(),y) -> cons_1(y) r2: ap(cons_1(x1),y) -> cons_2(x1,y) r3: ap(dropLast_0(),y) -> dropLast_1(y) r4: ap(if_0(),y) -> if_1(y) r5: ap(if_1(x1),y) -> if_2(x1,y) r6: ap(if_2(x1,x2),y) -> if_3(x1,x2,y) r7: ap(isEmpty_0(),y) -> isEmpty_1(y) r8: ap(last_0(),y) -> last_1(y) r9: ap(map_0(),y) -> map_1(y) r10: ap(map_1(x1),y) -> map_2(x1,y) r11: map_2(f,xs) -> if_3(isEmpty_1(xs),f,xs) r12: if_3(true_0(),f,xs) -> nil_0() r13: if_3(false_0(),f,xs) -> cons_2(ap(f,last_1(xs)),map_2(f,dropLast_1(xs))) r14: isEmpty_1(nil_0()) -> true_0() r15: isEmpty_1(cons_2(x,xs)) -> false_0() r16: last_1(cons_2(x,nil_0())) -> x r17: last_1(cons_2(x,cons_2(y,ys))) -> last_1(cons_2(y,ys)) r18: dropLast_1(nil_0()) -> nil_0() r19: dropLast_1(cons_2(x,nil_0())) -> nil_0() r20: dropLast_1(cons_2(x,cons_2(y,ys))) -> cons_2(x,dropLast_1(cons_2(y,ys))) The set of usable rules consists of r1, r2, r4, r12, r14, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: if_3#_A(x1,x2,x3) = x2 + 9 false_0_A = 4 ap#_A(x1,x2) = max{8, x1 + 2} last_1_A(x1) = max{10, x1 - 27} map_1_A(x1) = max{12, x1 + 11} map_2#_A(x1,x2) = x1 + 9 isEmpty_1_A(x1) = max{11, x1 - 13} dropLast_1_A(x1) = max{5, x1 - 28} if_2_A(x1,x2) = max{12, x1 + 5, x2 + 10} ap_A(x1,x2) = max{11, x1 + 3, x2 - 13} cons_0_A = 1 cons_1_A(x1) = max{10, x1 - 21} cons_2_A(x1,x2) = max{12, x1 - 20, x2 - 14} if_0_A = 1 if_1_A(x1) = max{5, x1 - 14} if_3_A(x1,x2,x3) = max{16, x1 - 28, x2 - 16, x3 - 10} true_0_A = 0 nil_0_A = 1 base order 2: precedence: if_3 > if_2 = if_0 > ap = if_1 > cons_2 > last_1 = isEmpty_1 = dropLast_1 = cons_1 > if_3# = map_2# = cons_0 = nil_0 > ap# = map_1 = true_0 > false_0 partial status: pi(if_3#) = [2] pi(false_0) = [] pi(ap#) = [] pi(last_1) = [] pi(map_1) = [1] pi(map_2#) = [1] pi(isEmpty_1) = [] pi(dropLast_1) = [] pi(if_2) = [1] pi(ap) = [1] pi(cons_0) = [] pi(cons_1) = [] pi(cons_2) = [] pi(if_0) = [] pi(if_1) = [] pi(if_3) = [] pi(true_0) = [] pi(nil_0) = [] The following rules are removed: p5 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: if_3#(false_0(),f,xs) -> ap#(f,last_1(xs)) p2: ap#(map_1(x1),y) -> map_2#(x1,y) p3: map_2#(f,xs) -> if_3#(isEmpty_1(xs),f,xs) p4: if_3#(false_0(),f,xs) -> map_2#(f,dropLast_1(xs)) and R consists of: r1: ap(cons_0(),y) -> cons_1(y) r2: ap(cons_1(x1),y) -> cons_2(x1,y) r3: ap(dropLast_0(),y) -> dropLast_1(y) r4: ap(if_0(),y) -> if_1(y) r5: ap(if_1(x1),y) -> if_2(x1,y) r6: ap(if_2(x1,x2),y) -> if_3(x1,x2,y) r7: ap(isEmpty_0(),y) -> isEmpty_1(y) r8: ap(last_0(),y) -> last_1(y) r9: ap(map_0(),y) -> map_1(y) r10: ap(map_1(x1),y) -> map_2(x1,y) r11: map_2(f,xs) -> if_3(isEmpty_1(xs),f,xs) r12: if_3(true_0(),f,xs) -> nil_0() r13: if_3(false_0(),f,xs) -> cons_2(ap(f,last_1(xs)),map_2(f,dropLast_1(xs))) r14: isEmpty_1(nil_0()) -> true_0() r15: isEmpty_1(cons_2(x,xs)) -> false_0() r16: last_1(cons_2(x,nil_0())) -> x r17: last_1(cons_2(x,cons_2(y,ys))) -> last_1(cons_2(y,ys)) r18: dropLast_1(nil_0()) -> nil_0() r19: dropLast_1(cons_2(x,nil_0())) -> nil_0() r20: dropLast_1(cons_2(x,cons_2(y,ys))) -> cons_2(x,dropLast_1(cons_2(y,ys))) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: if_3#(false_0(),f,xs) -> ap#(f,last_1(xs)) p2: ap#(map_1(x1),y) -> map_2#(x1,y) p3: map_2#(f,xs) -> if_3#(isEmpty_1(xs),f,xs) p4: if_3#(false_0(),f,xs) -> map_2#(f,dropLast_1(xs)) and R consists of: r1: ap(cons_0(),y) -> cons_1(y) r2: ap(cons_1(x1),y) -> cons_2(x1,y) r3: ap(dropLast_0(),y) -> dropLast_1(y) r4: ap(if_0(),y) -> if_1(y) r5: ap(if_1(x1),y) -> if_2(x1,y) r6: ap(if_2(x1,x2),y) -> if_3(x1,x2,y) r7: ap(isEmpty_0(),y) -> isEmpty_1(y) r8: ap(last_0(),y) -> last_1(y) r9: ap(map_0(),y) -> map_1(y) r10: ap(map_1(x1),y) -> map_2(x1,y) r11: map_2(f,xs) -> if_3(isEmpty_1(xs),f,xs) r12: if_3(true_0(),f,xs) -> nil_0() r13: if_3(false_0(),f,xs) -> cons_2(ap(f,last_1(xs)),map_2(f,dropLast_1(xs))) r14: isEmpty_1(nil_0()) -> true_0() r15: isEmpty_1(cons_2(x,xs)) -> false_0() r16: last_1(cons_2(x,nil_0())) -> x r17: last_1(cons_2(x,cons_2(y,ys))) -> last_1(cons_2(y,ys)) r18: dropLast_1(nil_0()) -> nil_0() r19: dropLast_1(cons_2(x,nil_0())) -> nil_0() r20: dropLast_1(cons_2(x,cons_2(y,ys))) -> cons_2(x,dropLast_1(cons_2(y,ys))) The set of usable rules consists of r1, r4, r5, r12, r14, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: if_3#_A(x1,x2,x3) = x2 + 15 false_0_A = 11 ap#_A(x1,x2) = max{13, x1 + 1} last_1_A(x1) = max{2, x1 - 14} map_1_A(x1) = x1 + 16 map_2#_A(x1,x2) = x1 + 15 isEmpty_1_A(x1) = max{10, x1 + 7} dropLast_1_A(x1) = max{2, x1 - 8} ap_A(x1,x2) = max{12, x1 - 17, x2 + 8} cons_0_A = 1 cons_1_A(x1) = max{2, x1 - 5} if_0_A = 9 if_1_A(x1) = max{10, x1 - 1} if_2_A(x1,x2) = max{11, x1 - 20, x2 - 3} if_3_A(x1,x2,x3) = max{13, x1 - 19, x2 - 2, x3 - 2} true_0_A = 0 nil_0_A = 1 base order 2: precedence: if_3 > ap > last_1 = if_0 = if_2 > ap# = map_1 = cons_1 = if_1 > if_3# = map_2# = cons_0 > dropLast_1 > false_0 = nil_0 > isEmpty_1 > true_0 partial status: pi(if_3#) = [] pi(false_0) = [] pi(ap#) = [1] pi(last_1) = [] pi(map_1) = [] pi(map_2#) = [] pi(isEmpty_1) = [] pi(dropLast_1) = [] pi(ap) = [] pi(cons_0) = [] pi(cons_1) = [] pi(if_0) = [] pi(if_1) = [] pi(if_2) = [] pi(if_3) = [] pi(true_0) = [] pi(nil_0) = [] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: ap#(map_1(x1),y) -> map_2#(x1,y) p2: map_2#(f,xs) -> if_3#(isEmpty_1(xs),f,xs) p3: if_3#(false_0(),f,xs) -> map_2#(f,dropLast_1(xs)) and R consists of: r1: ap(cons_0(),y) -> cons_1(y) r2: ap(cons_1(x1),y) -> cons_2(x1,y) r3: ap(dropLast_0(),y) -> dropLast_1(y) r4: ap(if_0(),y) -> if_1(y) r5: ap(if_1(x1),y) -> if_2(x1,y) r6: ap(if_2(x1,x2),y) -> if_3(x1,x2,y) r7: ap(isEmpty_0(),y) -> isEmpty_1(y) r8: ap(last_0(),y) -> last_1(y) r9: ap(map_0(),y) -> map_1(y) r10: ap(map_1(x1),y) -> map_2(x1,y) r11: map_2(f,xs) -> if_3(isEmpty_1(xs),f,xs) r12: if_3(true_0(),f,xs) -> nil_0() r13: if_3(false_0(),f,xs) -> cons_2(ap(f,last_1(xs)),map_2(f,dropLast_1(xs))) r14: isEmpty_1(nil_0()) -> true_0() r15: isEmpty_1(cons_2(x,xs)) -> false_0() r16: last_1(cons_2(x,nil_0())) -> x r17: last_1(cons_2(x,cons_2(y,ys))) -> last_1(cons_2(y,ys)) r18: dropLast_1(nil_0()) -> nil_0() r19: dropLast_1(cons_2(x,nil_0())) -> nil_0() r20: dropLast_1(cons_2(x,cons_2(y,ys))) -> cons_2(x,dropLast_1(cons_2(y,ys))) The estimated dependency graph contains the following SCCs: {p2, p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: map_2#(f,xs) -> if_3#(isEmpty_1(xs),f,xs) p2: if_3#(false_0(),f,xs) -> map_2#(f,dropLast_1(xs)) and R consists of: r1: ap(cons_0(),y) -> cons_1(y) r2: ap(cons_1(x1),y) -> cons_2(x1,y) r3: ap(dropLast_0(),y) -> dropLast_1(y) r4: ap(if_0(),y) -> if_1(y) r5: ap(if_1(x1),y) -> if_2(x1,y) r6: ap(if_2(x1,x2),y) -> if_3(x1,x2,y) r7: ap(isEmpty_0(),y) -> isEmpty_1(y) r8: ap(last_0(),y) -> last_1(y) r9: ap(map_0(),y) -> map_1(y) r10: ap(map_1(x1),y) -> map_2(x1,y) r11: map_2(f,xs) -> if_3(isEmpty_1(xs),f,xs) r12: if_3(true_0(),f,xs) -> nil_0() r13: if_3(false_0(),f,xs) -> cons_2(ap(f,last_1(xs)),map_2(f,dropLast_1(xs))) r14: isEmpty_1(nil_0()) -> true_0() r15: isEmpty_1(cons_2(x,xs)) -> false_0() r16: last_1(cons_2(x,nil_0())) -> x r17: last_1(cons_2(x,cons_2(y,ys))) -> last_1(cons_2(y,ys)) r18: dropLast_1(nil_0()) -> nil_0() r19: dropLast_1(cons_2(x,nil_0())) -> nil_0() r20: dropLast_1(cons_2(x,cons_2(y,ys))) -> cons_2(x,dropLast_1(cons_2(y,ys))) The set of usable rules consists of r4, r5, r12, r14, r15, r18, r19, r20 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: map_2#_A(x1,x2) = x2 + 10 if_3#_A(x1,x2,x3) = max{10, x1 + 7, x3 + 1} isEmpty_1_A(x1) = max{3, x1 - 6} false_0_A = 6 dropLast_1_A(x1) = max{2, x1 - 10} ap_A(x1,x2) = max{0, x1 - 9, x2 - 5} if_0_A = 8 if_1_A(x1) = max{0, x1 - 5} if_2_A(x1,x2) = max{0, x1 - 16, x2 - 6} if_3_A(x1,x2,x3) = max{x1 - 15, x2 + 14, x3 - 1} true_0_A = 0 nil_0_A = 1 cons_2_A(x1,x2) = x2 + 13 base order 2: precedence: if_3 > dropLast_1 = ap = cons_2 > isEmpty_1 = if_2 = nil_0 > map_2# = if_1 = true_0 > if_3# = false_0 = if_0 partial status: pi(map_2#) = [] pi(if_3#) = [3] pi(isEmpty_1) = [] pi(false_0) = [] pi(dropLast_1) = [] pi(ap) = [] pi(if_0) = [] pi(if_1) = [] pi(if_2) = [] pi(if_3) = [] pi(true_0) = [] pi(nil_0) = [] pi(cons_2) = [] The following rules are removed: p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: map_2#(f,xs) -> if_3#(isEmpty_1(xs),f,xs) and R consists of: r1: ap(cons_0(),y) -> cons_1(y) r2: ap(cons_1(x1),y) -> cons_2(x1,y) r3: ap(dropLast_0(),y) -> dropLast_1(y) r4: ap(if_0(),y) -> if_1(y) r5: ap(if_1(x1),y) -> if_2(x1,y) r6: ap(if_2(x1,x2),y) -> if_3(x1,x2,y) r7: ap(isEmpty_0(),y) -> isEmpty_1(y) r8: ap(last_0(),y) -> last_1(y) r9: ap(map_0(),y) -> map_1(y) r10: ap(map_1(x1),y) -> map_2(x1,y) r11: map_2(f,xs) -> if_3(isEmpty_1(xs),f,xs) r12: if_3(true_0(),f,xs) -> nil_0() r13: if_3(false_0(),f,xs) -> cons_2(ap(f,last_1(xs)),map_2(f,dropLast_1(xs))) r14: isEmpty_1(nil_0()) -> true_0() r15: isEmpty_1(cons_2(x,xs)) -> false_0() r16: last_1(cons_2(x,nil_0())) -> x r17: last_1(cons_2(x,cons_2(y,ys))) -> last_1(cons_2(y,ys)) r18: dropLast_1(nil_0()) -> nil_0() r19: dropLast_1(cons_2(x,nil_0())) -> nil_0() r20: dropLast_1(cons_2(x,cons_2(y,ys))) -> cons_2(x,dropLast_1(cons_2(y,ys))) The estimated dependency graph contains the following SCCs: (no SCCs) -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: dropLast_1#(cons_2(x,cons_2(y,ys))) -> dropLast_1#(cons_2(y,ys)) and R consists of: r1: ap(cons_0(),y) -> cons_1(y) r2: ap(cons_1(x1),y) -> cons_2(x1,y) r3: ap(dropLast_0(),y) -> dropLast_1(y) r4: ap(if_0(),y) -> if_1(y) r5: ap(if_1(x1),y) -> if_2(x1,y) r6: ap(if_2(x1,x2),y) -> if_3(x1,x2,y) r7: ap(isEmpty_0(),y) -> isEmpty_1(y) r8: ap(last_0(),y) -> last_1(y) r9: ap(map_0(),y) -> map_1(y) r10: ap(map_1(x1),y) -> map_2(x1,y) r11: map_2(f,xs) -> if_3(isEmpty_1(xs),f,xs) r12: if_3(true_0(),f,xs) -> nil_0() r13: if_3(false_0(),f,xs) -> cons_2(ap(f,last_1(xs)),map_2(f,dropLast_1(xs))) r14: isEmpty_1(nil_0()) -> true_0() r15: isEmpty_1(cons_2(x,xs)) -> false_0() r16: last_1(cons_2(x,nil_0())) -> x r17: last_1(cons_2(x,cons_2(y,ys))) -> last_1(cons_2(y,ys)) r18: dropLast_1(nil_0()) -> nil_0() r19: dropLast_1(cons_2(x,nil_0())) -> nil_0() r20: dropLast_1(cons_2(x,cons_2(y,ys))) -> cons_2(x,dropLast_1(cons_2(y,ys))) The set of usable rules consists of r1, r4, r5, r9, r12, r15, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: dropLast_1#_A(x1) = x1 + 9 cons_2_A(x1,x2) = max{34, x1 - 7, x2 + 10} ap_A(x1,x2) = max{6, x1 - 13, x2 - 7} cons_0_A = 4 cons_1_A(x1) = max{5, x1 - 8} if_0_A = 3 if_1_A(x1) = max{4, x1 - 8} if_2_A(x1,x2) = max{5, x1 - 26, x2 - 13} map_0_A = 4 map_1_A(x1) = max{5, x1 - 10} if_3_A(x1,x2,x3) = max{35, x1 - 25, x2 - 12, x3 - 12} true_0_A = 0 nil_0_A = 2 isEmpty_1_A(x1) = max{7, x1 - 35} false_0_A = 5 dropLast_1_A(x1) = max{6, x1 - 13} base order 2: precedence: if_3 > cons_2 = ap > dropLast_1# = cons_1 = if_1 = if_2 = isEmpty_1 = dropLast_1 > cons_0 = if_0 = nil_0 = false_0 > true_0 > map_1 > map_0 partial status: pi(dropLast_1#) = [1] pi(cons_2) = [] pi(ap) = [] pi(cons_0) = [] pi(cons_1) = [] pi(if_0) = [] pi(if_1) = [] pi(if_2) = [] pi(map_0) = [] pi(map_1) = [] pi(if_3) = [] pi(true_0) = [] pi(nil_0) = [] pi(isEmpty_1) = [] pi(false_0) = [] pi(dropLast_1) = [] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: last_1#(cons_2(x,cons_2(y,ys))) -> last_1#(cons_2(y,ys)) and R consists of: r1: ap(cons_0(),y) -> cons_1(y) r2: ap(cons_1(x1),y) -> cons_2(x1,y) r3: ap(dropLast_0(),y) -> dropLast_1(y) r4: ap(if_0(),y) -> if_1(y) r5: ap(if_1(x1),y) -> if_2(x1,y) r6: ap(if_2(x1,x2),y) -> if_3(x1,x2,y) r7: ap(isEmpty_0(),y) -> isEmpty_1(y) r8: ap(last_0(),y) -> last_1(y) r9: ap(map_0(),y) -> map_1(y) r10: ap(map_1(x1),y) -> map_2(x1,y) r11: map_2(f,xs) -> if_3(isEmpty_1(xs),f,xs) r12: if_3(true_0(),f,xs) -> nil_0() r13: if_3(false_0(),f,xs) -> cons_2(ap(f,last_1(xs)),map_2(f,dropLast_1(xs))) r14: isEmpty_1(nil_0()) -> true_0() r15: isEmpty_1(cons_2(x,xs)) -> false_0() r16: last_1(cons_2(x,nil_0())) -> x r17: last_1(cons_2(x,cons_2(y,ys))) -> last_1(cons_2(y,ys)) r18: dropLast_1(nil_0()) -> nil_0() r19: dropLast_1(cons_2(x,nil_0())) -> nil_0() r20: dropLast_1(cons_2(x,cons_2(y,ys))) -> cons_2(x,dropLast_1(cons_2(y,ys))) The set of usable rules consists of r1, r4, r5, r9, r12, r15, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: last_1#_A(x1) = max{7, x1 + 4} cons_2_A(x1,x2) = max{25, x1 + 8, x2 + 5} ap_A(x1,x2) = max{22, x1 - 19, x2 - 10} cons_0_A = 17 cons_1_A(x1) = max{18, x1 - 11} if_0_A = 16 if_1_A(x1) = max{17, x1 - 11} if_2_A(x1,x2) = max{18, x1 - 48, x2 - 11} map_0_A = 38 map_1_A(x1) = max{18, x1 - 11} if_3_A(x1,x2,x3) = max{31, x1 - 49, x2 - 10, x3 - 10} true_0_A = 0 nil_0_A = 7 isEmpty_1_A(x1) = max{21, x1 - 26} false_0_A = 9 dropLast_1_A(x1) = max{21, x1 - 11} base order 2: precedence: last_1# = if_3 > cons_2 = if_0 = map_0 > ap > cons_1 = if_2 = isEmpty_1 = dropLast_1 > cons_0 = if_1 = nil_0 = false_0 > true_0 > map_1 partial status: pi(last_1#) = [1] pi(cons_2) = [1] pi(ap) = [] pi(cons_0) = [] pi(cons_1) = [] pi(if_0) = [] pi(if_1) = [] pi(if_2) = [] pi(map_0) = [] pi(map_1) = [] pi(if_3) = [] pi(true_0) = [] pi(nil_0) = [] pi(isEmpty_1) = [] pi(false_0) = [] pi(dropLast_1) = [] The following rules are removed: p1 Then no dependency pair remains.