mirror of
https://github.com/Z3Prover/z3
synced 2025-10-05 07:23:58 +00:00
fixing bugs exposed by msf unit tests
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
a737639790
commit
eacb48268c
3 changed files with 40 additions and 13 deletions
|
@ -28,6 +28,7 @@ Notes:
|
|||
#include "lia2card_tactic.h"
|
||||
#include "elim01_tactic.h"
|
||||
#include "tactical.h"
|
||||
#include "th_rewriter.h"
|
||||
|
||||
namespace opt {
|
||||
|
||||
|
@ -64,9 +65,14 @@ namespace opt {
|
|||
}
|
||||
|
||||
unsigned context::add_objective(app* t, bool is_max) {
|
||||
app_ref tr(t, m);
|
||||
expr_ref tr(t, m);
|
||||
app_ref ar(m);
|
||||
th_rewriter rewrite(m);
|
||||
rewrite(tr);
|
||||
SASSERT(is_app(tr));
|
||||
ar = to_app(tr);
|
||||
unsigned index = m_objectives.size();
|
||||
m_objectives.push_back(objective(is_max, tr, index));
|
||||
m_objectives.push_back(objective(is_max, ar, index));
|
||||
return index;
|
||||
}
|
||||
|
||||
|
|
|
@ -230,8 +230,10 @@ namespace opt {
|
|||
solver.reset_objectives();
|
||||
m_vars.reset();
|
||||
|
||||
// First check_sat call to initialize theories
|
||||
solver::scoped_push _push(solver);
|
||||
{
|
||||
// force base level
|
||||
solver::scoped_push _push(solver);
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < m_objs.size(); ++i) {
|
||||
m_vars.push_back(solver.add_objective(m_objs[i].get()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue