Skip to content

Commit

Permalink
encoding options #4665
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed Aug 30, 2020
1 parent e8826bb commit dbe2c9b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/ast/rewriter/pb2bv_rewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ struct pb2bv_rewriter::imp {
}

if (m_pb_solver == "segmented") {
throw default_exception("segmented encoding is disabled, use a different value for pb.solver");
switch (is_le) {
case l_true: return mk_seg_le(k);
case l_false: return mk_seg_ge(k);
Expand Down Expand Up @@ -565,14 +566,15 @@ struct pb2bv_rewriter::imp {
}

expr_ref mk_seg_le_rec(vector<ptr_vector<expr>> const& outs, vector<rational> const& coeffs, unsigned i, rational const& k) {
if (k.is_neg()) {
return expr_ref(m.mk_false(), m);
}
if (i == outs.size()) {
return expr_ref(m.mk_true(), m);
}
rational const& c = coeffs[i];
ptr_vector<expr> const& out = outs[i];
if (k.is_neg()) {
return expr_ref(m.mk_false(), m);
}
if (i == outs.size()) {
return expr_ref(m.mk_true(), m);
}

if (i + 1 == outs.size() && k >= rational(out.size()-1)*c) {
return expr_ref(m.mk_true(), m);
}
Expand Down Expand Up @@ -1038,6 +1040,7 @@ struct pb2bv_rewriter::imp {
void collect_param_descrs(param_descrs& r) const {
r.insert("keep_cardinality_constraints", CPK_BOOL, "(default: false) retain cardinality constraints (don't bit-blast them) and use built-in cardinality solver");
r.insert("pb.solver", CPK_SYMBOL, "(default: solver) retain pb constraints (don't bit-blast them) and use built-in pb solver");
r.insert("cardinality.encoding", CPK_SYMBOL, "(default: none) grouped, bimander, ordered, unate, circuit");
}

unsigned get_num_steps() const { return m_rw.get_num_steps(); }
Expand Down
1 change: 1 addition & 0 deletions src/smt/theory_seq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2519,6 +2519,7 @@ void theory_seq::add_dependency(dependency*& dep, enode* a, enode* b) {


void theory_seq::propagate() {
force_push();
if (ctx.get_fparams().m_seq_use_unicode)
m_unicode.propagate();
if (m_regex.can_propagate())
Expand Down
2 changes: 2 additions & 0 deletions src/tactic/arith/card2bv_tactic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class card2bv_tactic : public tactic {

void collect_param_descrs(param_descrs & r) override {
r.insert("keep_cardinality_constraints", CPK_BOOL, "(default: true) retain cardinality constraints for solver");
pb2bv_rewriter rw(m, m_params);
rw.collect_param_descrs(r);
}


Expand Down

0 comments on commit dbe2c9b

Please sign in to comment.