transform: copy and accessible versions

* src/tgbaalgos/mask.cc, src/tgbaalgos/mask.hh: Rename transform_mask
to accessible_mask. Add Copy version and use it in mask_keep_states().
* src/tgbatest/maskkeep.test: Update.
This commit is contained in:
Alexandre Lewkowicz 2015-02-19 16:23:59 +01:00 committed by Alexandre Duret-Lutz
parent 223d41d26b
commit c61f053e2d
3 changed files with 101 additions and 31 deletions

View file

@ -32,15 +32,16 @@ namespace spot
unsigned tr = to_remove.count();
assert(tr <= na);
res->set_acceptance_conditions(na - tr);
transform_mask(in, res, [&](bdd& cond,
acc_cond::mark_t& acc,
unsigned)
{
if (acc & to_remove)
cond = bddfalse;
else
acc = inacc.strip(acc, to_remove);
});
transform_accessible(in, res, [&](unsigned,
bdd& cond,
acc_cond::mark_t& acc,
unsigned)
{
if (acc & to_remove)
cond = bddfalse;
else
acc = inacc.strip(acc, to_remove);
});
return res;
}
@ -55,11 +56,12 @@ namespace spot
res->copy_ap_of(in);
res->prop_copy(in, { true, true, true, true });
res->copy_acceptance_conditions_of(in);
transform_mask(in, res, [&](bdd& cond,
acc_cond::mark_t&,
unsigned dst)
transform_copy(in, res, [&](unsigned src,
bdd& cond,
acc_cond::mark_t&,
unsigned dst)
{
if (!to_keep[dst])
if (!to_keep[src] || !to_keep[dst])
cond = bddfalse;
}, init);
return res;