STLmc Input Model

The input format of STLmc consists of five sections: (i) variable declarations, (ii) mode definitions, (iii) initial conditions, (iv) state propositions, and (v) STL properties. Mode and continuous variables specify discrete and continuous states of hybrid automata. Mode definitions specify flow, jump, and invariant conditions. STL formulas can also include user-defined state propositions.

Variable Declarations. STLmc uses mode and continuous variables to specify discrete and continuous states of a hybrid automaton. Mode variables define a set of discrete modes Q, and continuous variables define a set of real-valued variables X. We can also declare named constants whose values do not change. Mode variables are declared with one of three types: bool variables with true and false values, int variables with integer values, and real variables with real values. For example, in the thermostat model, the following declares two int variables on0 and on1 and two real variables x0 and x1.

int on0;         int on1;
[10, 35] x0; [10, 35] x1;

Mode Definitions. In STLmc, mode blocks define mode, jump, invariant, and flow conditions for a group of modes in a hybrid automaton. Multiple model blocks can be declared, and each mode block consists of four components:

{ mode: ...
  inv:  ...
  flow: ...
  jump: ...
}
  • A mode component contains a semicolon-separated set of Boolean conditions over mode variables.
  • An inv component contains a semicolon-separated set of Boolean formulas over continuous variables.
  • A flow component contains either a system of ordinary differential equations (ODEs) or a closed-form solution of ODEs. In STLmc, a system of ODEs over continuous variables x1, , xn is written as a semicolon-separated equation of the following form, where ei denotes an expression over x1, , xn:

    d/dt[x1] = e1(x1,...,xn) ;
    ...
    d/dt[xn] = en(x1,...,xn) ;
    

    A closed-form solution of ODEs is written as a set of continuous functions, parameterized by a time variable t and the initial values x1(0), , xn(0):

    x1(t) = e1(t, x1(0),...,xn(0)) ;
    ...
    xn(t) = en(t, x1(0),...,xn(0)) ;
    
  • A jump component contains a set of jump conditions guard => reset, where guard and reset are Boolean conditions over mode and continuous variables. We use “primed” variables to denote states after jumps have occurred

For example, the Off0On1 mode is defined as follows:

{ mode: on0 = 0; on1 = 1;
  inv: 10 < x0; x1 < 30;
  flow: d/dt[x0] = - k0 * (c0 * x0 - d0 * x1);
        d/dt[x1] = k1 * (h1 - (c1 * x1 - d1 * x0));
  jump: x0 <= 17 => (and (on0' = 1) (on1' = 0)
                    (x0' = x0) (x1' = x1));
        x1 >= 26 => (and (on1' = 0) (on0' = on0)
                    (x0' = x0) (x1' = x1));
}

Initial Conditions. In the init section, an initial condition is declared as a set of Boolean formulas over mode and continuous variables. For example, the initial conditions 18x0,x122 with on0=0 and on1=0 are defined as follows:

init: on0 = 0;  18 <= x0;  x0 <= 22;
      on1 = 0;  18 <= x1;  x1 <= 22;

STL properties. In the goal section, STL properties are declared with labels. State propositions are arithmetic and relational expressions over mode and continuous variables, and labels can be omitted.
For example, the following declares an STL formula [2,4]((x0x14)[3,10](x0x13)) with label f2:

f2: [][2, 4]((x0 - x1 >= 4) -> <>[3, 10] (x0 - x1 <= -3));

State Propositions. To make it easy to write repeated propositions, “named” state propositions can be declared in the proposition section. For example, the above STL formula can be rewritten using two propositions p1 and p2 as follows:

proposition:
[p1]: x0 - x1 >= 4;
[p2]: x0 - x1 <= -3;

goal:
[f2]: [][2, 4](p1 -> <>[3, 10] p2);