spot/doc/org/tut31.org
Alexandre Duret-Lutz 2a308182db dot: make "a" the default
Fixes #319.

* spot/twaalgos/dot.cc: Enable "a" by default.
* bin/common_aoutput.cc, NEWS: Document it.
* doc/org/autfilt.org, doc/org/concepts.org, doc/org/dstar2tgba.org,
doc/org/hierarchy.org, doc/org/ltl2tgba.org, doc/org/oaut.org,
doc/org/randaut.org, doc/org/satmin.org, doc/org/tut23.org,
doc/org/tut24.org, doc/org/tut30.org, doc/org/tut31.org: Adjust or
simplify the documentation.
* tests/core/det.test, tests/core/dstar.test, tests/core/monitor.test,
tests/core/neverclaimread.test, tests/core/readsave.test,
tests/core/tgbagraph.test, tests/core/wdba.test,
tests/python/_autparserr.ipynb, tests/python/automata-io.ipynb,
tests/python/automata.ipynb, tests/python/highlighting.ipynb
tests/python/ltsmin-dve.ipynb, tests/python/ltsmin-pml.ipynb,
tests/python/product.ipynb, tests/python/testingaut.ipynb,
tests/python/word.ipynb: Adjust test cases.
2018-03-10 23:23:51 +01:00

3.4 KiB

Alternation removal

Consider the following alternating co-Büchi automaton (see how to create it):

HOA: v1
States: 3
Start: 0
AP: 1 "a"
acc-name: co-Buchi
Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels trans-acc complete
properties: deterministic
--BODY--
State: 0
[0] 0
[!0] 0&1
State: 1
[!0] 1 {0}
[0] 2
State: 2
[t] 2
--END--

/alarsyo/spot/media/commit/0ec5ebac3fb4a6ec845565f037bf54efe79797b3/doc/org/tut31in.svg

Our goal is to transform this alternating automaton into a non-alternating automaton.

Alternation support in Spot should be considered as experimental. Currently, alternation removal is only supported for weak alternating automata, i.e., SCCs should have all there transitions in the same acceptance marks. The remove_alternation() procedure of Spot will produce a TGBA for weak input, but the smallest automata are obtained if the input is very-weak.

Shell

We simply use autfilt with option --tgba:

autfilt --tgba tut31.hoa
HOA: v1
States: 2
Start: 0
AP: 1 "a"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels trans-acc complete
properties: deterministic
--BODY--
State: 0
[!0] 0 {0}
[0] 1 {0}
State: 1
[0] 1 {0}
[!0] 1
--END--

/alarsyo/spot/media/commit/0ec5ebac3fb4a6ec845565f037bf54efe79797b3/doc/org/tut31out.svg

Python

In the Python version we call remove_alternation()

import spot
aut = spot.remove_alternation(spot.automaton('tut31.hoa'))
print(aut.to_str('hoa'))
HOA: v1
States: 2
Start: 0
AP: 1 "a"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels trans-acc complete
properties: deterministic
--BODY--
State: 0
[0] 0 {0}
[!0] 1 {0}
State: 1
[0] 0 {0}
[!0] 1
--END--

C++

The C++ version calls remove_alternation() too.

  #include <iostream>
  #include <spot/parseaut/public.hh>
  #include <spot/twaalgos/alternation.hh>
  #include <spot/twaalgos/hoa.hh>

  int main()
  {
    spot::parsed_aut_ptr pa = parse_aut("tut31.hoa", spot::make_bdd_dict());
    if (pa->format_errors(std::cerr))
      return 1;
    if (pa->aborted)
      {
        std::cerr << "--ABORT-- read\n";
        return 1;
      }
    auto aut = spot::remove_alternation(pa->aut);
    spot::print_hoa(std::cout, aut) << '\n';
    return 0;
  }
HOA: v1
States: 2
Start: 0
AP: 1 "a"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels trans-acc complete
properties: deterministic
--BODY--
State: 0
[0] 0 {0}
[!0] 1 {0}
State: 1
[0] 0 {0}
[!0] 1
--END--