spot/tests/python/remfin.py
Alexandre Duret-Lutz 95d732e331 specialize scc_filter for inherently_weak automata
Part of issue #351.

* spot/twaalgos/sccfilter.cc, spot/twaalgos/sccfilter.hh: Specialize
for inherently-weak automata.
* spot/twaalgos/postproc.cc: Simplify.
* tests/core/dca2.test, tests/core/parity2.test,
tests/core/prodor.test, tests/core/randomize.test,
tests/python/automata.ipynb, tests/python/highlighting.ipynb,
tests/python/product.ipynb, tests/python/remfin.py,
tests/python/stutter-inv.ipynb: Adjust.
* NEWS: Mention it.
2018-06-11 15:01:49 +02:00

48 lines
967 B
Python

import spot
# This test used to trigger an assertion (or a segfault)
# in scc_filter_states().
aut = spot.automaton("""
HOA: v1
States: 3
Start: 1
AP: 1 "a"
Acceptance: 1 Inf(0)
--BODY--
State: 0 {0}
[t] 0
State: 1
[!0] 0
[0] 2
State: 2
[t] 2
--END--
""")
aut.prop_inherently_weak(True)
aut = spot.dualize(aut)
aut1 = spot.scc_filter_states(aut)
assert(aut1.to_str('hoa') == """HOA: v1
States: 2
Start: 0
AP: 1 "a"
acc-name: co-Buchi
Acceptance: 1 Fin(0)
properties: trans-labels explicit-labels state-acc deterministic weak
--BODY--
State: 0 {0}
[0] 1
State: 1
[t] 1
--END--""")
assert(aut.scc_filter_states().to_str() == aut1.to_str())
assert(aut1.get_name() == None)
aut1.set_name("test me")
assert(aut1.get_name() == "test me")
# The method is the same as the function
a = spot.translate('true', 'low', 'any')
assert(a.prop_universal().is_maybe())
assert(a.prop_unambiguous().is_maybe())
assert(a.is_deterministic() == True)
assert(a.is_unambiguous() == True)