YES We show the termination of the TRS R: app(app(and(),true()),true()) -> true() app(app(and(),true()),false()) -> false() app(app(and(),false()),true()) -> false() app(app(and(),false()),false()) -> false() app(app(or(),true()),true()) -> true() app(app(or(),true()),false()) -> true() app(app(or(),false()),true()) -> true() app(app(or(),false()),false()) -> false() app(app(forall(),p),nil()) -> true() app(app(forall(),p),app(app(cons(),x),xs)) -> app(app(and(),app(p,x)),app(app(forall(),p),xs)) app(app(forsome(),p),nil()) -> false() app(app(forsome(),p),app(app(cons(),x),xs)) -> app(app(or(),app(p,x)),app(app(forsome(),p),xs)) Instead we prove termination of the uncurried system: app(and_0(),y) -> and_1(y) app(and_1(x1),y) -> and_2(x1,y) app(cons_0(),y) -> cons_1(y) app(cons_1(x1),y) -> cons_2(x1,y) app(forall_0(),y) -> forall_1(y) app(forall_1(x1),y) -> forall_2(x1,y) app(forsome_0(),y) -> forsome_1(y) app(forsome_1(x1),y) -> forsome_2(x1,y) app(or_0(),y) -> or_1(y) app(or_1(x1),y) -> or_2(x1,y) and_2(true_0(),true_0()) -> true_0() and_2(true_0(),false_0()) -> false_0() and_2(false_0(),true_0()) -> false_0() and_2(false_0(),false_0()) -> false_0() or_2(true_0(),true_0()) -> true_0() or_2(true_0(),false_0()) -> true_0() or_2(false_0(),true_0()) -> true_0() or_2(false_0(),false_0()) -> false_0() forall_2(p,nil_0()) -> true_0() forall_2(p,cons_2(x,xs)) -> and_2(app(p,x),forall_2(p,xs)) forsome_2(p,nil_0()) -> false_0() forsome_2(p,cons_2(x,xs)) -> or_2(app(p,x),forsome_2(p,xs)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(and_1(x1),y) -> and_2#(x1,y) p2: app#(forall_1(x1),y) -> forall_2#(x1,y) p3: app#(forsome_1(x1),y) -> forsome_2#(x1,y) p4: app#(or_1(x1),y) -> or_2#(x1,y) p5: forall_2#(p,cons_2(x,xs)) -> and_2#(app(p,x),forall_2(p,xs)) p6: forall_2#(p,cons_2(x,xs)) -> app#(p,x) p7: forall_2#(p,cons_2(x,xs)) -> forall_2#(p,xs) p8: forsome_2#(p,cons_2(x,xs)) -> or_2#(app(p,x),forsome_2(p,xs)) p9: forsome_2#(p,cons_2(x,xs)) -> app#(p,x) p10: forsome_2#(p,cons_2(x,xs)) -> forsome_2#(p,xs) and R consists of: r1: app(and_0(),y) -> and_1(y) r2: app(and_1(x1),y) -> and_2(x1,y) r3: app(cons_0(),y) -> cons_1(y) r4: app(cons_1(x1),y) -> cons_2(x1,y) r5: app(forall_0(),y) -> forall_1(y) r6: app(forall_1(x1),y) -> forall_2(x1,y) r7: app(forsome_0(),y) -> forsome_1(y) r8: app(forsome_1(x1),y) -> forsome_2(x1,y) r9: app(or_0(),y) -> or_1(y) r10: app(or_1(x1),y) -> or_2(x1,y) r11: and_2(true_0(),true_0()) -> true_0() r12: and_2(true_0(),false_0()) -> false_0() r13: and_2(false_0(),true_0()) -> false_0() r14: and_2(false_0(),false_0()) -> false_0() r15: or_2(true_0(),true_0()) -> true_0() r16: or_2(true_0(),false_0()) -> true_0() r17: or_2(false_0(),true_0()) -> true_0() r18: or_2(false_0(),false_0()) -> false_0() r19: forall_2(p,nil_0()) -> true_0() r20: forall_2(p,cons_2(x,xs)) -> and_2(app(p,x),forall_2(p,xs)) r21: forsome_2(p,nil_0()) -> false_0() r22: forsome_2(p,cons_2(x,xs)) -> or_2(app(p,x),forsome_2(p,xs)) The estimated dependency graph contains the following SCCs: {p2, p3, p6, p7, p9, p10} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(forall_1(x1),y) -> forall_2#(x1,y) p2: forall_2#(p,cons_2(x,xs)) -> forall_2#(p,xs) p3: forall_2#(p,cons_2(x,xs)) -> app#(p,x) p4: app#(forsome_1(x1),y) -> forsome_2#(x1,y) p5: forsome_2#(p,cons_2(x,xs)) -> forsome_2#(p,xs) p6: forsome_2#(p,cons_2(x,xs)) -> app#(p,x) and R consists of: r1: app(and_0(),y) -> and_1(y) r2: app(and_1(x1),y) -> and_2(x1,y) r3: app(cons_0(),y) -> cons_1(y) r4: app(cons_1(x1),y) -> cons_2(x1,y) r5: app(forall_0(),y) -> forall_1(y) r6: app(forall_1(x1),y) -> forall_2(x1,y) r7: app(forsome_0(),y) -> forsome_1(y) r8: app(forsome_1(x1),y) -> forsome_2(x1,y) r9: app(or_0(),y) -> or_1(y) r10: app(or_1(x1),y) -> or_2(x1,y) r11: and_2(true_0(),true_0()) -> true_0() r12: and_2(true_0(),false_0()) -> false_0() r13: and_2(false_0(),true_0()) -> false_0() r14: and_2(false_0(),false_0()) -> false_0() r15: or_2(true_0(),true_0()) -> true_0() r16: or_2(true_0(),false_0()) -> true_0() r17: or_2(false_0(),true_0()) -> true_0() r18: or_2(false_0(),false_0()) -> false_0() r19: forall_2(p,nil_0()) -> true_0() r20: forall_2(p,cons_2(x,xs)) -> and_2(app(p,x),forall_2(p,xs)) r21: forsome_2(p,nil_0()) -> false_0() r22: forsome_2(p,cons_2(x,xs)) -> or_2(app(p,x),forsome_2(p,xs)) The set of usable rules consists of r1, r2, r5, r7, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: app#_A(x1,x2) = max{4, x2 - 8} forall_1_A(x1) = max{2, x1 - 18} forall_2#_A(x1,x2) = max{4, x2 - 15} cons_2_A(x1,x2) = max{14, x1 + 8, x2 + 12} forsome_1_A(x1) = max{1, x1 - 18} forsome_2#_A(x1,x2) = max{2, x2 - 9} app_A(x1,x2) = max{38, x1 - 20, x2 - 17} and_0_A = 22 and_1_A(x1) = max{1, x1 - 18} and_2_A(x1,x2) = max{13, x1 - 39, x2 - 39} forall_0_A = 1 forsome_0_A = 19 or_0_A = 19 or_1_A(x1) = max{36, x1 - 18} or_2_A(x1,x2) = max{15, x1 - 39, x2 - 63} true_0_A = 0 false_0_A = 3 base order 2: precedence: or_2 > forsome_1 > app > and_1 = and_2 > cons_2 = and_0 = forsome_0 = or_1 = false_0 > app# = forall_2# = forsome_2# = or_0 = true_0 > forall_1 > forall_0 partial status: pi(app#) = [] pi(forall_1) = [] pi(forall_2#) = [] pi(cons_2) = [2] pi(forsome_1) = [] pi(forsome_2#) = [] pi(app) = [] pi(and_0) = [] pi(and_1) = [] pi(and_2) = [] pi(forall_0) = [] pi(forsome_0) = [] pi(or_0) = [] pi(or_1) = [] pi(or_2) = [] pi(true_0) = [] pi(false_0) = [] The following rules are removed: p5 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(forall_1(x1),y) -> forall_2#(x1,y) p2: forall_2#(p,cons_2(x,xs)) -> forall_2#(p,xs) p3: forall_2#(p,cons_2(x,xs)) -> app#(p,x) p4: app#(forsome_1(x1),y) -> forsome_2#(x1,y) p5: forsome_2#(p,cons_2(x,xs)) -> app#(p,x) and R consists of: r1: app(and_0(),y) -> and_1(y) r2: app(and_1(x1),y) -> and_2(x1,y) r3: app(cons_0(),y) -> cons_1(y) r4: app(cons_1(x1),y) -> cons_2(x1,y) r5: app(forall_0(),y) -> forall_1(y) r6: app(forall_1(x1),y) -> forall_2(x1,y) r7: app(forsome_0(),y) -> forsome_1(y) r8: app(forsome_1(x1),y) -> forsome_2(x1,y) r9: app(or_0(),y) -> or_1(y) r10: app(or_1(x1),y) -> or_2(x1,y) r11: and_2(true_0(),true_0()) -> true_0() r12: and_2(true_0(),false_0()) -> false_0() r13: and_2(false_0(),true_0()) -> false_0() r14: and_2(false_0(),false_0()) -> false_0() r15: or_2(true_0(),true_0()) -> true_0() r16: or_2(true_0(),false_0()) -> true_0() r17: or_2(false_0(),true_0()) -> true_0() r18: or_2(false_0(),false_0()) -> false_0() r19: forall_2(p,nil_0()) -> true_0() r20: forall_2(p,cons_2(x,xs)) -> and_2(app(p,x),forall_2(p,xs)) r21: forsome_2(p,nil_0()) -> false_0() r22: forsome_2(p,cons_2(x,xs)) -> or_2(app(p,x),forsome_2(p,xs)) 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#(forall_1(x1),y) -> forall_2#(x1,y) p2: forall_2#(p,cons_2(x,xs)) -> app#(p,x) p3: app#(forsome_1(x1),y) -> forsome_2#(x1,y) p4: forsome_2#(p,cons_2(x,xs)) -> app#(p,x) p5: forall_2#(p,cons_2(x,xs)) -> forall_2#(p,xs) and R consists of: r1: app(and_0(),y) -> and_1(y) r2: app(and_1(x1),y) -> and_2(x1,y) r3: app(cons_0(),y) -> cons_1(y) r4: app(cons_1(x1),y) -> cons_2(x1,y) r5: app(forall_0(),y) -> forall_1(y) r6: app(forall_1(x1),y) -> forall_2(x1,y) r7: app(forsome_0(),y) -> forsome_1(y) r8: app(forsome_1(x1),y) -> forsome_2(x1,y) r9: app(or_0(),y) -> or_1(y) r10: app(or_1(x1),y) -> or_2(x1,y) r11: and_2(true_0(),true_0()) -> true_0() r12: and_2(true_0(),false_0()) -> false_0() r13: and_2(false_0(),true_0()) -> false_0() r14: and_2(false_0(),false_0()) -> false_0() r15: or_2(true_0(),true_0()) -> true_0() r16: or_2(true_0(),false_0()) -> true_0() r17: or_2(false_0(),true_0()) -> true_0() r18: or_2(false_0(),false_0()) -> false_0() r19: forall_2(p,nil_0()) -> true_0() r20: forall_2(p,cons_2(x,xs)) -> and_2(app(p,x),forall_2(p,xs)) r21: forsome_2(p,nil_0()) -> false_0() r22: forsome_2(p,cons_2(x,xs)) -> or_2(app(p,x),forsome_2(p,xs)) The set of usable rules consists of r2, r3, r5, r7, r9, r11, r12, r13, r14, r15, r16, r17 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: app#_A(x1,x2) = max{13, x2 - 11} forall_1_A(x1) = max{11, x1 - 28} forall_2#_A(x1,x2) = max{12, x2 - 12} cons_2_A(x1,x2) = max{25, x1 + 11, x2 + 4} forsome_1_A(x1) = max{2, x1 - 28} forsome_2#_A(x1,x2) = max{13, x2 - 21} app_A(x1,x2) = max{24, x1 - 29, x2 - 27} and_1_A(x1) = max{27, x1 - 27} and_2_A(x1,x2) = max{24, x1 - 56, x2 - 27} cons_0_A = 22 cons_1_A(x1) = max{23, x1 - 28} forall_0_A = 10 forsome_0_A = 1 or_0_A = 28 or_1_A(x1) = 1 true_0_A = 1 false_0_A = 4 or_2_A(x1,x2) = max{2, x1 - 30, x2 - 5} base order 2: precedence: false_0 > app > and_2 = or_2 > cons_2 > forall_2# = forall_0 = or_0 > app# = forall_1 = forsome_1 = forsome_2# = and_1 = cons_1 = or_1 = true_0 > cons_0 = forsome_0 partial status: pi(app#) = [] pi(forall_1) = [] pi(forall_2#) = [] pi(cons_2) = [2] pi(forsome_1) = [] pi(forsome_2#) = [] pi(app) = [] pi(and_1) = [] pi(and_2) = [] pi(cons_0) = [] pi(cons_1) = [] pi(forall_0) = [] pi(forsome_0) = [] pi(or_0) = [] pi(or_1) = [] pi(true_0) = [] pi(false_0) = [] pi(or_2) = [] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: forall_2#(p,cons_2(x,xs)) -> app#(p,x) p2: app#(forsome_1(x1),y) -> forsome_2#(x1,y) p3: forsome_2#(p,cons_2(x,xs)) -> app#(p,x) p4: forall_2#(p,cons_2(x,xs)) -> forall_2#(p,xs) and R consists of: r1: app(and_0(),y) -> and_1(y) r2: app(and_1(x1),y) -> and_2(x1,y) r3: app(cons_0(),y) -> cons_1(y) r4: app(cons_1(x1),y) -> cons_2(x1,y) r5: app(forall_0(),y) -> forall_1(y) r6: app(forall_1(x1),y) -> forall_2(x1,y) r7: app(forsome_0(),y) -> forsome_1(y) r8: app(forsome_1(x1),y) -> forsome_2(x1,y) r9: app(or_0(),y) -> or_1(y) r10: app(or_1(x1),y) -> or_2(x1,y) r11: and_2(true_0(),true_0()) -> true_0() r12: and_2(true_0(),false_0()) -> false_0() r13: and_2(false_0(),true_0()) -> false_0() r14: and_2(false_0(),false_0()) -> false_0() r15: or_2(true_0(),true_0()) -> true_0() r16: or_2(true_0(),false_0()) -> true_0() r17: or_2(false_0(),true_0()) -> true_0() r18: or_2(false_0(),false_0()) -> false_0() r19: forall_2(p,nil_0()) -> true_0() r20: forall_2(p,cons_2(x,xs)) -> and_2(app(p,x),forall_2(p,xs)) r21: forsome_2(p,nil_0()) -> false_0() r22: forsome_2(p,cons_2(x,xs)) -> or_2(app(p,x),forsome_2(p,xs)) The estimated dependency graph contains the following SCCs: {p4} {p2, p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: forall_2#(p,cons_2(x,xs)) -> forall_2#(p,xs) and R consists of: r1: app(and_0(),y) -> and_1(y) r2: app(and_1(x1),y) -> and_2(x1,y) r3: app(cons_0(),y) -> cons_1(y) r4: app(cons_1(x1),y) -> cons_2(x1,y) r5: app(forall_0(),y) -> forall_1(y) r6: app(forall_1(x1),y) -> forall_2(x1,y) r7: app(forsome_0(),y) -> forsome_1(y) r8: app(forsome_1(x1),y) -> forsome_2(x1,y) r9: app(or_0(),y) -> or_1(y) r10: app(or_1(x1),y) -> or_2(x1,y) r11: and_2(true_0(),true_0()) -> true_0() r12: and_2(true_0(),false_0()) -> false_0() r13: and_2(false_0(),true_0()) -> false_0() r14: and_2(false_0(),false_0()) -> false_0() r15: or_2(true_0(),true_0()) -> true_0() r16: or_2(true_0(),false_0()) -> true_0() r17: or_2(false_0(),true_0()) -> true_0() r18: or_2(false_0(),false_0()) -> false_0() r19: forall_2(p,nil_0()) -> true_0() r20: forall_2(p,cons_2(x,xs)) -> and_2(app(p,x),forall_2(p,xs)) r21: forsome_2(p,nil_0()) -> false_0() r22: forsome_2(p,cons_2(x,xs)) -> or_2(app(p,x),forsome_2(p,xs)) The set of usable rules consists of r1, r2, r3, r5, r7, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: forall_2#_A(x1,x2) = max{x1 + 5, x2 + 8} cons_2_A(x1,x2) = max{3, x1 - 3, x2 + 1} app_A(x1,x2) = max{14, x1 - 3, x2 - 11} and_0_A = 1 and_1_A(x1) = max{2, x1 - 12} and_2_A(x1,x2) = max{6, x1 - 15, x2 - 16} cons_0_A = 1 cons_1_A(x1) = max{2, x1 - 12} forall_0_A = 1 forall_1_A(x1) = max{2, x1 - 12} forsome_0_A = 1 forsome_1_A(x1) = max{2, x1 - 12} or_0_A = 1 or_1_A(x1) = max{2, x1 - 12} or_2_A(x1,x2) = max{6, x1 - 16, x2 - 12} true_0_A = 0 false_0_A = 5 base order 2: precedence: app > and_2 = or_2 > false_0 > forall_2# = true_0 > cons_2 = and_1 = forall_1 = forsome_1 = or_1 > and_0 = cons_1 = forall_0 = forsome_0 = or_0 > cons_0 partial status: pi(forall_2#) = [2] pi(cons_2) = [2] pi(app) = [] pi(and_0) = [] pi(and_1) = [] pi(and_2) = [] pi(cons_0) = [] pi(cons_1) = [] pi(forall_0) = [] pi(forall_1) = [] pi(forsome_0) = [] pi(forsome_1) = [] pi(or_0) = [] pi(or_1) = [] pi(or_2) = [] pi(true_0) = [] pi(false_0) = [] 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: app#(forsome_1(x1),y) -> forsome_2#(x1,y) p2: forsome_2#(p,cons_2(x,xs)) -> app#(p,x) and R consists of: r1: app(and_0(),y) -> and_1(y) r2: app(and_1(x1),y) -> and_2(x1,y) r3: app(cons_0(),y) -> cons_1(y) r4: app(cons_1(x1),y) -> cons_2(x1,y) r5: app(forall_0(),y) -> forall_1(y) r6: app(forall_1(x1),y) -> forall_2(x1,y) r7: app(forsome_0(),y) -> forsome_1(y) r8: app(forsome_1(x1),y) -> forsome_2(x1,y) r9: app(or_0(),y) -> or_1(y) r10: app(or_1(x1),y) -> or_2(x1,y) r11: and_2(true_0(),true_0()) -> true_0() r12: and_2(true_0(),false_0()) -> false_0() r13: and_2(false_0(),true_0()) -> false_0() r14: and_2(false_0(),false_0()) -> false_0() r15: or_2(true_0(),true_0()) -> true_0() r16: or_2(true_0(),false_0()) -> true_0() r17: or_2(false_0(),true_0()) -> true_0() r18: or_2(false_0(),false_0()) -> false_0() r19: forall_2(p,nil_0()) -> true_0() r20: forall_2(p,cons_2(x,xs)) -> and_2(app(p,x),forall_2(p,xs)) r21: forsome_2(p,nil_0()) -> false_0() r22: forsome_2(p,cons_2(x,xs)) -> or_2(app(p,x),forsome_2(p,xs)) The set of usable rules consists of r1, r2, r3, r4, r5, r7, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: app#_A(x1,x2) = x2 + 7 forsome_1_A(x1) = 22 forsome_2#_A(x1,x2) = x2 + 6 cons_2_A(x1,x2) = max{x1 + 8, x2 - 1} app_A(x1,x2) = max{x1 - 11, x2 + 21} and_0_A = 10 and_1_A(x1) = max{20, x1 - 1} and_2_A(x1,x2) = max{21, x1 - 25, x2 - 24} cons_0_A = 1 cons_1_A(x1) = x1 + 20 forall_0_A = 46 forall_1_A(x1) = max{34, x1 - 1} forsome_0_A = 34 or_0_A = 9 or_1_A(x1) = max{10, x1 - 1} or_2_A(x1,x2) = max{9, x1 - 25, x2 - 25} true_0_A = 0 false_0_A = 8 base order 2: precedence: and_0 > cons_2 = app = or_2 > app# = and_2 = cons_1 = forall_1 = or_1 > forsome_2# = and_1 = cons_0 = forall_0 = forsome_0 = or_0 = false_0 > forsome_1 = true_0 partial status: pi(app#) = [] pi(forsome_1) = [] pi(forsome_2#) = [2] pi(cons_2) = [1] pi(app) = [] pi(and_0) = [] pi(and_1) = [] pi(and_2) = [] pi(cons_0) = [] pi(cons_1) = [] pi(forall_0) = [] pi(forall_1) = [] pi(forsome_0) = [] pi(or_0) = [] pi(or_1) = [] pi(or_2) = [] pi(true_0) = [] pi(false_0) = [] The following rules are removed: p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(forsome_1(x1),y) -> forsome_2#(x1,y) and R consists of: r1: app(and_0(),y) -> and_1(y) r2: app(and_1(x1),y) -> and_2(x1,y) r3: app(cons_0(),y) -> cons_1(y) r4: app(cons_1(x1),y) -> cons_2(x1,y) r5: app(forall_0(),y) -> forall_1(y) r6: app(forall_1(x1),y) -> forall_2(x1,y) r7: app(forsome_0(),y) -> forsome_1(y) r8: app(forsome_1(x1),y) -> forsome_2(x1,y) r9: app(or_0(),y) -> or_1(y) r10: app(or_1(x1),y) -> or_2(x1,y) r11: and_2(true_0(),true_0()) -> true_0() r12: and_2(true_0(),false_0()) -> false_0() r13: and_2(false_0(),true_0()) -> false_0() r14: and_2(false_0(),false_0()) -> false_0() r15: or_2(true_0(),true_0()) -> true_0() r16: or_2(true_0(),false_0()) -> true_0() r17: or_2(false_0(),true_0()) -> true_0() r18: or_2(false_0(),false_0()) -> false_0() r19: forall_2(p,nil_0()) -> true_0() r20: forall_2(p,cons_2(x,xs)) -> and_2(app(p,x),forall_2(p,xs)) r21: forsome_2(p,nil_0()) -> false_0() r22: forsome_2(p,cons_2(x,xs)) -> or_2(app(p,x),forsome_2(p,xs)) The estimated dependency graph contains the following SCCs: (no SCCs)