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:
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) {
|
||||
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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue