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

@ -1019,9 +1019,8 @@ namespace
if (aut->acc().uses_fin_acceptance())
error(2, 0,
"--highlight-word does not yet work with Fin acceptance");
if (auto res =
spot::couvreur99(spot::product(aut, word_aut.first))->check())
res->accepting_run()->project(aut)->highlight(word_aut.second);
if (auto run = spot::product(aut, word_aut.first)->accepting_run())
run->project(aut)->highlight(word_aut.second);
}
const double conversion_time = sw.stop();