twa_run: reduce now diagnoses rejecting runs

Part of #471.

* spot/twaalgos/emptiness.cc: Throw an exception if
the cycle is rejecting.
* spot/twaalgos/emptiness.hh: Document this behavior.
* tests/python/except.py: Test it.
This commit is contained in:
Alexandre Duret-Lutz 2021-07-07 17:20:33 +02:00
parent f493f72015
commit 09e4ab74a1
3 changed files with 26 additions and 3 deletions

View file

@ -134,6 +134,19 @@ except RuntimeError as e:
else:
report_missing_exception()
a = spot.translate('Fa')
a = spot.to_generalized_rabin(a, False)
r = a.accepting_run()
r = r.reduce()
assert r.cycle[0].acc == spot.mark_t([1])
r.cycle[0].acc = spot.mark_t([0])
try:
r.reduce();
except RuntimeError as e:
assert "expects an accepting cycle" in str(e)
else:
report_missing_exception()
f = spot.formula('GF(a | Gb)')
try:
spot.gf_guarantee_to_ba(f, spot._bdd_dict)