@@ -298,7 +298,7 @@ namespace nlsat {
298298 TRACE (lws, tout << " resultant: " ; ::nlsat::display (tout, m_solver, r); tout << std::endl;);
299299 if (is_zero (r)) {
300300 TRACE (lws, tout << " fail\n " ;);
301- m_fail = true ;
301+ fail () ;
302302 return false ;
303303 }
304304 for_each_distinct_factor (r, [&](const polynomial::polynomial_ref &f) {
@@ -323,7 +323,7 @@ namespace nlsat {
323323 collect_roots_for_ps (ps_of_n_level, root_vals);
324324 if (!add_adjacent_resultants (root_vals)) {
325325 TRACE (lws, tout << " fail\n " ;);
326- m_fail = true ;
326+ fail () ;
327327 }
328328 }
329329
@@ -566,7 +566,7 @@ namespace nlsat {
566566 for_each_distinct_factor (disc, [&](polynomial::polynomial_ref f) {
567567 if (coeffs_are_zeroes_on_sample (f, m_pm, sample (), m_am)) {
568568 TRACE (lws, tout << " fail\n " ;);
569- m_fail = true ; // ambiguous multiplicity -- not handled yet
569+ fail () ; // ambiguous multiplicity -- not handled yet
570570 return ;
571571 }
572572 mk_prop (prop_enum::ord_inv, f);
@@ -586,7 +586,7 @@ namespace nlsat {
586586 for_each_distinct_factor (lc, [&](polynomial::polynomial_ref f) {
587587 if (coeffs_are_zeroes_on_sample (f, m_pm, sample (), m_am)) {
588588 TRACE (lws, tout << " fail\n " ;);
589- m_fail = true ;
589+ fail () ;
590590 return ;
591591 }
592592 else
@@ -604,13 +604,13 @@ namespace nlsat {
604604 bool precondition_on_an_del (const property& p) {
605605 if (!p.m_poly ) {
606606 TRACE (lws, tout << " apply_pre: an_del with null poly -> fail" << std::endl;);
607- m_fail = true ;
607+ fail () ;
608608 return false ;
609609 }
610610 // If p is nullified on the sample for its level we must abort (Rule 4.1)
611611 if (coeffs_are_zeroes_on_sample (p.m_poly , m_pm, sample (), m_am)) {
612612 TRACE (lws, display (tout << " p:" , p) << " \n " ; tout << " Rule 4.1: polynomial nullified at sample -> failing" << std::endl;);
613- m_fail = true ;
613+ fail () ;
614614 return false ;
615615 }
616616 return true ;
@@ -724,7 +724,7 @@ namespace nlsat {
724724 // basic sanity checks
725725 if (!p.m_poly ) {
726726 TRACE (lws, tout << " apply_pre_non_null_fallback: null poly -> fail" << std::endl;);
727- m_fail = true ;
727+ fail () ;
728728 return ;
729729 }
730730
@@ -744,7 +744,7 @@ namespace nlsat {
744744 // (ambiguous multiplicity) -> fail per instruction
745745 if (sign (disc, sample (), m_am) == 0 ) {
746746 TRACE (lws, tout << " apply_pre_non_null_fallback: discriminant vanishes at sample -> failing" << std::endl;);
747- m_fail = true ;
747+ fail () ;
748748 return ;
749749 }
750750 // If discriminant is non-constant, add sign-invariance requirement for it
835835 }
836836 catch (z3_exception const & ex) {
837837 TRACE (lws, tout << " isolate_roots failed: " << ex.what () << " \n " ;);
838- m_fail = true ;
838+ fail () ;
839839 return ;
840840 }
841841 if (roots.size () == 0 ) {
870870 polynomial_ref res = resultant (polynomial_ref (I.l , m_pm), p.m_poly , m_level);
871871 if (m_pm.is_zero (res)) {
872872 TRACE (lws, tout << " fail\n " ;);
873- m_fail = true ;
873+ fail () ;
874874 return ;
875875 }
876876 // Factor the resultant and add ord_inv for each distinct non-constant factor
974974 }
975975
976976 bool have_representation () const { return m_rel.empty () == false ; }
977-
977+
978+ void fail () {
979+ m_fail = true ;
980+ }
981+
978982 void apply_pre_ir_ord (const property& p) {
979983 /* Rule 4.9. Let i ∈ N, R ⊆ Ri, s ∈ Ri, and ≼ be an indexed root ordering of level i + 1.
980984 Assume that ξ.p is irreducible for all ξ ∈ dom(≼), and that ≼ matches s.
991995 SASSERT (max_var (a) == max_var (b) && max_var (b) == m_level) ;
992996
993997 polynomial_ref r (m_pm);
998+ enable_trace (" lws" );
994999 r = resultant (polynomial_ref (a, m_pm), polynomial_ref (b, m_pm), m_level);
1000+ TRACE (lws, tout << " resultant of (" << pair.first << " ," << pair.second << " ):" ;
1001+ ::nlsat::display (tout, m_solver, a) << "\n";
1002+ ::nlsat::display (tout,m_solver, b)<< "\nresultant:"; ::nlsat::display (tout, m_solver, r) << " \n " );
1003+ disable_trace (" lws" );
9951004 if (m_pm.is_zero (r)) {
9961005 TRACE (lws, tout << " fail\n " ;);
997- m_fail = true ;
1006+ fail () ;
9981007 return ;
9991008 }
1000- TRACE (lws, tout << " resultant of (" << pair.first << " ," << pair.second << " ):" ;
1001- ::nlsat::display (tout, m_solver, a) << "\n";
1002- ::nlsat::display (tout,m_solver, b)<< "\nresultant:"; ::nlsat::display (tout, m_solver, r) << " \n " );
10031009 for_each_distinct_factor (r, [this ](const polynomial_ref& f) {mk_prop (ord_inv, f);});
10041010 }
10051011 }
0 commit comments