mirror of
https://github.com/Z3Prover/z3
synced 2025-06-27 16:38:45 +00:00
exposing lower/upper
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
4719aa11bb
commit
9e2908c3f5
2 changed files with 30 additions and 1 deletions
|
@ -108,7 +108,7 @@ namespace opt {
|
||||||
lbool context::execute_lex() {
|
lbool context::execute_lex() {
|
||||||
lbool r = l_true;
|
lbool r = l_true;
|
||||||
for (unsigned i = 0; r == l_true && i < m_objectives.size(); ++i) {
|
for (unsigned i = 0; r == l_true && i < m_objectives.size(); ++i) {
|
||||||
r = execute(m_objectives[i], true);
|
r = execute(m_objectives[i], i + 1 < m_objectives.size());
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -180,6 +180,31 @@ namespace opt {
|
||||||
m_optsmt.display_range_assignment(out);
|
m_optsmt.display_range_assignment(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
expr_ref context::get_lower(unsigned idx) {
|
||||||
|
NOT_IMPLEMENTED_YET();
|
||||||
|
if (idx > m_objectives.size()) {
|
||||||
|
throw default_exception("index out of bounds");
|
||||||
|
}
|
||||||
|
objective const& obj = m_objectives[idx];
|
||||||
|
switch(obj.m_type) {
|
||||||
|
case O_MAXSMT: {
|
||||||
|
maxsmt* ms = m_maxsmts.find(obj.m_id);
|
||||||
|
inf_eps l = ms->get_lower();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case O_MAXIMIZE:
|
||||||
|
case O_MINIMIZE:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return expr_ref(0,m);
|
||||||
|
}
|
||||||
|
|
||||||
|
expr_ref context::get_upper(unsigned idx) {
|
||||||
|
NOT_IMPLEMENTED_YET();
|
||||||
|
return expr_ref(0, m);
|
||||||
|
}
|
||||||
|
|
||||||
void context::set_cancel(bool f) {
|
void context::set_cancel(bool f) {
|
||||||
if (m_solver) {
|
if (m_solver) {
|
||||||
m_solver->set_cancel(f);
|
m_solver->set_cancel(f);
|
||||||
|
|
|
@ -80,6 +80,10 @@ namespace opt {
|
||||||
void display_range_assignment(std::ostream& out);
|
void display_range_assignment(std::ostream& out);
|
||||||
static void collect_param_descrs(param_descrs & r);
|
static void collect_param_descrs(param_descrs & r);
|
||||||
void updt_params(params_ref& p);
|
void updt_params(params_ref& p);
|
||||||
|
|
||||||
|
expr_ref get_lower(unsigned idx);
|
||||||
|
expr_ref get_upper(unsigned idx);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void validate_feasibility(maxsmt& ms);
|
void validate_feasibility(maxsmt& ms);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue