Skip to content

Commit

Permalink
Changed to unordered_sets, and avoid regex construction.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaveaux committed Jun 5, 2024
1 parent 1c9107e commit dced439
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions libraries/pbes/include/mcrl2/pbes/pbesinst_lazy.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ class pbesinst_lazy_algorithm
}
}

/// Replaces propositional variables in the expression psi that are irrelevant for the given proof_graph.
static void rewrite_star(pbes_expression& result,
const structure_graph& G,
bool alpha,
Expand All @@ -284,13 +285,13 @@ class pbesinst_lazy_algorithm
const pbes_expression& psi)
{
bool changed = false;
std::regex re("Z(neg|pos)_(\\d+)_.*");
thread_local std::regex re("Z(neg|pos)_(\\d+)_.*");
std::smatch match;

// Now we need to find all reachable X --> Y, following vertices that are not ranked.
mCRL2log(log::debug) << "X = " << X << ", psi = " << psi << std::endl;

std::set<pbes_expression> Ys;
std::unordered_set<pbes_expression> Ys;

// If X is won by player alpha, i.e. in the winning set W.
auto it = W.find(X);
Expand All @@ -302,8 +303,8 @@ class pbesinst_lazy_algorithm
// (the initial vertex is in W and every reachable one).
Ys.insert(X);

std::set<structure_graph::index_type> todo = { index };
std::set<structure_graph::index_type> done;
std::unordered_set<structure_graph::index_type> todo = { index };
std::unordered_set<structure_graph::index_type> done;

while (!todo.empty())
{
Expand Down

0 comments on commit dced439

Please sign in to comment.