add a newer version of the generic emptiness check

As discussed with Jan Strejček.

* spot/twa/acc.cc, spot/twa/acc.hh (fin_unit_one_split): New function.
(fin_one_extract): Return the simplified acceptance condition as an
optimization.
* python/spot/impl.i: Bind this new function.
* tests/python/acc.py: New file, to test it.
* tests/Makefile.am: Add acc.py.
* spot/twaalgos/genem.cc, spot/twaalgos/genem.hh: Implement the
spot211 variant of the emptiness check.
* tests/python/genem.py: Test it.
* tests/python/acc_cond.ipynb: Adjust test for fin_one_extract.
This commit is contained in:
Alexandre Duret-Lutz 2022-05-25 17:02:38 +02:00
parent aca6bd9042
commit 721d5695ec
9 changed files with 308 additions and 30 deletions

View file

@ -305,14 +305,17 @@ def run_bench(automata):
res3c = spot.generic_emptiness_check(aut)
spot.generic_emptiness_check_select_version("spot210")
res3d = spot.generic_emptiness_check(aut)
spot.generic_emptiness_check_select_version("spot211")
res3e = spot.generic_emptiness_check(aut)
spot.generic_emptiness_check_select_version("spot29")
res2 = spot.remove_fin(aut).is_empty()
res1 = generic_emptiness2(aut)
res = (str(res1)[0] + str(res2)[0] + str(res3a)[0]
+ str(res3b)[0] + str(res3c)[0] + str(res3d)[0]
+ str(res4)[0] + str(res5)[0])
+ str(res3e)[0] + str(res4)[0] + str(res5)[0])
print(res)
tc.assertIn(res, ('TTTTTTTT', 'FFFFFFFF'))
if res == 'FFFFFFFF':
tc.assertIn(res, ('TTTTTTTTT', 'FFFFFFFFF'))
if res == 'FFFFFFFFF':
run3 = spot.generic_accepting_run(aut)
tc.assertTrue(run3.replay(spot.get_cout()))