twa: add support for prop_complete()

* spot/twa/twa.hh: Add support.  Make two constructors for prop_set in
order to diagnose constructions with 5 arguments.
* spot/parseaut/parseaut.yy: Adjust diagnostics for complete and
deterministic.
* spot/tl/exclusive.cc, spot/twa/twagraph.cc,
spot/twaalgos/alternation.cc, spot/twaalgos/complete.cc,
spot/twaalgos/complete.hh, spot/twaalgos/degen.cc,
spot/twaalgos/determinize.cc, spot/twaalgos/hoa.cc,
spot/twaalgos/isdet.cc, spot/twaalgos/mask.cc,
spot/twaalgos/minimize.cc, spot/twaalgos/product.cc,
spot/twaalgos/remfin.cc, spot/twaalgos/remprop.cc,
spot/twaalgos/sbacc.cc, spot/twaalgos/sccfilter.cc,
spot/twaalgos/simulation.cc, spot/twaalgos/strength.cc,
spot/twaalgos/stutter.cc, spot/twaalgos/totgba.cc,
tests/core/parseaut.test, tests/python/product.ipynb: Adjust.
* NEWS, doc/org/concepts.org, doc/org/hoa.org,
doc/org/tut21.org: Document it.
This commit is contained in:
Alexandre Duret-Lutz 2017-03-16 18:25:07 +01:00
parent 90a8a912e0
commit 0de5f50da9
28 changed files with 296 additions and 106 deletions

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2013, 2014, 2015, 2016 Laboratoire de Recherche et
// Développement de l'Epita.
// Copyright (C) 2013-2017 Laboratoire de Recherche et Développement
// de l'Epita.
//
// This file is part of Spot, a model checking library.
//
@ -21,10 +21,12 @@
namespace spot
{
unsigned complete_here(twa_graph_ptr aut)
void complete_here(twa_graph_ptr aut)
{
unsigned n = aut->num_states();
unsigned sink = -1U;
if (aut->prop_complete().is_true())
return;
unsigned n = aut->num_states();
// UM is a pair (bool, mark). If the Boolean is false, the
// acceptance is always satisfiable. Otherwise, MARK is an
@ -126,24 +128,17 @@ namespace spot
}
}
aut->prop_complete(true);
// Get rid of any named property if the automaton changed.
if (t < aut->num_edges())
aut->release_named_properties();
else
assert(t == aut->num_edges());
return sink;
}
twa_graph_ptr complete(const const_twa_ptr& aut)
{
auto res = make_twa_graph(aut, {
true, // state based
true, // inherently_weak
true, // deterministic
true, // improve det
true, // stutter inv.
});
auto res = make_twa_graph(aut, twa::prop_set::all());
complete_here(res);
return res;
}