mirror of
https://github.com/Z3Prover/z3
synced 2025-04-08 10:25:18 +00:00
check parameters
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
3fa0e6f3fb
commit
f1710e5618
|
@ -53,6 +53,15 @@ namespace opt {
|
|||
|
||||
unsigned context::add_soft_constraint(expr* f, rational const& w, symbol const& id) {
|
||||
maxsmt* ms;
|
||||
if (w.is_neg()) {
|
||||
throw default_exception("Negative weight supplied. Weight should be positive");
|
||||
}
|
||||
if (w.is_zero()) {
|
||||
throw default_exception("Zero weight supplied. Weight should be positive");
|
||||
}
|
||||
if (!m.is_bool(f)) {
|
||||
throw default_exception("Soft constraint should be Boolean");
|
||||
}
|
||||
if (!m_maxsmts.find(id, ms)) {
|
||||
ms = alloc(maxsmt, m);
|
||||
ms->updt_params(m_params);
|
||||
|
|
Loading…
Reference in a new issue