mirror of
https://github.com/Z3Prover/z3
synced 2025-07-18 02:16:40 +00:00
updates to sorting networks
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
3c4ac9aee5
commit
edb3569599
18 changed files with 2070 additions and 170 deletions
|
@ -32,12 +32,13 @@ namespace opt {
|
|||
public:
|
||||
typedef expr* literal;
|
||||
typedef ptr_vector<expr> literal_vector;
|
||||
sorting_network_config m_cfg;
|
||||
psort_nw<sortmax> m_sort;
|
||||
expr_ref_vector m_trail;
|
||||
func_decl_ref_vector m_fresh;
|
||||
ref<filter_model_converter> m_filter;
|
||||
sortmax(maxsat_context& c, weights_t& ws, expr_ref_vector const& soft):
|
||||
maxsmt_solver_base(c, ws, soft), m_sort(*this), m_trail(m), m_fresh(m) {}
|
||||
maxsmt_solver_base(c, ws, soft), m_sort(*this, m_cfg), m_trail(m), m_fresh(m) {}
|
||||
|
||||
virtual ~sortmax() {}
|
||||
|
||||
|
@ -138,8 +139,8 @@ namespace opt {
|
|||
m_trail.push_back(l);
|
||||
return l;
|
||||
}
|
||||
literal fresh() {
|
||||
expr_ref fr(m.mk_fresh_const("sn", m.mk_bool_sort()), m);
|
||||
literal fresh(char const* n) {
|
||||
expr_ref fr(m.mk_fresh_const(n, m.mk_bool_sort()), m);
|
||||
func_decl* f = to_app(fr)->get_decl();
|
||||
m_fresh.push_back(f);
|
||||
m_filter->insert(f);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue