dot, hoa: default to "k" for kripke structure

* spot/twaalgos/dot.cc, spot/twaalgos/hoa.cc: If a Kripke
structure is passed, automatically enable the "k" option.
* tests/core/parse_print_test.cc, tests/ltsmin/modelcheck.cc,
tests/python/ltsmin.ipynb: Remove the explicit use of "k".
* NEWS: Mention the change.
This commit is contained in:
Alexandre Duret-Lutz 2016-02-01 18:49:09 +01:00
parent a9b4560f3d
commit 02b5460b91
6 changed files with 155 additions and 126 deletions

View file

@ -31,6 +31,7 @@
#include <spot/twa/formula2bdd.hh>
#include <spot/twaalgos/copy.hh>
#include <spot/twaalgos/sccinfo.hh>
#include <spot/kripke/kripke.hh>
#include <cstdlib>
#include <cstring>
#include <algorithm>
@ -663,6 +664,9 @@ namespace spot
const char* options)
{
dotty_output d(os, options);
// Enable automatic state labels for Kripke structure.
if (std::dynamic_pointer_cast<const kripke>(g))
d.parse_opts("k");
auto aut = std::dynamic_pointer_cast<const twa_graph>(g);
if (!aut || (d.max_states_given() && aut->num_states() >= d.max_states()))
aut = copy(g, twa::prop_set::all(), true, d.max_states() - 1);