spot/doc/org/randaut.org
Alexandre Duret-Lutz 838bfb2ae3 dotty: colored acceptance sets
This implement several new options for --dot in order to
allow emptiness sets to be output as colored ⓿ or ❶...
Also add a SPOT_DOTDEFAULT environment variable.

* NEWS, src/bin/man/spot-x.x, src/bin/common_aoutput.cc,
src/bin/dstar2tgba.cc: Document the new options.
* doc/org/.dir-locals.el, doc/org/init.el.in: Setup
SPOT_DOTEXTRA and SPOT_DOTDEFAULT for all documents.
* doc/org/autfilt.org, doc/org/dstar2tgba.org, doc/org/ltl2tgba.org,
doc/org/ltldo.org, doc/org/oaut.org, doc/org/randaut.org,
doc/org/satmin.org: Adjust to this new setup.
* src/misc/escape.cc, src/misc/escape.hh (escape_html): New function.
* src/tgba/acc.cc, src/tgba/acc.hh (to_text, to_html): New method.
* src/tgbaalgos/dotty.cc: Implement the new options.
* src/tgbatest/readsave.test, wrap/python/tests/automata.ipynb: More
tests.
* wrap/python/spot.py: Make sure the default argument for
dotty_reachable is None, so that SPOT_DOTDEFAULT is honored.
2015-03-17 19:28:34 +01:00

8.4 KiB

randaut

The randaut tool generates random (connected) automata.

By default, it will generate a random TGBA with 10 states, no acceptance sets, and using a set of atomic proposition you have to supply.

randaut a b

/alarsyo/spot/media/commit/838bfb2ae30cbbdee8d6191da993f05da537ff97/doc/org/randaut1.png

As for randltl, you can supply a number of atomic propositions instead of giving a list of atomic propositions.

States and density

The numbers of states can be controlled using the -S option. This option will accept a range as argument, so for instance -S3..6 will generate an automaton with 3 to 6 states.

The number of edges can be controlled using the -d (or --density) option. The argument should be a number between 0 and 1. In an automaton with $S$ states and density $d$, the degree of each state will follow a normal distribution with mean $1+(S-1)d$ and variance $(S-1)d(1-d)$.

In particular -d0 will cause all states to have 1 successors, and -d1 will cause all states to be interconnected.

randaut -S3 -d0 2

/alarsyo/spot/media/commit/838bfb2ae30cbbdee8d6191da993f05da537ff97/doc/org/randaut2.png

randaut -S3 -d1 2

/alarsyo/spot/media/commit/838bfb2ae30cbbdee8d6191da993f05da537ff97/doc/org/randaut3.png

Acceptance sets

The generation of acceptance sets is controlled with the following three parameters:

  • -A (or --acc-sets) controls the number of acceptance sets. This can be given as a range (e.g. -A1..3) in case you want this number to be picked at random in the range.
  • -a (or --acc-probability) controls the probability that any transition belong to a given acceptance set.
  • --state-acc requests that the automaton use state-based acceptance. In this case, -a is the probability that a state belong to the acceptance set. (Because Spot only deals with transition-based acceptance internally, this options force all transitions leaving a state to belong to the same acceptance sets. But if the output format allows state-acceptance, it will be used.)

In addition, -B (or --ba) is a shorthand for -A1 --state-acc.

randaut -S3 -d0.5 -A3 -a0.5 2

/alarsyo/spot/media/commit/838bfb2ae30cbbdee8d6191da993f05da537ff97/doc/org/randaut4.png

randaut -S3 -d0.4 -B -a0.7 2

/alarsyo/spot/media/commit/838bfb2ae30cbbdee8d6191da993f05da537ff97/doc/org/randaut5.png

Determinism

The output can only contain a single edge between two given states. By default, the label of this edge is a random assignment of all atomic propositions. Two edges leaving the same state may therefore have the same label.

If the -D (or --deterministic) option is supplied, the labels are generated differently: once the degree $m$ of a state has been decided, the algorithm will compute a set of $m$ disjoint Boolean formulas over the given atomic propositions, such that the sum of all these formulas is $\top$. The resulting automaton is therefore deterministic and complete.

randaut -D -S3 -d0.6 -A2 -a0.5 2

/alarsyo/spot/media/commit/838bfb2ae30cbbdee8d6191da993f05da537ff97/doc/org/randaut6.png

Note that in a deterministic automaton with $a$ atomic propositions, it is not possible to have states with more than $2^a$ successors. If the combination of -d and -S allows the situation where a state can have more than $2^a$ successors, the degree will be clipped to $2^a$. When working with random deterministic automata over $a$ atomic propositions, we suggest you always request more than $2^a$ states.

Output formats

The output format can be controlled using the common output options like --hoaf, --dot=, --lbtt, and --spin. Note that --spin automatically implies --ba.

Generating a stream of automata

Use option -n to specify a number of automata to build. A negative value will cause an infinite number of automata to be produced. This generation of multiple automata is probably useful only with --hoaf, when piped to another tool that can read this format and process automata in batches.