Module Fsm

type ('state, 'context) rule = {
  1. from : 'state;
  2. label : string;
  3. guard : 'context -> int -> bool;
  4. target : 'state;
}
type ('state, 'context) machine = ('state, 'context) rule list
type 'state run = {
  1. state : 'state;
  2. since : int;
  3. fired : string option;
}
val start : 'state -> 'state run
val step : ('state, 'context) machine -> 'context -> 'state run -> 'state run
val after : int -> 'context -> int -> bool
val states : ('state, 'context) machine -> 'state list