sig
type id = string
val pp_id :
Format.formatter -> Compiler_util2.id -> Ppx_deriving_runtime.unit
val show_id : Compiler_util2.id -> Ppx_deriving_runtime.string
type op2 = LT | GT | Eq | Add | Sub | Mul | Div | Mod
val pp_op2 :
Format.formatter -> Compiler_util2.op2 -> Ppx_deriving_runtime.unit
val show_op2 : Compiler_util2.op2 -> Ppx_deriving_runtime.string
type const = Int of int | Bool of bool
val pp_const :
Format.formatter -> Compiler_util2.const -> Ppx_deriving_runtime.unit
val show_const : Compiler_util2.const -> Ppx_deriving_runtime.string
type exp =
Id of Compiler_util2.id
| Const of Compiler_util2.const
| Op2 of Compiler_util2.op2 * Compiler_util2.exp * Compiler_util2.exp
| If of Compiler_util2.exp * Compiler_util2.exp * Compiler_util2.exp
| Let of Compiler_util2.id * Compiler_util2.exp * Compiler_util2.exp
| Fun of Compiler_util2.id * Compiler_util2.id list * Compiler_util2.exp
| App of Compiler_util2.exp * Compiler_util2.exp list
| MkArray of Compiler_util2.exp * Compiler_util2.exp
| GetArray of Compiler_util2.exp * Compiler_util2.exp
| SetArray of Compiler_util2.exp * Compiler_util2.exp *
Compiler_util2.exp
| Seq of Compiler_util2.exp * Compiler_util2.exp
| Abort
val pp_exp :
Format.formatter -> Compiler_util2.exp -> Ppx_deriving_runtime.unit
val show_exp : Compiler_util2.exp -> Ppx_deriving_runtime.string
type value =
Int of int
| Bool of bool
| Array of Compiler_util2.value array
| Closure of (Compiler_util2.value list -> Compiler_util2.value)
module IdSet :
sig
type elt = id
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : (elt -> unit) -> t -> unit
val map : (elt -> elt) -> t -> t
val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
val for_all : (elt -> bool) -> t -> bool
val exists : (elt -> bool) -> t -> bool
val filter : (elt -> bool) -> t -> t
val partition : (elt -> bool) -> t -> t * t
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val min_elt_opt : t -> elt option
val max_elt : t -> elt
val max_elt_opt : t -> elt option
val choose : t -> elt
val choose_opt : t -> elt option
val split : elt -> t -> t * bool * t
val find : elt -> t -> elt
val find_opt : elt -> t -> elt option
val find_first : (elt -> bool) -> t -> elt
val find_first_opt : (elt -> bool) -> t -> elt option
val find_last : (elt -> bool) -> t -> elt
val find_last_opt : (elt -> bool) -> t -> elt option
val of_list : elt list -> t
end
val from_string : string -> Compiler_util2.exp
val from_file : string -> Compiler_util2.exp
val show_value : Compiler_util2.value -> Compiler_util2.id
val eval : Compiler_util2.exp -> Compiler_util2.value
val free_vars : Compiler_util2.exp -> Compiler_util2.IdSet.t
val subst :
Compiler_util2.id ->
Compiler_util2.exp -> Compiler_util2.exp -> Compiler_util2.exp
end