module Fsm:sig
..end
Reactive Finite State Machines
type
act_semantics =
| |
Sequential |
(* | sequential (ex: | *) |
| |
Synchronous |
(* | synchronous (ex: | *) |
type
fsm_config = {
|
mutable act_sep : |
(* | Default value: | *) |
|
mutable act_sem : |
(* | Default value: | *) |
val cfg : fsm_config
exception Undef_symbol of string * string * string
FSM, kind, name
exception Invalid_state of string * string
FSM, id
exception Typing_error of string * string * Types.typ * Types.typ
what, where, type, type
module State:sig
..end
module TransLabel:sig
..end
module Repr:Lts.T
with type state = State.t and type label = TransLabel.t
typestate =
State.t
typetransition =
State.t * TransLabel.t * State.t
typeitransition =
TransLabel.t * State.t
val string_of_transition : transition -> string
val string_of_state : state -> string
type
model = {
|
fm_name : |
(* | name | *) |
|
fm_params : |
(* | generic parameters | *) |
|
fm_ios : |
(* | i/os | *) |
|
fm_vars : |
(* | internal variables | *) |
|
fm_repr : |
(* | underlying LTS | *) |
type
inst = {
|
f_name : |
|||
|
f_model : |
|||
|
f_params : |
(* | name, type, actual value | *) |
|
f_inps : |
(* | local name, (type, global) | *) |
|
f_outps : |
(* | local name, (type, global) | *) |
|
f_inouts : |
(* | local name, (type, global) | *) |
|
f_vars : |
(* | name, type | *) |
|
f_repr : |
(* | Static representation as a LTS (with _local_ names) | *) |
|
f_l2g : |
(* | local -> global name | *) |
val build_model : name:string ->
states:state list ->
params:(string * Types.typ) list ->
ios:(Types.dir * string * Types.typ) list ->
vars:(string * Types.typ) list ->
trans:(state * (Condition.event * Condition.guard list) * Action.t list *
state * int)
list ->
itrans:state * Action.t list -> model
val build_instance : name:string ->
model:model ->
params:(string * Expr.value) list -> ios:Global.global list -> inst
val states_of : inst -> state list
val istate_of : inst -> state option
val transitions_of : inst -> transition list
val itransitions_of : inst -> itransition list
val succs : inst -> state -> (state * TransLabel.t) list
val input_events_of : inst -> string list
val output_events_of : inst -> string list
val is_rtl : inst -> bool
is_rtl f
is true
iff all is_rtl a
for all actions a
of f
exception Binding_mismatch of string * string * string
FSM, kind, id
exception Invalid_parameter of string * string
FSM, name
exception Uninstanciated_type_vars of string * string * string * string list
type
dot_options =
| |
OmitImplicitTransitions |
| |
GlobalNames |
| |
NoCaption |
val dot_output_oc : Pervasives.out_channel ->
?dot_options:Utils.Dot.graph_style list ->
?options:dot_options list -> inst -> unit
val dot_output : ?fname:string ->
?dot_options:Utils.Dot.graph_style list ->
?options:dot_options list -> dir:string -> inst -> string
dot_output dir f
writes a DOT representation of FSM instance f
in directory dir
.
Returns the name of the written file.
val dot_output_model : ?fname:string ->
?dot_options:Utils.Dot.graph_style list ->
?options:dot_options list -> dir:string -> model -> string
dot_output_model dir m
writes a DOT representation of FSM model m
in directory dir
.
Returns the name of the written file.
val dump_model : Pervasives.out_channel -> model -> unit
val dump_inst : Pervasives.out_channel -> inst -> unit