diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 7eeac7fb7..4a423b536 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -3,7 +3,6 @@ RELEASE NOTES Version 4.8.next ================ - Planned features - - self-contained character theory, direct support for UTF8, Unicode character sets - specialized solver support for QF_ABV and ABV based on lazy SMT and dual reduction - the smtfd solver and tactic implement this strategy, but is not prime for users. - introduction of simple induction lemmas to handle a limited repertoire of induction proofs. @@ -11,6 +10,14 @@ Version 4.8.next option, but at this point does not translate into benefits. It is currently turned off by default. +Version 4.8.11 +============== + - self-contained character theory, direct support for UTF8, Unicode character sets. + Characters are by default unicode with an 18 bit range. + - support for incremental any-time MaxSAT using the option opt.enable_lns. The API + allows registering a callback function that is invoked on each incremental improvement + to objectives. + Version 4.8.10 ============== - rewritten arithmetic solver replacing legacy arithmetic solver and on by default diff --git a/src/api/python/z3/z3.py b/src/api/python/z3/z3.py index 2ad5814d3..c6d5a0faa 100644 --- a/src/api/python/z3/z3.py +++ b/src/api/python/z3/z3.py @@ -7610,6 +7610,11 @@ class Optimize(Z3PPObject): return Statistics(Z3_optimize_get_statistics(self.ctx.ref(), self.optimize), self.ctx) def set_on_model(self, on_model): + """Register a callback that is invoked with every incremental improvement to + objective values. The callback takes a model as argument. + The life-time of the model is limited to the callback so the + model has to be (deep) copied if it is to be used after the callback + """ id = len(_on_models) + 41 mdl = Model(self.ctx) _on_models[id] = (on_model, mdl) diff --git a/src/ast/seq_decl_plugin.cpp b/src/ast/seq_decl_plugin.cpp index 9c963dacd..3d2dd2313 100644 --- a/src/ast/seq_decl_plugin.cpp +++ b/src/ast/seq_decl_plugin.cpp @@ -278,10 +278,7 @@ void seq_decl_plugin::set_manager(ast_manager* m, family_id id) { decl_plugin::set_manager(m, id); bv_util bv(*m); m_char_plugin = static_cast(m_manager->get_plugin(m_manager->mk_family_id("char"))); - if (unicode()) - m_char = get_char_plugin().char_sort(); - else - m_char = bv.mk_sort(8); + m_char = get_char_plugin().char_sort(); m->inc_ref(m_char); parameter param(m_char); m_string = m->mk_sort(symbol("String"), sort_info(m_family_id, SEQ_SORT, 1, ¶m)); @@ -644,16 +641,9 @@ app* seq_decl_plugin::mk_string(zstring const& s) { } app* seq_decl_plugin::mk_char(unsigned u) { - if (unicode()) { - return get_char_plugin().mk_char(u); - } - else { - bv_util bv(*m_manager); - return bv.mk_numeral(rational(u), 8); - } + return get_char_plugin().mk_char(u); } - bool seq_decl_plugin::is_considered_uninterpreted(func_decl * f) { seq_util util(*m_manager); return util.str.is_nth_u(f); @@ -759,11 +749,6 @@ app* seq_util::mk_char_bit(expr* e, unsigned i) { return m.mk_app(f, 1, &e); } -bv_util& seq_util::bv() const { - if (!m_bv) m_bv = alloc(bv_util, m); - return *m_bv.get(); -} - unsigned seq_util::max_plus(unsigned x, unsigned y) const { if (x + y < x || x + y < y) return UINT_MAX; @@ -777,43 +762,19 @@ unsigned seq_util::max_mul(unsigned x, unsigned y) const { bool seq_util::is_const_char(expr* e, unsigned& c) const { - if (seq.unicode()) { - return ch.is_const_char(e, c); - } - else { - rational r; - unsigned sz; - return bv().is_numeral(e, r, sz) && sz == 8 && r.is_unsigned() && (c = r.get_unsigned(), true); - } + return ch.is_const_char(e, c); } bool seq_util::is_char_le(expr const* e) const { - if (seq.unicode()) - return ch.is_le(e); - else - return bv().is_bv_ule(e) && is_char(to_app(e)->get_arg(0)); + return ch.is_le(e); } app* seq_util::mk_char(unsigned ch) const { - if (seq.unicode()) - return seq.mk_char(ch); - else - return bv().mk_numeral(rational(ch), 8); + return seq.mk_char(ch); } app* seq_util::mk_le(expr* ch1, expr* ch2) const { - expr_ref _ch1(ch1, m), _ch2(ch2, m); - - if (seq.unicode()) { - return ch.mk_le(ch1, ch2); - } - else { - rational r1, r2; - if (bv().is_numeral(ch1, r1) && bv().is_numeral(ch2, r2)) { - return m.mk_bool_val(r1 <= r2); - } - return bv().mk_ule(ch1, ch2); - } + return ch.mk_le(ch1, ch2); } app* seq_util::mk_lt(expr* ch1, expr* ch2) const { diff --git a/src/ast/seq_decl_plugin.h b/src/ast/seq_decl_plugin.h index 76760d705..c916c0362 100644 --- a/src/ast/seq_decl_plugin.h +++ b/src/ast/seq_decl_plugin.h @@ -23,7 +23,6 @@ Revision History: #pragma once #include "ast/ast.h" -#include "ast/bv_decl_plugin.h" #include "ast/char_decl_plugin.h" #include "util/lbool.h" #include "util/zstring.h" @@ -211,8 +210,6 @@ class seq_util { seq_decl_plugin& seq; char_decl_plugin& ch; family_id m_fid; - mutable scoped_ptr m_bv; - bv_util& bv() const; public: