mirror of
https://github.com/Z3Prover/z3
synced 2025-05-14 19:24:44 +00:00
add bounded-int and pb2bv solvers to fd_solver, use sorting networks for pb2bv rewriter when applicable, hoist to pb2bv_rewriter module and remove it from the pb2bv_tactic
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
6d3430c689
commit
3778048eb4
26 changed files with 1424 additions and 700 deletions
|
@ -1270,28 +1270,25 @@ namespace smt {
|
|||
TRACE("pb", tout << in << " >= " << k << "\n";);
|
||||
|
||||
|
||||
psort_expr ps(ctx, *this);
|
||||
psort_nw<psort_expr> sortnw(ps);
|
||||
sortnw.m_stats.reset();
|
||||
|
||||
if (ctx.get_assignment(thl) == l_true &&
|
||||
ctx.get_assign_level(thl) == ctx.get_base_level()) {
|
||||
psort_expr ps(ctx, *this);
|
||||
psort_nw<psort_expr> sortnw(ps);
|
||||
sortnw.m_stats.reset();
|
||||
at_least_k = sortnw.ge(false, k, in.size(), in.c_ptr());
|
||||
TRACE("pb", tout << ~thl << " " << at_least_k << "\n";);
|
||||
ctx.mk_clause(~thl, at_least_k, justify(~thl, at_least_k));
|
||||
m_stats.m_num_compiled_vars += sortnw.m_stats.m_num_compiled_vars;
|
||||
m_stats.m_num_compiled_clauses += sortnw.m_stats.m_num_compiled_clauses;
|
||||
}
|
||||
else {
|
||||
psort_expr ps(ctx, *this);
|
||||
psort_nw<psort_expr> sortnw(ps);
|
||||
sortnw.m_stats.reset();
|
||||
literal at_least_k = sortnw.ge(true, k, in.size(), in.c_ptr());
|
||||
TRACE("pb", tout << ~thl << " " << at_least_k << "\n";);
|
||||
ctx.mk_clause(~thl, at_least_k, justify(~thl, at_least_k));
|
||||
ctx.mk_clause(~at_least_k, thl, justify(thl, ~at_least_k));
|
||||
m_stats.m_num_compiled_vars += sortnw.m_stats.m_num_compiled_vars;
|
||||
m_stats.m_num_compiled_clauses += sortnw.m_stats.m_num_compiled_clauses;
|
||||
}
|
||||
m_stats.m_num_compiled_vars += sortnw.m_stats.m_num_compiled_vars;
|
||||
m_stats.m_num_compiled_clauses += sortnw.m_stats.m_num_compiled_clauses;
|
||||
|
||||
IF_VERBOSE(1, verbose_stream()
|
||||
<< "(smt.pb compile sorting network bound: "
|
||||
<< k << " literals: " << in.size() << ")\n";);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue