mirror of
https://github.com/Z3Prover/z3
synced 2025-06-23 06:13:40 +00:00
check types
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
2c69aa0df1
commit
9556a223f3
2 changed files with 12 additions and 4 deletions
|
@ -82,6 +82,10 @@ namespace opt {
|
||||||
|
|
||||||
unsigned context::add_objective(app* t, bool is_max) {
|
unsigned context::add_objective(app* t, bool is_max) {
|
||||||
app_ref tr(t, m);
|
app_ref tr(t, m);
|
||||||
|
arith_util a(m);
|
||||||
|
if (!a.is_arith_expr(t)) {
|
||||||
|
throw default_exception("Objective must be integer or real");
|
||||||
|
}
|
||||||
unsigned index = m_objectives.size();
|
unsigned index = m_objectives.size();
|
||||||
m_objectives.push_back(objective(is_max, tr, index));
|
m_objectives.push_back(objective(is_max, tr, index));
|
||||||
return index;
|
return index;
|
||||||
|
|
|
@ -261,10 +261,14 @@ namespace opt {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void opt_solver::to_smt2_benchmark(std::ofstream & buffer,
|
void opt_solver::to_smt2_benchmark(
|
||||||
unsigned num_assumptions, expr * const * assumptions,
|
std::ofstream & buffer,
|
||||||
char const * name, char const * logic,
|
unsigned num_assumptions,
|
||||||
char const * status, char const * attributes) {
|
expr * const * assumptions,
|
||||||
|
char const * name,
|
||||||
|
char const * logic,
|
||||||
|
char const * status,
|
||||||
|
char const * attributes) {
|
||||||
ast_smt_pp pp(m);
|
ast_smt_pp pp(m);
|
||||||
pp.set_benchmark_name(name);
|
pp.set_benchmark_name(name);
|
||||||
pp.set_logic(logic);
|
pp.set_logic(logic);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue