3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-28 17:08:45 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-08-17 15:59:40 -07:00
commit d15f8c52a0
2 changed files with 264 additions and 246 deletions

View file

@ -298,6 +298,24 @@ public class Optimize extends Z3Object {
return Native.optimizeToString(getContext().nCtx(), getNativeObject()); return Native.optimizeToString(getContext().nCtx(), getNativeObject());
} }
/**
* Parse an SMT-LIB2 file with optimization objectives and constraints.
* The parsed constraints and objectives are added to the optimization context.
*/
public void fromFile(String file)
{
Native.optimizeFromFile(getContext().nCtx(), getNativeObject(), file);
}
/**
* Similar to FromFile. Instead it takes as argument a string.
*/
public void fromString(String s)
{
Native.optimizeFromString(getContext().nCtx(), getNativeObject(), s);
}
/** /**
* Optimize statistics. * Optimize statistics.
**/ **/

View file

@ -2087,9 +2087,9 @@ namespace smt {
for (; it != end; ++it) { for (; it != end; ++it) {
enode * p = *it; enode * p = *it;
if (p->get_decl() == f && if (p->get_decl() == f &&
p->get_num_args() == num_args &&
m_context.is_relevant(p) && m_context.is_relevant(p) &&
p->is_cgr() && p->is_cgr() &&
i < p->get_num_args() &&
p->get_arg(i)->get_root() == n) { p->get_arg(i)->get_root() == n) {
v->push_back(p); v->push_back(p);
} }