add a stutter-invariant property to automata

... and show it in the HOA output.  Fixes #60.

* src/tgba/tgba.hh: Add is_stutter_invariant().
* src/tgbaalgos/hoa.cc: Print stutter-invariant
and inherently-weak.
* src/tgbaalgos/ltl2tgba_fm.cc: Set both.
* src/tgbaalgos/are_isomorphic.cc, src/tgbaalgos/complete.cc,
src/tgbaalgos/degen.cc, src/tgbaalgos/dtgbacomp.cc,
src/tgbaalgos/mask.cc, src/tgbaalgos/minimize.cc,
src/tgbaalgos/remfin.cc, src/tgbaalgos/sccfilter.cc,
src/tgbaalgos/simulation.cc, src/tgbaalgos/stutter.cc,
src/tgbatest/hoaparse.test, src/tgbatest/ltldo.test,
src/tgbatest/monitor.test, src/tgbatest/randomize.test,
src/tgbatest/remfin.test, src/tgbatest/sbacc.test: Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2015-02-28 16:44:06 +01:00
parent 566118a5be
commit 1f0bb428b0
19 changed files with 110 additions and 40 deletions

View file

@ -22,6 +22,7 @@
#include <ostream>
#include <sstream>
#include <cstring>
#include <map>
#include "tgba/tgba.hh"
#include "tgba/tgbagraph.hh"
@ -296,19 +297,41 @@ namespace spot
os << aut->acc().get_acceptance();
os << nl;
os << "properties:";
// Make sure the property line is not too large,
// otherwise our test cases do not fit in 80 columns...
unsigned prop_len = 60;
auto prop = [&](const char* str)
{
if (newline)
{
auto l = strlen(str);
if (prop_len < l)
{
prop_len = 60;
os << "\nproperties:";
}
prop_len -= l;
}
os << str;
};
implicit_labels = md.use_implicit_labels;
if (implicit_labels)
os << " implicit-labels";
prop(" implicit-labels");
else
os << " trans-labels explicit-labels";
prop(" trans-labels explicit-labels");
if (acceptance == Hoa_Acceptance_States)
os << " state-acc";
prop(" state-acc");
else if (acceptance == Hoa_Acceptance_Transitions)
os << " trans-acc";
prop(" trans-acc");
if (md.is_complete)
os << " complete";
prop(" complete");
if (md.is_deterministic)
os << " deterministic";
prop(" deterministic");
if (aut->is_stutter_invariant())
prop(" stutter-invariant");
if (aut->is_inherently_weak())
prop(" inherently-weak");
os << nl;
// If we want to output implicit labels, we have to