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:
parent
074678416f
commit
1df5f0e2c7
1 changed files with 17 additions and 20 deletions
|
|
@ -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); });
|
|
||||||
|
|
||||||
std::for_each(to_treat.begin(), to_treat.end(),
|
|
||||||
[&](unsigned eidx)
|
|
||||||
{
|
{
|
||||||
const auto& e = aut->edge_storage(eidx);
|
const auto& e = aut->edge_storage(eidx);
|
||||||
|
if (e.next_succ == eidx) // dead edge
|
||||||
|
continue;
|
||||||
bdd incond = bdd_exist(e.cond, output_bdd);
|
bdd incond = bdd_exist(e.cond, output_bdd);
|
||||||
bdd outcond = bdd_existcomp(e.cond, output_bdd);
|
bdd outcond = bdd_existcomp(e.cond, output_bdd);
|
||||||
assert(((incond&outcond) == e.cond)
|
assert(((incond&outcond) == e.cond) && "Precondition violated");
|
||||||
&& "Precondition violated");
|
|
||||||
// Modify
|
|
||||||
// Create new state and trans
|
// Create new state and trans
|
||||||
|
// this may invalidate "e".
|
||||||
unsigned new_dst = get_ps(e.dst, outcond, e.acc);
|
unsigned new_dst = get_ps(e.dst, outcond, e.acc);
|
||||||
// redirect
|
// redirect
|
||||||
aut->edge_storage(eidx).dst = new_dst;
|
auto& e2 = aut->edge_storage(eidx);
|
||||||
aut->edge_storage(eidx).cond = incond;
|
e2.dst = new_dst;
|
||||||
});
|
e2.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");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue