@@ -188,7 +188,7 @@ namespace nlsat {
188
188
unsigned lidx = l.index ();
189
189
if (m_already_added_literal.get (lidx, false ))
190
190
return ;
191
- TRACE (" nlsat_explain" , tout << " adding literal: " << lidx << " \n " ; m_solver.display (tout, l); tout << " \n " ;);
191
+ TRACE (" nlsat_explain" , tout << " adding literal: " << lidx << " \n " ; m_solver.display (tout, l) << " \n " ;);
192
192
m_already_added_literal.setx (lidx, true , false );
193
193
m_result->push_back (l);
194
194
}
@@ -619,10 +619,15 @@ namespace nlsat {
619
619
void psc (polynomial_ref & p, polynomial_ref & q, var x) {
620
620
polynomial_ref_vector & S = m_psc_tmp;
621
621
polynomial_ref s (m_pm);
622
- TRACE (" nlsat_explain" , tout << " computing psc of\n " ; display (tout, p); tout << " \n " ; display (tout, q); tout << " \n " ;);
623
622
624
623
psc_chain (p, q, x, S);
625
624
unsigned sz = S.size ();
625
+ TRACE (" nlsat_explain" , tout << " computing psc of\n " ; display (tout, p); tout << " \n " ; display (tout, q); tout << " \n " ;
626
+ for (unsigned i = 0 ; i < sz; ++i) {
627
+ s = S.get (i);
628
+ tout << " psc: " << s << " \n " ;
629
+ });
630
+
626
631
for (unsigned i = 0 ; i < sz; i++) {
627
632
s = S.get (i);
628
633
TRACE (" nlsat_explain" , tout << " processing psc(" << i << " )\n " ; display (tout, s); tout << " \n " ;);
@@ -634,7 +639,7 @@ namespace nlsat {
634
639
TRACE (" nlsat_explain" , tout << " done, psc is a constant\n " ;);
635
640
return ;
636
641
}
637
- if (sign (s) == 0 ) {
642
+ if (sign (s) == polynomial::sign_zero ) {
638
643
TRACE (" nlsat_explain" , tout << " psc vanished, adding zero assumption\n " ;);
639
644
add_zero_assumption (s);
640
645
continue ;
@@ -825,6 +830,7 @@ namespace nlsat {
825
830
#else
826
831
int s = sign (p);
827
832
if (!is_const (p)) {
833
+ TRACE (" nlsat_explain" , tout << p << " \n " ;);
828
834
add_simple_assumption (s == 0 ? atom::EQ : (s < 0 ? atom::LT : atom::GT), p);
829
835
}
830
836
return s;
@@ -833,6 +839,11 @@ namespace nlsat {
833
839
834
840
/* *
835
841
Auxiliary function to linear roots.
842
+ y > root[1](-2*y - z)
843
+ y > -z/2
844
+ y + z/2 > 0
845
+ 2y + z > 0
846
+
836
847
*/
837
848
void mk_linear_root (atom::kind k, var y, unsigned i, poly * p, bool mk_neg) {
838
849
polynomial_ref p_prime (m_pm);
@@ -898,8 +909,13 @@ namespace nlsat {
898
909
m_am.isolate_roots (p, undef_var_assignment (m_assignment, y), roots);
899
910
unsigned num_roots = roots.size ();
900
911
for (unsigned i = 0 ; i < num_roots; i++) {
901
- TRACE (" nlsat_explain" , tout << " comparing root: " ; m_am.display_decimal (tout, roots[i]); tout << " \n " ;);
902
912
int s = m_am.compare (y_val, roots[i]);
913
+ TRACE (" nlsat_explain" ,
914
+ m_am.display_decimal (tout << " comparing root: " , roots[i]); tout << " \n " ;
915
+ m_am.display_decimal (tout << " with y_val:" , y_val);
916
+ tout << " \n sign " << s << " \n " ;
917
+ tout << " poly: " << p << " \n " ;
918
+ );
903
919
if (s == 0 ) {
904
920
// y_val == roots[i]
905
921
// add literal
@@ -931,11 +947,15 @@ namespace nlsat {
931
947
}
932
948
}
933
949
}
934
-
935
- if (!lower_inf)
950
+
951
+ if (!lower_inf) {
952
+ TRACE (" nlsat_explain" , tout << " lower_inf: " << lower_inf << " upper_inf: " << upper_inf << " " << p_lower << " \n " ;);
936
953
add_root_literal (m_full_dimensional ? atom::ROOT_GE : atom::ROOT_GT, y, i_lower, p_lower);
937
- if (!upper_inf)
954
+ }
955
+ if (!upper_inf) {
956
+ TRACE (" nlsat_explain" , tout << " lower_inf: " << lower_inf << " upper_inf: " << upper_inf << " " << p_upper << " \n " ;);
938
957
add_root_literal (m_full_dimensional ? atom::ROOT_LE : atom::ROOT_LT, y, i_upper, p_upper);
958
+ }
939
959
}
940
960
941
961
/* *
@@ -1076,7 +1096,7 @@ namespace nlsat {
1076
1096
new_lit = l;
1077
1097
return ;
1078
1098
}
1079
- TRACE (" nlsat_simplify_core" , tout << " trying to simplify literal\n " ; display (tout , l); tout << " \n using equation\n " ;
1099
+ TRACE (" nlsat_simplify_core" , display ( tout << " trying to simplify literal\n " , l) << " \n using equation\n " ;
1080
1100
m_pm.display (tout, info.m_eq , m_solver.display_proc ()); tout << " \n " ;);
1081
1101
int atom_sign = 1 ;
1082
1102
bool modified_lit = false ;
@@ -1348,7 +1368,9 @@ namespace nlsat {
1348
1368
var max_x = max_var (m_ps);
1349
1369
TRACE (" nlsat_explain" , tout << " polynomials in the conflict:\n " ; display (tout, m_ps); tout << " \n " ;);
1350
1370
elim_vanishing (m_ps);
1371
+ TRACE (" nlsat_explain" , tout << " elim vanishing\n " ; display (tout, m_ps); tout << " \n " ;);
1351
1372
project (m_ps, max_x);
1373
+ TRACE (" nlsat_explain" , tout << " after projection\n " ; display (tout, m_ps); tout << " \n " ;);
1352
1374
}
1353
1375
1354
1376
void process2 (unsigned num, literal const * ls) {
0 commit comments