synthesis: simplify split_2step_fast_here

* spot/twaalgos/synthesis.cc (split_2step_fast_here): Do not use
a temporary vector to iterate over the original edges.
This commit is contained in:
Alexandre Duret-Lutz 2021-10-23 01:23:24 +02:00
parent 074678416f
commit 1df5f0e2c7

View file

@ -363,26 +363,23 @@ namespace spot
return ns; return ns;
}; };
std::vector<unsigned> to_treat(aut->num_edges()); unsigned ne = aut->edge_vector().size();
std::transform(aut->edges().begin(), aut->edges().end(), for (unsigned eidx = 1; eidx < ne; ++eidx)
to_treat.begin(), [&](const auto& e) {
{ return aut->edge_number(e); }); const auto& e = aut->edge_storage(eidx);
if (e.next_succ == eidx) // dead edge
std::for_each(to_treat.begin(), to_treat.end(), continue;
[&](unsigned eidx) bdd incond = bdd_exist(e.cond, output_bdd);
{ bdd outcond = bdd_existcomp(e.cond, output_bdd);
const auto& e = aut->edge_storage(eidx); assert(((incond&outcond) == e.cond) && "Precondition violated");
bdd incond = bdd_exist(e.cond, output_bdd); // Create new state and trans
bdd outcond = bdd_existcomp(e.cond, output_bdd); // this may invalidate "e".
assert(((incond&outcond) == e.cond) unsigned new_dst = get_ps(e.dst, outcond, e.acc);
&& "Precondition violated"); // redirect
// Modify auto& e2 = aut->edge_storage(eidx);
// Create new state and trans e2.dst = new_dst;
unsigned new_dst = get_ps(e.dst, outcond, e.acc); e2.cond = incond;
// redirect }
aut->edge_storage(eidx).dst = new_dst;
aut->edge_storage(eidx).cond = incond;
});
auto* sp_ptr = auto* sp_ptr =
aut->get_or_set_named_prop<std::vector<bool>>("state-player"); aut->get_or_set_named_prop<std::vector<bool>>("state-player");