@@ -109,13 +109,16 @@ namespace opt {
109
109
rational delta_per_step (1 );
110
110
unsigned num_scopes = 0 ;
111
111
unsigned delta_index = 0 ; // index of objective to speed up.
112
+ bool has_bound = false ; // is the current objective bounded by a constraint.
112
113
113
114
while (m.inc ()) {
114
115
SASSERT (delta_per_step.is_int ());
115
116
SASSERT (delta_per_step.is_pos ());
116
117
is_sat = m_s->check_sat (0 , nullptr );
117
118
if (is_sat == l_true) {
118
119
bound = update_lower ();
120
+ if (!m.is_true (bound))
121
+ has_bound = true ;
119
122
if (!can_increment_delta (lower, delta_index)) {
120
123
delta_per_step = 1 ;
121
124
}
@@ -133,10 +136,12 @@ namespace opt {
133
136
// only try to improve delta_index.
134
137
bound = m_s->mk_ge (delta_index, m_lower[delta_index] + inf_eps (delta_per_step));
135
138
}
136
- TRACE (" opt" , tout << mk_pp (m_objs.get (delta_index), m) << " index: " << delta_index << " delta: " << delta_per_step << " : " << bound << " \n " ;);
139
+ TRACE (" opt" , tout << mk_pp (m_objs.get (delta_index), m) << " index: " << delta_index
140
+ << " delta: " << delta_per_step << " bound: " << bound
141
+ << " " << m_lower[delta_index] << " " << m_upper[delta_index] << " \n " );
137
142
if (bound == last_bound) {
138
143
is_sat = l_false;
139
- if (! m_lower[delta_index].is_finite () && !m_upper[delta_index].is_finite ())
144
+ if ((!has_bound || ! m_lower[delta_index].is_finite () ) && !m_upper[delta_index].is_finite ())
140
145
m_lower[delta_index] = m_upper[delta_index];
141
146
}
142
147
else {
@@ -171,9 +176,11 @@ namespace opt {
171
176
steps = 0 ;
172
177
step_incs = 0 ;
173
178
++delta_index;
179
+ has_bound = false ;
174
180
}
175
181
else {
176
- if (num_scopes > 0 ) m_s->pop (num_scopes);
182
+ if (num_scopes > 0 )
183
+ m_s->pop (num_scopes);
177
184
num_scopes = 0 ;
178
185
break ;
179
186
}
0 commit comments