mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
improving perf of mutex finding, revert semantics of 0 timeout to no-timeout. Issue #791
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
e65d80dedd
commit
e9db934f1a
10 changed files with 116 additions and 74 deletions
|
@ -16,7 +16,7 @@ def_module_params(module_name='smt',
|
|||
('delay_units_threshold', UINT, 32, 'maximum number of learned unit clauses before restarting, ignored if delay_units is false'),
|
||||
('pull_nested_quantifiers', BOOL, False, 'pull nested quantifiers'),
|
||||
('refine_inj_axioms', BOOL, True, 'refine injectivity axioms'),
|
||||
('timeout', UINT, UINT_MAX, 'timeout (in milliseconds) (0 means immediate timeout)'),
|
||||
('timeout', UINT, UINT_MAX, 'timeout (in milliseconds) (UINT_MAX and 0 mean no timeout)'),
|
||||
('rlimit', UINT, 0, 'resource limit (0 means no limit)'),
|
||||
('max_conflicts', UINT, UINT_MAX, 'maximum number of conflicts before giving up.'),
|
||||
('mbqi', BOOL, True, 'model based quantifier instantiation (MBQI)'),
|
||||
|
|
|
@ -369,7 +369,7 @@ namespace smt {
|
|||
|
||||
|
||||
lbool context::find_mutexes(expr_ref_vector const& vars, vector<expr_ref_vector>& mutexes) {
|
||||
index_set lits;
|
||||
uint_set lits;
|
||||
for (unsigned i = 0; i < vars.size(); ++i) {
|
||||
expr* n = vars[i];
|
||||
bool neg = m_manager.is_not(n, n);
|
||||
|
@ -379,11 +379,11 @@ namespace smt {
|
|||
}
|
||||
while (!lits.empty()) {
|
||||
literal_vector mutex;
|
||||
index_set other(lits);
|
||||
uint_set other(lits);
|
||||
while (!other.empty()) {
|
||||
index_set conseq;
|
||||
uint_set conseq;
|
||||
literal p = to_literal(*other.begin());
|
||||
other.erase(p.index());
|
||||
other.remove(p.index());
|
||||
mutex.push_back(p);
|
||||
if (other.empty()) {
|
||||
break;
|
||||
|
@ -407,11 +407,12 @@ namespace smt {
|
|||
return l_true;
|
||||
}
|
||||
|
||||
void context::get_reachable(literal p, index_set& goal, index_set& reachable) {
|
||||
index_set seen;
|
||||
void context::get_reachable(literal p, uint_set& goal, uint_set& reachable) {
|
||||
uint_set seen;
|
||||
literal_vector todo;
|
||||
todo.push_back(p);
|
||||
while (!todo.empty()) {
|
||||
// std::cout << "todo: " << todo.size() << "\n";
|
||||
p = todo.back();
|
||||
todo.pop_back();
|
||||
if (seen.contains(p.index())) {
|
||||
|
|
|
@ -1371,7 +1371,7 @@ namespace smt {
|
|||
\brief Auxiliry function for mutex finding.
|
||||
*/
|
||||
|
||||
void get_reachable(literal p, index_set& goal, index_set& reached);
|
||||
void get_reachable(literal p, uint_set& goal, uint_set& reached);
|
||||
|
||||
public:
|
||||
context(ast_manager & m, smt_params & fp, params_ref const & p = params_ref());
|
||||
|
|
|
@ -1289,7 +1289,7 @@ namespace smt {
|
|||
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()
|
||||
IF_VERBOSE(2, verbose_stream()
|
||||
<< "(smt.pb compile sorting network bound: "
|
||||
<< k << " literals: " << in.size()
|
||||
<< " clauses: " << sortnw.m_stats.m_num_compiled_clauses
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue