dtwasat: various fixes

* spot/twaalgos/dtwasat.cc: Do not return a transition-based automaton
when state-based output is requested.
* tests/python/satmin.ipynb, spot/twaalgos/dtbasat.hh: Fix some typos.
* tests/python/satmin.py: Add test cases.
* NEWS: Mention the bugs.
This commit is contained in:
Alexandre Duret-Lutz 2021-09-29 16:47:03 +02:00
parent fea0be96c1
commit ee80849caf
5 changed files with 32 additions and 11 deletions

View file

@ -1925,7 +1925,7 @@
"source": [
"How did the procedure look for a complete automaton of size 5 when the input had only 2 states? It's because the input uses transition-based acceptance: to estimate an upper bound of the size of the state-based output, the `sat_minimize()` procedure converted its transition-based input to state-based acceptance (using the `spot.sbacc()` function) and counted the number of states in the result.\n",
"\n",
"Such an estimate is not necessarily correct of we request a different acceptance condition. In that case We can actually change the upper-bound using `max_states`. Below we additionally demonstrate the use of the `colored` option, to request all transition to belong to exactly one set, as customary in parity automata."
"Such an estimate is not necessarily correct if we request a different acceptance condition. In that case we can actually change the upper-bound using `max_states`. Below we additionally demonstrate the use of the `colored` option, to request all transitions to belong to exactly one set, as customary in parity automata."
]
},
{
@ -4253,7 +4253,7 @@
"source": [
"### `states`\n",
"\n",
"Sometimes we do not want a minimization loop, we just want to generate an equivalent automaton with a given number of states. In that case, we use the `states` option. However there is no constraint that all state should be reachable, so in the end, you could end with an automaton with fewer states than requested."
"Sometimes we do not want a minimization loop, we just want to generate an equivalent automaton with a given number of states. In that case, we use the `states` option. However there is no constraint that all states should be reachable, so in the end, you could end with an automaton with fewer states than requested."
]
},
{
@ -4588,7 +4588,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1+"
"version": "3.9.2"
}
},
"nbformat": 4,

View file

@ -1,5 +1,5 @@
# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2015, 2020 Laboratoire de Recherche et Développement
# Copyright (C) 2015, 2020, 2021 Laboratoire de Recherche et Développement
# de l'Epita
#
# This file is part of Spot, a model checking library.
@ -237,3 +237,13 @@ min4 = spot.sat_minimize(aut, acc='parity max odd 3',
colored=True, sat_naive=True)
assert min4.num_sets() == 3
assert min4.num_states() == 2
aut = spot.translate('GFa')
assert aut.num_sets() == 1
assert aut.num_states() == 1
assert aut.is_deterministic()
out = spot.sat_minimize(aut, state_based=True)
assert out.num_states() == 2
out = spot.sat_minimize(aut, state_based=True, max_states=1)
assert out is None