@@ -220,6 +220,10 @@ interval theory_arith<Ext>::mk_interval_for(theory_var v) {
220
220
bound * l = lower (v);
221
221
bound * u = upper (v);
222
222
if (l && u) {
223
+ // optimization may introduce non-standard bounds.
224
+ if (l->get_value () == u->get_value () && !l->get_value ().get_infinitesimal ().to_rational ().is_zero ()) {
225
+ return interval (m_dep_manager);
226
+ }
223
227
return interval (m_dep_manager,
224
228
l->get_value ().get_rational ().to_rational (),
225
229
!l->get_value ().get_infinitesimal ().to_rational ().is_zero (),
@@ -1167,16 +1171,17 @@ expr_ref theory_arith<Ext>::p2expr(buffer<coeff_expr> & p) {
1167
1171
SASSERT (!p.empty ());
1168
1172
TRACE (" p2expr_bug" , display_coeff_exprs (tout, p););
1169
1173
ptr_buffer<expr> args;
1174
+ rational c2;
1170
1175
for (coeff_expr const & ce : p) {
1171
1176
rational const & c = ce.first ;
1172
1177
expr * var = ce.second ;
1173
- if (!c. is_one ( )) {
1174
- rational c2 ;
1175
- expr * m = nullptr ;
1176
- if (m_util. is_numeral (var, c2))
1177
- m = m_util. mk_numeral (c*c2, m_util. is_int (var) && c. is_int () && c2. is_int ());
1178
- else
1179
- m = m_util.mk_mul (m_util.mk_numeral (c, c.is_int () && m_util.is_int (var)), var);
1178
+ if (m_util. is_numeral (var, c2 )) {
1179
+ expr* m = m_util. mk_numeral (c * c2, c. is_int () && m_util. is_int (var)) ;
1180
+ m_nl_new_exprs. push_back (m) ;
1181
+ args. push_back (m);
1182
+ }
1183
+ else if (!c. is_one ()) {
1184
+ expr * m = m_util.mk_mul (m_util.mk_numeral (c, c.is_int () && m_util.is_int (var)), var);
1180
1185
m_nl_new_exprs.push_back (m);
1181
1186
args.push_back (m);
1182
1187
}
@@ -1425,7 +1430,7 @@ expr_ref theory_arith<Ext>::horner(unsigned depth, buffer<coeff_expr> & p, expr
1425
1430
If var != 0, then it is used for performing the horner extension
1426
1431
*/
1427
1432
template <typename Ext>
1428
- expr_ref theory_arith<Ext>::cross_nested(unsigned depth, buffer<coeff_expr> & p, expr * var) {
1433
+ expr_ref theory_arith<Ext>::cross_nested(unsigned depth, buffer<coeff_expr> & p, expr * var) {
1429
1434
TRACE (" non_linear" , tout << " p.size: " << p.size () << " \n " ;);
1430
1435
if (var == nullptr ) {
1431
1436
sbuffer<var_num_occs> varinfo;
@@ -1561,11 +1566,12 @@ bool theory_arith<Ext>::is_cross_nested_consistent(buffer<coeff_expr> & p) {
1561
1566
*/
1562
1567
template <typename Ext>
1563
1568
bool theory_arith<Ext>::is_cross_nested_consistent(row const & r) {
1564
- TRACE (" cross_nested" , tout << " is_cross_nested_consistent:\n " ; display_row (tout, r, false ););
1565
1569
if (!is_problematic_non_linear_row (r))
1566
1570
return true ;
1567
1571
1568
- TRACE (" cross_nested" , tout << " problematic...\n " ;);
1572
+ TRACE (" cross_nested" , tout << " is_cross_nested_consistent:\n " ; display_row (tout, r, false );
1573
+ display (tout);
1574
+ );
1569
1575
1570
1576
/*
1571
1577
The method is_cross_nested converts rows back to expressions.
0 commit comments