twa: add accepting_run() and accepting_word() methods

Fixes #153.

* spot/twa/twa.cc, spot/twa/twa.hh: Add the methods.
* bin/autfilt.cc, bin/common_aoutput.hh, bin/ltlcross.cc,
tests/python/highlighting.ipynb, tests/python/word.ipynb: Use
them to simplify the code.
* NEWS: Mention them.
This commit is contained in:
Alexandre Duret-Lutz 2016-07-18 23:20:49 +02:00
parent 3836ea8d18
commit 014a9dbd6b
8 changed files with 145 additions and 71 deletions

View file

@ -178,15 +178,10 @@ public:
}
if (has('w'))
{
auto res = spot::couvreur99(aut)->check();
if (res)
if (auto word = aut->accepting_word())
{
auto run = res->accepting_run();
assert(run);
spot::twa_word w(run->reduce());
w.simplify();
std::ostringstream out;
out << w;
out << *word;
aut_word_ = out.str();
}
else