sig
type id = string
val pp_id :
Format.formatter -> Compiler_util.id -> Ppx_deriving_runtime.unit
val show_id : Compiler_util.id -> Ppx_deriving_runtime.string
type op2 = LT | GT | Eq | Add | Sub | Mul | Div | Mod
val pp_op2 :
Format.formatter -> Compiler_util.op2 -> Ppx_deriving_runtime.unit
val show_op2 : Compiler_util.op2 -> Ppx_deriving_runtime.string
type const = Int of int | Bool of bool
val pp_const :
Format.formatter -> Compiler_util.const -> Ppx_deriving_runtime.unit
val show_const : Compiler_util.const -> Ppx_deriving_runtime.string
type exp =
Id of Compiler_util.id
| Const of Compiler_util.const
| Op2 of Compiler_util.op2 * Compiler_util.exp * Compiler_util.exp
| If of Compiler_util.exp * Compiler_util.exp * Compiler_util.exp
| Let of Compiler_util.id * Compiler_util.exp * Compiler_util.exp
| Fun of Compiler_util.id * Compiler_util.id list * Compiler_util.exp
| App of Compiler_util.exp * Compiler_util.exp list
| MkArray of Compiler_util.exp * Compiler_util.exp
| GetArray of Compiler_util.exp * Compiler_util.exp
| SetArray of Compiler_util.exp * Compiler_util.exp * Compiler_util.exp
| Seq of Compiler_util.exp * Compiler_util.exp
val pp_exp :
Format.formatter -> Compiler_util.exp -> Ppx_deriving_runtime.unit
val show_exp : Compiler_util.exp -> Ppx_deriving_runtime.string
val from_string : string -> Compiler_util.exp
val from_file : string -> Compiler_util.exp
type aexp = AId of Compiler_util.id | AConst of Compiler_util.const
and bexp =
BFun of Compiler_util.id * Compiler_util.id list * Compiler_util.anfexp
| BAtom of Compiler_util.aexp
| BOp2 of Compiler_util.op2 * Compiler_util.aexp * Compiler_util.aexp
| BMkArray of Compiler_util.aexp * Compiler_util.aexp
| BGetArray of Compiler_util.aexp * Compiler_util.aexp
| BSetArray of Compiler_util.aexp * Compiler_util.aexp *
Compiler_util.aexp
| BApp of Compiler_util.aexp * Compiler_util.aexp list
and anfexp =
ELet of Compiler_util.id * Compiler_util.bexp * Compiler_util.anfexp
| EIf of Compiler_util.aexp * Compiler_util.anfexp * Compiler_util.anfexp
| EApp of Compiler_util.aexp * Compiler_util.aexp list
| ERet of Compiler_util.aexp
val pp_aexp :
Format.formatter -> Compiler_util.aexp -> Ppx_deriving_runtime.unit
val show_aexp : Compiler_util.aexp -> Ppx_deriving_runtime.string
val pp_bexp :
Format.formatter -> Compiler_util.bexp -> Ppx_deriving_runtime.unit
val show_bexp : Compiler_util.bexp -> Ppx_deriving_runtime.string
val pp_anfexp :
Format.formatter -> Compiler_util.anfexp -> Ppx_deriving_runtime.unit
val show_anfexp : Compiler_util.anfexp -> Ppx_deriving_runtime.string
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 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 max_elt : t -> elt
val choose : t -> elt
val split : elt -> t -> t * bool * t
val find : elt -> t -> elt
val of_list : elt list -> t
end
val free_vars : Compiler_util.anfexp -> Compiler_util.IdSet.t
val rename :
Compiler_util.id ->
Compiler_util.id -> Compiler_util.anfexp -> Compiler_util.anfexp
end