autfilt: --instut, --destut, --is-empty

* src/bin/autfilt.cc: Add these new options.
* src/tgbaalgos/stutterize.cc, src/tgbaalgos/stutterize.hh: Make it
possible to call sl() and sl2() without passing the set of atomic
propositions.
* src/tgbatest/stutter.test: New file.
* src/tgbatest/Makefile.am: Add it.
This commit is contained in:
Alexandre Duret-Lutz 2014-12-17 09:35:52 +01:00
parent 8e9c431706
commit a626a32dbc
5 changed files with 87 additions and 5 deletions

View file

@ -54,17 +54,30 @@ namespace spot
typedef std::deque<stutter_state> queue_t;
}
static bdd
get_all_ap(const const_tgba_digraph_ptr& a)
{
bdd res = bddtrue;
for (auto& i: a->transitions())
res &= bdd_support(i.cond);
return res;
}
tgba_digraph_ptr
sl(const const_tgba_digraph_ptr& a, const ltl::formula* f)
{
bdd aps = atomic_prop_collect_as_bdd(f, a);
bdd aps = f
? atomic_prop_collect_as_bdd(f, a)
: get_all_ap(a);
return sl(a, aps);
}
tgba_digraph_ptr
sl2(const const_tgba_digraph_ptr& a, const ltl::formula* f)
{
bdd aps = atomic_prop_collect_as_bdd(f, a);
bdd aps = f
? atomic_prop_collect_as_bdd(f, a)
: get_all_ap(a);
return sl2(a, aps);
}
@ -135,6 +148,8 @@ namespace spot
tgba_digraph_ptr
sl2(tgba_digraph_ptr&& a, bdd atomic_propositions)
{
if (atomic_propositions == bddfalse)
atomic_propositions = get_all_ap(a);
unsigned num_states = a->num_states();
unsigned num_transitions = a->num_transitions();
for (unsigned state = 0; state < num_states; ++state)

View file

@ -28,20 +28,20 @@
namespace spot
{
SPOT_API tgba_digraph_ptr
sl(const const_tgba_digraph_ptr&, const ltl::formula*);
sl(const const_tgba_digraph_ptr&, const ltl::formula* = nullptr);
SPOT_API tgba_digraph_ptr
sl(const const_tgba_digraph_ptr&, bdd);
SPOT_API tgba_digraph_ptr
sl2(const const_tgba_digraph_ptr&, const ltl::formula*);
sl2(const const_tgba_digraph_ptr&, const ltl::formula* = nullptr);
SPOT_API tgba_digraph_ptr
sl2(const const_tgba_digraph_ptr&, bdd);
#ifndef SWIG
SPOT_API tgba_digraph_ptr
sl2(tgba_digraph_ptr&&);
sl2(tgba_digraph_ptr&&, bdd = bddfalse);
#endif
}