3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-20 18:20:22 +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:
Nikolaj Bjorner 2016-11-17 04:26:17 +02:00
parent e65d80dedd
commit e9db934f1a
10 changed files with 116 additions and 74 deletions

View file

@ -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())) {