genem: Add yet another version of the algorithm

* spot/twa/acc.hh, spot/twa/acc.cc (fin_unit_one_split_improved): New
function.
* python/spot/impl.i: Add bindings for fin_unit_one_split_improved.
* spot/twaalgos/genem.cc: Add the spot212 version.
* tests/python/genem.py: Test it.
This commit is contained in:
Alexandre Duret-Lutz 2023-05-11 21:40:14 +02:00
parent 747ec8b1c5
commit 134da9209c
5 changed files with 112 additions and 24 deletions

View file

@ -1,5 +1,5 @@
# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2018-2022 Laboratoire de Recherche et Développement de
# Copyright (C) 2018-2023 Laboratoire de Recherche et Développement de
# l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
@ -307,15 +307,18 @@ def run_bench(automata):
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("spot212")
res3f = 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(res3e)[0] + str(res4)[0] + str(res5)[0])
+ str(res3e)[0] + str(res3f)[0] + str(res4)[0]
+ str(res5)[0])
print(res)
tc.assertIn(res, ('TTTTTTTTT', 'FFFFFFFFF'))
if res == 'FFFFFFFFF':
tc.assertIn(res, ('TTTTTTTTTT', 'FFFFFFFFFF'))
if res == 'FFFFFFFFFF':
run3 = spot.generic_accepting_run(aut)
tc.assertTrue(run3.replay(spot.get_cout()))