Skip to content

Generation of Random Automata

Edi Muškardin edited this page Sep 13, 2022 · 4 revisions

When testing our algorithms or equivalence oracles, we would like to have a wide selection of systems under learning, or in the simplest case, automata. It is important to note, that generated automata are not necessarily minimal.

Therefore, with AALpy, you can generate a random automaton for any supported formalism. You simply define the number of states, size of the input (and where applicable output) alphabet. For some formalisms, there are some other miscellaneous options available.

A short case study was conducted on many random automata and results can be seen in the Evaluation section.


So let us explain all possible functions and their parameters. They are imported from aalpy.utils import <function_name>

generate_random_dfa

  • num_states: number of states
  • alphabet: input alphabet
  • num_accepting_states: number of accepting states (Default value = 1)
  • compute_prefixes: if True, shortest path to reach each state will be computed (Default value = False)
  • ensure_minimality: if True, random automaton will be minimal, otherwise it could be non-minimal

generate_random_moore_machine and generate_random_mealy_machine

  • num_states- number of states in the randomly generated automaton
  • input_alphabet: input alphabet
  • output_alphabet: output alphabet
  • compute_prefixes: if True, shortest path to reach each state will be computed (Default value = False)
  • ensure_minimality: if True, random automaton will be minimal, otherwise it could be non-minimal

generate_random_ONFSM

  • num_states: number of states
  • num_inputs: number of inputs
  • num_outputs: number of outputs
  • multiple_out_prob: probability that state will have multiple outputs (Default value = 0.1)

generate_random_mdp

  • num_states: number of states
  • len_input: number of inputs
  • num_unique_outputs: number of outputs

For more details, check out the