class ggsolver.interfaces.i_spot.SpotAutomaton(formula=None, options=None)[source]

SpotAutomaton constructs an Automaton from an LTL specification string using spot ( with customizations for ggsolver.

Customizations: Since ggsolver contains several algorithms for reactive/controller synthesis, we prefer to construct deterministic automata. Given an LTL formula, SpotAutomaton automatically determines the best acceptance condition that would result in a deterministic automaton..

Programmer’s note: The graphified version of automaton does not use PL formulas as edge labels. This is intentionally done to be able to run our codes on robots that may not have logic libraries installed.

__init__(formula=None, options=None)[source]

Given an LTL formula, SpotAutomaton determines the best options for spot.translate() function to generate a deterministic automaton in ggsolver.Automaton format.

  • formula – (str) LTL formula.

  • options – (List/Tuple of str) Valid options for spot.translate() function. By default, the value is None, in which case, the options are determined automatically. See description below.

Default translation options: While constructing an automaton using spot, we use the following options: deterministic, high, complete, unambiguous, SBAcc. If selected acceptance condition is parity, then we use colored option as well.

The default options can be overriden. For quick reference, the following description is copied from spot documentation (

The optional arguments should be strings among the following: - at most one in ‘GeneralizedBuchi’, ‘Buchi’, or ‘Monitor’, ‘generic’, ‘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’ (optimization level)

  • any combination of ‘Complete’, ‘Unambiguous’, ‘StateBasedAcceptance’ (or ‘SBAcc’ for short), and ‘Colored’ (only for parity acceptance)


Determines the options based on where the given LTL formula lies in Manna-Pnueli hierarchy.


Returns acceptance condition according to ggsolver definitions: See ACC_REACH, … variables in Automaton class. See SpotAutomaton.spot_acc_cond() for acceptance condition in spot’s nomenclature.


Name of acceptance condition as per spot’s nomenclature.


Atomic propositions appearing in LTL formula.

delta(state, inp)[source]

Transition function of automaton. For a deterministic automaton, returns a single state. Otherwise, returns a list/tuple of states.

  • state – (object) A valid state.

  • inp – (list) List of atoms that are true (an element of sigma).

classmethod deserialize(obj_dict)

Constructs a graphical model from a serialized graph object. The node properties are deserialized as state properties, the edge properties are deserialized as transition properties, and the graph properties are deserialized as model properties. All the deserialized properties are represented as a function in the GraphicalModel class. See example #todo.

The format is described in GraphicalModel.serialize().


(Sub-class of GraphicalModel) An instance of the cls class. cls must be a sub-class of GraphicalModel.


Maps every state to its acceptance set.


The LTL Formula.


Initial state of automaton.


Is the automaton complete?


Is the automaton deterministic?


Is it the case that accepting and rejecting cycles cannot be mixed in the same SCC?


Is the automaton semi-deterministic? See


Is the acceptance condition state-based?


The property recognized by the automaton is stutter-invariant (see


Automaton is weak, accepting SCCs are complete, accepting edges may not go to rejecting SCCs. An automaton is weak if the transitions of an SCC all belong to the same acceptance sets.



There is at most one run accepting a word (but it might be recognized several time). See


Are transitions of an SCC all belong to the same acceptance sets?


Number of acceptance sets.


Serializes the underlying graph of the graphical model into a dictionary with the following format. The state properties are saved as node properties, transition properties are stored are edge properties and model properties are stored as graph properties in the underlying graph:

    "graph": {
        "nodes": <number of nodes>,
        "edges": {
            uid: {vid: key},
        "node_properties": {
            "property_name": {
                "default": <value>,
                "dict": {
                    "uid": <property value>,
        "edge_properties": {
            "property_name": {
                "default": <value>,
                "dict": [{"edge": [uid, vid, key], "pvalue": <property value>} ...]
        "graph_properties": {
            "property_name": <value>,

(dict) Serialized graphical model.


Returns the set of alphabet of automaton. It is the powerset of atoms().


Acceptance condition in spot’s nomenclature.


States of automaton.