package rfsm
Module Rfsm.SimulSource
The simulator
type context = {c_date : Types.date;c_inputs : (string * (Types.typ * Expr.value)) list;c_outputs : (string * (Types.typ * Expr.value)) list;c_fns : (string * (Types.typ * Expr.value)) list;c_csts : (string * (Types.typ * Expr.value)) list;c_vars : (string * (Types.typ * Expr.value)) list;c_evs : (string * (Types.typ * Expr.value)) list;c_fsms : Dynamic.fsm list * Dynamic.fsm list;
}react t ctx stimuli computes a global reaction in ctx at time t given a set of stimuli stimuli, producing an updated context ctx' and a set of responses resps. The (operational) semantics is that of StateCharts. A reaction is viewed as a (finite) sequence of "micro-reactions". Each micro-reaction can generate stimuli which can trigger another micro-reaction (the related stimuli are here called "reentrant". However, a given FSM can only react once during a sequence of micro-reactions (this is implemented by partitionning FSMs into active/inactive subsets during a reaction. A reaction ends when all the micro-reactions have taken place, i.e. when the last one did not produce any further re-entrant stimulus.
run m runs a simulation of system m, returning the final context and a list of timed responses