SAFIRE
 
Variables


An FSM type can contain variable declarations.  This greatly reduces the number of states needed to encode the FSM's behavior.  For instance, without variables an FSM modeling an elevator would need a state for every floor ("stopped at 1st floor", "stopped at 2nd floor", etc.).  With variables, only one state is needed for a stopped elevator ("stopped at floor N", where N is an integer).
 

Each instance of an FSM type has its own set of variables.  Variables are not shared among FSMs.  To share data, signals must be sent.

 

Previously defined data types can be used as variables.