package fsml

  1. Overview
  2. Docs

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 = {
  1. e_desc : e_desc;
  2. mutable e_typ : Types.t;
}
and e_desc =
  1. | EInt of int
  2. | EBool of bool
  3. | EVar of ident
  4. | 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 = {
  1. mutable v_desc : e_val;
  2. mutable v_typ : Types.t;
}
and e_val =
  1. | Int of int
  2. | Bool of bool
  3. | Prim of e_val list -> e_val
  4. | Unknown
  5. | Enum of string
    (*

    This is a hack to allow tracing of state transitions

    *)
val of_value : e_val -> t

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
val eval : env -> t -> e_val
OCaml

Innovation. Community. Security.