fsml

A library for describing and describing synchronous finite state machines
IN THIS PACKAGE
Module Fsml . Expr

Simple (int) expressions for FSMs

type ident = string

The type of identifiers occuring in expressions

val ident_to_yojson : ident -> Yojson.Safe.t
type t = {
e_desc : e_desc;
mutable e_typ : Types.t;
}
and e_desc =
| EInt of int
| EBool of bool
| EVar of ident
| EBinop of string * t * t
val show_e_desc : e_desc -> Ppx_deriving_runtime.string
val to_yojson : t -> Yojson.Safe.t
val e_desc_to_yojson : e_desc -> Yojson.Safe.t
type value = {
mutable v_desc : e_val;
mutable v_typ : Types.t;
}
and e_val =
| Int of int
| Bool of bool
| Prim of e_val list -> e_val
| Unknown
| Enum of string(*

This is a hack to allow tracing of state transitions

*)
val of_value : e_val -> t
val is_const : t -> bool
val is_var_test : string -> t -> bool

Builders

val mk_bool_expr : e_desc -> t
val mk_int_expr : e_desc -> t

Evaluation

type env = (ident * e_val) list

Evaluation environment

Printing

val to_string : t -> string
val string_of_value : e_val -> string

Simulation

val lookup_env : env -> ident -> e_val
val update_env : env -> (ident * e_val) -> env
exception Unbound_id of ident
exception Unknown_id of ident
exception Illegal_expr of t
exception Illegal_value of e_val
val eval : env -> t -> e_val
val bool_val : e_val -> bool
val int_val : e_val -> int