3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-22 16:45:31 +00:00

check types

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-03-22 00:54:14 -07:00
parent 2c69aa0df1
commit 9556a223f3
2 changed files with 12 additions and 4 deletions

View file

@ -82,6 +82,10 @@ namespace opt {
unsigned context::add_objective(app* t, bool is_max) {
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();
m_objectives.push_back(objective(is_max, tr, index));
return index;

View file

@ -261,10 +261,14 @@ namespace opt {
}
void opt_solver::to_smt2_benchmark(std::ofstream & buffer,
unsigned num_assumptions, expr * const * assumptions,
char const * name, char const * logic,
char const * status, char const * attributes) {
void opt_solver::to_smt2_benchmark(
std::ofstream & buffer,
unsigned num_assumptions,
expr * const * assumptions,
char const * name,
char const * logic,
char const * status,
char const * attributes) {
ast_smt_pp pp(m);
pp.set_benchmark_name(name);
pp.set_logic(logic);