print · login   

StatemachineLib

Statemachinelib is a java library which has two user interface frontends:

  • commandline interface with the stm command
    a convenient tool to quickly get info about a model and to convert it to another type of model or another file format. It also allows you to quickly compare whether two deterministic models are equivalent.
  • a GUI program called StatemachineLib.
    the GUI program does the same functionality as the commandline program and then it lets you interactive view,edit and trace models.

Fig. 1: StatemachineLib GUI

Install the GUI application 'StatemachineLib' and 'stm' command by

  1. first install graphviz from https://graphviz.org/download/ The dot command is needed to layout models in the GUI.
  2. then install the installation package:

This is a beta release because the GUI is pretty new. We appreciate any feedback on bugs or wanted features. You can send them to h.kuppens@cs.ru.nl. Currently we are still working on improvements such as better label placement, and making a nice view using smooth edges instead of polylines.

After installing the stm command is directly available for any new shell.

  • for both Linux and Macos the stm command is installed at /usr/local/bin/stm. Normally for the bash/zsh shell the path /usr/local/bin/ is in the default PATH environment variable and therefore the 'stm' command can directly be used after installation.
  • for the Windows installation the application's path (C:\Program Files\StateMachineLib\) is directly set in the windows PATH environment variable in the windows registry, so any new process should directly have this new PATH.

The libary and its frontends support the following functionality:

  • models: Finite Acceptors(DFA/NFA), Moore machines, Mealy machines, Interface automata (in the future possibly also EFSMs and timed models)
  • these models:
    • are immutable in java
    • can easily be build in java using a builder
  • export and import for the models to the following file formats : dot, graphml, mermaid, markdown(mermaid), plantuml.
  • using the stm convert command we can easily convert a model file from one format to another format on the commandline.
  • the library's setup is designed to easily add custom models and file formats. We intend to implement to also add timed and extended statemachine to the library.
  • checking equivalence between models
  • several translations between models, as described in our paper. Some examples:
    • a DFA can be translated to a Moore machine
    • a Moore machine can be translated into a DFA if we supply accepting and rejecting subsets for the Moore machine outputs
    • a Moore machine can be translated into a Mealy machine
    • a Mealy machine can be translated into a Moore machine
    • a Mealy machine can be translated into an Interface Automaton
    • a Mealy machine can be translated into an Interface Automaton
    • a (deterministic) Interface Automaton can be converted to a DFA
    • if a Mealy machine is represented as an interface automaton then we can convert it back to a Mealy machine model
    • DFA and Mealy machine models in statemachinelib can be converted to their corresponding models in automatalib which is used by learnlib

The 'stm' commandline tool supports the following subcommands: (will be extended in the future)

    $ stm --help                                                                                                                                                                         
    usage: stm [-h]   ...

    statemachine tool

    named arguments:
      -h, --help             show this help message and exit

    subcommands:

        translate            translate to different type of statemachine
        compare              compare two statemachine models for equivalence
        convert              convert the file format of the statemachine model
        info                 displays information about the statemachine:
                             number of states, number of transitions,  ...
        gui                  open the  statemachine  GUI  (view/edit/simulate a
                             model)