Commit 6459877a authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

overhaul the stutter-invariance checks

* spot/twaalgos/stutter.cc, spot/twaalgos/stutter.hh: Cleanup and
document the api.
* spot/twa/twa.hh, doc/mainpage.dox: Add a stutter-invariant section.
* tests/python/stutter-inv-states.ipynb: Rename as ...
* tests/python/stutter-inv.ipynb: ... this, and add more comments.
* tests/Makefile.am, doc/org/tut.org: Adjust renaming.
* bench/stutter/stutter_invariance_randomgraph.cc,
bench/stutter/stutter_invariance_formulas.cc,
bench/stutter/Makefile.am: Make it compile again.
* bin/autfilt.cc: Call inplace variants.
* NEWS: Mention the overhaul.
parent 2222661f
......@@ -126,6 +126,10 @@ New in spot 2.4.1.dev (not yet released)
can be passed to disable this behavior (or use -x degen-remscc=0
from the command-line).
- The functions for detecting stutter-invariant formulas or automata
have been overhauled. Their interface changed slightly. They are
now fully documented.
- In addition to detecting stutter-invariant formulas/automata, some
can now study a stutter-sensitive automaton and detect the subset
of states that are stutter-invariant. See
......@@ -146,6 +150,14 @@ New in spot 2.4.1.dev (not yet released)
spot::scc_info::marks(), spot::scc_info::marks_of() and
spot::scc_info::acc_sets_of() respectively.
Backward incompatible changes:
- The spot::closure(), spot::sl2(), spot::is_stutter_invariant()
functions no longuer takes && arguments. The former two have
spot::closure_inplace() and spot::sl2_inplace() variant. These
function also do not take to list of atomic propositions as an
argument anymore.
Bugs fixed:
- Automata produced by "genaut --ks-nca=N" were incorrectly marked
......
## -*- coding: utf-8 -*-
## Copyright (C) 2014, 2015 Laboratoire de Recherche et Développement
## Copyright (C) 2014, 2015, 2017 Laboratoire de Recherche et Développement
## de l'Epita (LRDE).
##
## This file is part of Spot, a model checking library.
......@@ -24,7 +24,8 @@ AM_CXXFLAGS = $(WARNING_CXXFLAGS)
LDADD = \
$(top_builddir)/bin/libcommon.a \
$(top_builddir)/lib/libgnu.la \
$(top_builddir)/spot/libspot.la
$(top_builddir)/spot/libspot.la \
$(top_builddir)/buddy/src/libbddx.la
bin_PROGRAMS = stutter_invariance_randomgraph \
stutter_invariance_formulas
......
// -*- coding: utf-8 -*-
// Copyright (C) 2014, 2015, 2016 Laboratoire de Recherche et
// Copyright (C) 2014, 2015, 2016, 2017 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
......@@ -66,9 +66,8 @@ namespace
spot::twa_graph_ptr a = trans.run(f);
spot::twa_graph_ptr na = trans.run(spot::formula::Not(f));
spot::atomic_prop_set* ap = spot::atomic_prop_collect(f);
bdd apdict = spot::atomic_prop_collect_as_bdd(f, a);
std::cout << formula << ',' << ap->size() << ',';
delete ap;
stats.print(a);
stats.print(na);
......@@ -82,9 +81,9 @@ namespace
sw.start();
bool res = spot::is_stutter_invariant(std::move(dup_a),
std::move(dup_na),
apdict, algo);
algo);
auto time = sw.stop();
std::cout<< time << ',';
std::cout << time << ',';
if (algo > 1 && prev != res)
{
......@@ -96,7 +95,6 @@ namespace
prev = res;
}
std::cout << prev << '\n';
delete ap;
return 0;
}
};
......
// -*- coding: utf-8 -*-
// Copyright (C) 2014, 2015 Laboratoire de Recherche et
// Copyright (C) 2014, 2015, 2017 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
......@@ -77,8 +77,7 @@ main(int argc, char** argv)
do
{
spot::srand(++seed);
a = spot::random_graph(states_n, d, &ap, dict, 2, 0.1, 0.5,
true);
a = spot::random_graph(states_n, d, &ap, dict, 2, 0.1, 0.5, true);
}
while (a->is_empty());
auto na = spot::remove_fin(spot::dualize(a));
......@@ -102,7 +101,7 @@ main(int argc, char** argv)
sw.start();
bool res = spot::is_stutter_invariant(std::move(dup_a),
std::move(dup_na),
apdict, algo);
algo);
auto time = sw.stop();
std::cout << time;
if (algo > 1 && res != prev)
......
......@@ -1160,11 +1160,11 @@ namespace
aut = opt->excl_ap.constrain(aut, false);
if (opt_destut)
aut = spot::closure(std::move(aut));
aut = spot::closure_inplace(std::move(aut));
if (opt_instut == 1)
aut = spot::sl(std::move(aut));
else if (opt_instut == 2)
aut = spot::sl2(std::move(aut));
aut = spot::sl2_inplace(std::move(aut));
if (!opt_keep_states.empty())
aut = mask_keep_accessible_states(aut, opt_keep_states,
......
......@@ -19,11 +19,12 @@
///
/// \section pointers Handy starting points
///
/// \li spot::formula Base class for an LTL or PSL formula.
/// \li spot::formula Base class for an LTL or PSL formula.
/// \li spot::parse_infix_psl() Parsing a text string into a
/// spot::formula.
/// \li spot::twa Base class for Transition-based
/// ω-Automata.
/// \li spot::twa_algorithms Algorithms on ω-Automata.
/// \li spot::translator Convert a spot::formula into a
/// spot::twa.
/// \li spot::kripke Base class for Kripke structures.
......
......@@ -83,4 +83,4 @@ real notebooks instead.
- [[https://spot.lrde.epita.fr/ipynb/atva16-fig2a.html][=atva16-fig2a.ipynb=]] first example from our [[https://www.lrde.epita.fr/~adl/dl/adl/duret.16.atva2.pdf][ATVA'16 tool paper]].
- [[https://spot.lrde.epita.fr/ipynb/atva16-fig2b.html][=atva16-fig2b.ipynb=]] second example from our [[https://www.lrde.epita.fr/~adl/dl/adl/duret.16.atva2.pdf][ATVA'16 tool paper]].
- [[https://spot.lrde.epita.fr/ipynb/alternation.html][=alternation.ipynb=]] examples of alternating automata.
- [[https://spot.lrde.epita.fr/ipynb/stutter-inv-states.html][=stutter-inv-states.ipynb=]] detecting stutter-invariant formulas and states.
- [[https://spot.lrde.epita.fr/ipynb/stutter-inv.html][=stutter-inv.ipynb=]] working with stutter-invariant formulas properties.
......@@ -1687,6 +1687,9 @@ namespace spot
/// \addtogroup twa_io Input/Output of TωA
/// \ingroup twa_algorithms
/// \addtogroup stutter_inv Stutter-invariance checks
/// \ingroup twa_algorithms
/// \addtogroup twa_ltl Translating LTL formulas into TωA
/// \ingroup twa_algorithms
......
This diff is collapsed.
This diff is collapsed.
......@@ -333,7 +333,7 @@ TESTS_ipython = \
python/product.ipynb \
python/randaut.ipynb \
python/randltl.ipynb \
python/stutter-inv-states.ipynb \
python/stutter-inv.ipynb \
python/testingaut.ipynb \
python/word.ipynb
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment