Code generation for finite automata
Engee supports code generation for the Chart block. The Chart block allows describing state diagrams, transition graphs and their combinations. The Engee finite automata library is an effective tool for developing such custom algorithms for target devices where complex constructions of conditions, loops and switches need to be used.
The following Julia language constructs are supported in the states, actions, and conditions of the Chart block by the Engee code generator:
-
if-else/elseif
operator -
while
operator -
Operator
for … in M:N
-
Arithmetic operators
+
and-
(unary and binary),*
,/
,%
-
Logical operators
&&
,|||
and!
. -
Comparison operators
<
,<=
,>
,>=
,==
,!=
(only binary operators with two operands are supported)
Supported by the Engee code generator features of the Chart block:
-
Unconditional and conditional transitions
-
Input, local, output variables of type
v
(represented by typeFloat64
in Julia) -
Several unrelated state diagrams, transition graphs
-
Several instructions written in one line with a separator (
;
) in the body of transition actions and in states -
Multi-line instructions in states
-
Groups of operators
entry
,during
,exit
,on
. -
Abbreviations of Chart operator groups (
en
,du
,ex
) -
Temporal logic operators
after
,at
,before
,elapsed
,et
,every
,t
,temporalCount
. -
Functions
floor(Int64,…)
andceil(Int64,…)
-
Commenting in states, condition bodies and actions of transitions
-
Support for Backtracking mechanism (when there are intermediate nodes between states)
-
Support for supertransition mechanism when transitions between states cross block-state boundaries. These can be transitions between:
-
an external state and its nested state when the nesting depth is greater than one;
-
nested states of two different external states that are not nested into each other.
-
-
By default supertransitions are also supported, where the supertransition does not start in the parent state, but comes from outside the parent state.