postprocess, translate: add support for Büchi (not state-based)
spot/twaalgos/postproc.hh: Introduce options Buchi and GeneralizedBuchi. The latter is similar to TGBA but the former differs from BA in that it does not imply state-based acceptance, since that can be specified separately. Also all other acceptance types are not abbreviated, so those new names make more sense. * NEWS: Mention that. * spot/twaalgos/postproc.cc, spot/twaalgos/translate.cc: Adjust to support Buchi and GeneralizedBuchi without breaking BA and TGBA. * bin/autfilt.cc, bin/common_aoutput.cc, bin/common_post.cc, bin/ltl2tgta.cc, doc/org/tut10.org, doc/org/tut12.org, doc/org/tut30.org, python/spot/__init__.py, tests/python/automata.ipynb, tests/python/langmap.py, tests/python/misc-ec.py, tests/python/satmin.ipynb, tests/python/satmin.py, tests/python/toweak.py: Use the new names. * tests/Makefile.am: Add missing langmap.py.
This commit is contained in:
parent
72c492b0cf
commit
9cc1bdf10f
19 changed files with 274 additions and 201 deletions
|
|
@ -94,11 +94,11 @@ The Python version uses the =postprocess()= routine:
|
|||
|
||||
#+BEGIN_SRC python :wrap SRC hoa
|
||||
import spot
|
||||
aut = spot.automaton('tut30.hoa').postprocess('BA', 'deterministic')
|
||||
aut = spot.automaton('tut30.hoa').postprocess('buchi', 'sbacc', 'deterministic')
|
||||
print(aut.to_str('hoa'))
|
||||
#+END_SRC
|
||||
#+RESULTS:
|
||||
#+BEGIN_SRC hoa
|
||||
#+begin_SRC hoa
|
||||
HOA: v1
|
||||
States: 5
|
||||
Start: 1
|
||||
|
|
@ -106,7 +106,7 @@ AP: 1 "p1"
|
|||
acc-name: Buchi
|
||||
Acceptance: 1 Inf(0)
|
||||
properties: trans-labels explicit-labels state-acc complete
|
||||
properties: deterministic weak
|
||||
properties: deterministic terminal
|
||||
--BODY--
|
||||
State: 0 {0}
|
||||
[t] 0
|
||||
|
|
@ -122,7 +122,7 @@ State: 4
|
|||
[!0] 0
|
||||
[0] 4
|
||||
--END--
|
||||
#+END_SRC
|
||||
#+end_SRC
|
||||
|
||||
The =postprocess()= function has an interface similar to
|
||||
[[file:tut10.org][the =translate()= function discussed previously]]:
|
||||
|
|
@ -145,10 +145,10 @@ postprocess(automaton, *args, formula=None, xargs=None)
|
|||
not already 'Deterministic'.
|
||||
|
||||
The optional arguments should be strings among the following:
|
||||
- at most one in 'Generic', 'TGBA', 'BA', or 'Monitor',
|
||||
'parity', 'parity min odd', 'parity min even',
|
||||
'parity max odd', 'parity max even' (type of automaton to
|
||||
build), 'coBuchi'
|
||||
- at most one in 'Generic', 'GeneralizedBuchi', 'Buchi', or
|
||||
'Monitor', 'parity', 'parity min odd', 'parity min even',
|
||||
'parity max odd', 'parity max even', 'coBuchi'
|
||||
(type of acceptance condition to build)
|
||||
- at most one in 'Small', 'Deterministic', 'Any'
|
||||
(preferred characteristics of the produced automaton)
|
||||
- at most one in 'Low', 'Medium', 'High'
|
||||
|
|
@ -195,8 +195,9 @@ automaton to process.
|
|||
return 1;
|
||||
}
|
||||
spot::postprocessor post;
|
||||
post.set_type(spot::postprocessor::BA);
|
||||
post.set_pref(spot::postprocessor::Deterministic);
|
||||
post.set_type(spot::postprocessor::Buchi);
|
||||
post.set_pref(spot::postprocessor::SBAcc
|
||||
| spot::postprocessor::Deterministic);
|
||||
post.set_level(spot::postprocessor::High);
|
||||
auto aut = post.run(pa->aut);
|
||||
spot::print_hoa(std::cout, aut) << '\n';
|
||||
|
|
@ -213,7 +214,7 @@ AP: 1 "p1"
|
|||
acc-name: Buchi
|
||||
Acceptance: 1 Inf(0)
|
||||
properties: trans-labels explicit-labels state-acc complete
|
||||
properties: deterministic very-weak
|
||||
properties: deterministic terminal
|
||||
--BODY--
|
||||
State: 0 {0}
|
||||
[t] 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue