3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-16 07:45:27 +00:00

Add C++ functions for set operations per stackoverflow post, set relevancy = 2 for quantified maxsmt per example from Aaron Gember, fix conversion of default weights based on bug report from Patrick Trentin on maxsat. Annotating soft constraints with weight=0 caused the weight to be adjusted to 1 and therefore produce wrong results

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2016-09-21 12:24:24 -07:00
parent cda967ead2
commit 527c5191a6
4 changed files with 74 additions and 26 deletions

View file

@ -97,10 +97,7 @@ public:
virtual void execute(cmd_context & ctx) {
symbol w("weight");
rational weight = ps().get_rat(symbol("weight"), rational(0));
if (weight.is_zero()) {
weight = rational::one();
}
rational weight = ps().get_rat(symbol("weight"), rational::one());
symbol id = ps().get_sym(symbol("id"), symbol::null);
get_opt(ctx, m_opt).add_soft_constraint(m_formula, weight, id);
reset(ctx);