mirror of
https://github.com/Z3Prover/z3
synced 2025-04-28 19:35:50 +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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue