Commit 837f9e29 authored by Clément Gillard's avatar Clément Gillard Committed by Alexandre Duret-Lutz

twa: Use generic accepting run search

Make use of the generic accepting run search in twa::accepting_run()
and twa::accepting_word().

* spot/twa/twa.cc: Here.
parent 51ca5ecd
Pipeline #6466 passed with stage
in 70 minutes and 11 seconds
......@@ -104,11 +104,10 @@ namespace spot
twa_run_ptr
twa::accepting_run() const
{
if (acc().uses_fin_acceptance())
throw std::runtime_error("twa::accepting_run() does not work with "
"Fin acceptance (but twa::is_empty() and "
"twa::accepting_word() can)");
auto res = couvreur99_new_check(shared_from_this());
const_twa_ptr a = shared_from_this();
if (const_twa_graph_ptr ag = fin_to_twa_graph_maybe(a))
return generic_accepting_run(ag);
auto res = couvreur99_new_check(a);
if (!res)
return nullptr;
return res->accepting_run();
......@@ -117,7 +116,7 @@ namespace spot
twa_word_ptr
twa::accepting_word() const
{
if (auto run = remove_fin_maybe(shared_from_this())->accepting_run())
if (auto run = shared_from_this()->accepting_run())
{
auto w = make_twa_word(run->reduce());
w->simplify();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment