add a --check=stutter-sensitive-example option

* spot/twaalgos/stutter.cc,
spot/twaalgos/stutter.hh (check_stutter_invariance): Add a
find_counterexamples argument.
* spot/twaalgos/hoa.cc: Output accepted-word and rejected-word examples.
* bin/common_aoutput.cc: Handle --check=stutter-sensitive-example.
* NEWS: Mention it.
* tests/core/stutter-tgba.test: Test it.
* doc/org/concepts.org, doc/org/hoa.org: Document accepted-word and
rejected-word named properties.
* bin/man/spot-x.x: Mention that --check=stutter-sensitive-example
ignores SPOT_STUTTER_CHECK.
This commit is contained in:
Alexandre Duret-Lutz 2019-12-03 17:42:32 +01:00
parent 3be394d2eb
commit 44df3c0837
9 changed files with 187 additions and 15 deletions

View file

@ -1132,17 +1132,20 @@ Here is a list of named properties currently used inside Spot:
| key name | (pointed) value type | description |
|---------------------+--------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------|
| ~accepted-word~ | ~std::string~ | a word accepted by the automaton |
| ~automaton-name~ | ~std::string~ | name for the automaton, for instance to display in the HOA format |
| ~product-states~ | ~const spot::product_states~ | vector of pairs of states giving the left and right operands of each state in a product automaton |
| ~original-states~ | ~std::vector<unsigned>~ | original state number before transformation (used by some algorithms like =degeneralize()=) |
| ~original-clauses~ | ~std::vector<unsigned>~ | original DNF clause associated to each state in automata created by =dnf_to_streett()= |
| ~state-names~ | ~std::vector<std::string>~ | vector naming each state of the automaton, for display purpose |
| ~degen-levels~ | ~std::vector<unsigned>~ | level associated to each state by the degeneralization algorithm |
| ~highlight-edges~ | ~std::map<unsigned, unsigned>~ | map of (edge number, color number) for highlighting the output |
| ~highlight-states~ | ~std::map<unsigned, unsigned>~ | map of (state number, color number) for highlighting the output |
| ~incomplete-states~ | ~std::set<unsigned>~ | set of states numbers that should be displayed as incomplete (used internally by ~print_dot()~ when truncating large automata) |
| ~degen-levels~ | ~std::vector<unsigned>~ | level associated to each state by the degeneralization algorithm |
| ~original-clauses~ | ~std::vector<unsigned>~ | original DNF clause associated to each state in automata created by =dnf_to_streett()= |
| ~original-states~ | ~std::vector<unsigned>~ | original state number before transformation (used by some algorithms like =degeneralize()=) |
| ~product-states~ | ~const spot::product_states~ | vector of pairs of states giving the left and right operands of each state in a product automaton |
| ~rejected-word~ | ~std::string~ | a word rejected by the automaton |
| ~simulated-states~ | ~std::vector<unsigned>~ | map states of the original automaton to states if the current automaton in the result of simulation-based reductions |
| ~state-names~ | ~std::vector<std::string>~ | vector naming each state of the automaton, for display purpose |
| ~synthesis-outputs~ | ~bdd~ | conjunction of controllable atomic propositions (used by ~print_aiger()~ to determine which propositions should be encoded as outputs of the circuit) |
Objects referenced via named properties are automatically destroyed
when the automaton is destroyed, but this can be altered by passing a
custom destructor as a third parameter to =twa::set_named_prop()=.

View file

@ -967,6 +967,8 @@ terminal.
:CUSTOM_ID: extensions
:END:
** Highlighting states and edges
Spot supports two additional headers that are not part of the standard
HOA format. These are =spot.highlight.states= and
=spot.highlight.edges=. These are used to [[file:autfilt.org::#decoration][decorate states and edges]]
@ -1105,6 +1107,68 @@ State: 2
--END--
#+END_SRC
** Sample words
When the =--check=stutter-sensitive-example= option is used, and when
a stutter-sensitive automaton is output, two sample words are added to
the HOA output as a proof that the automaton is stutter-sensitive.
One of these words is accepted, the other is rejected, and the two are
stutter-equivalent (i.e., they differ only by some stuttering).
The headers are called =spot.accepted-word= and =spot.rejected-word=
if HOA v1.1 is selected. However since these are also useful to
third-party tools, we also output them as =spot-accepted-word= and
=spot-rejected-word= in HOA v1.
#+BEGIN_SRC sh :wrap SRC hoa
ltl2tgba --check=stutter-sensitive-example -H1 Xa; echo
ltl2tgba --check=stutter-sensitive-example -H1.1 Xa
#+END_SRC
#+RESULTS:
#+begin_SRC hoa
HOA: v1
name: "Xa"
States: 3
Start: 1
AP: 1 "a"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc deterministic
properties: stutter-sensitive terminal
spot-accepted-word: "!a; cycle{a}"
spot-rejected-word: "!a; !a; cycle{a}"
--BODY--
State: 0
[0] 2
State: 1
[t] 0
State: 2 {0}
[t] 2
--END--
HOA: v1.1
name: "Xa"
States: 3
Start: 1
AP: 1 "a"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc !complete
properties: deterministic !stutter-invariant terminal
spot.accepted-word: "!a; cycle{a}"
spot.rejected-word: "!a; !a; cycle{a}"
--BODY--
State: 0
[0] 2
State: 1
[t] 0
State: 2 {0}
[t] 2
--END--
#+end_SRC
#+BEGIN_SRC sh :results silent :exports results
rm -f stvstracc.hoa sba.hoa stvstrlab.hoa decorate.hoa
#+END_SRC