Mlsem_lang.MVariablemodule SA = Mlsem_system.Asttype t = Mlsem_common.Variable.tval is_mutable : Mlsem_common.Variable.t -> boolval kind : Mlsem_common.Variable.t -> kindval add_to_env :
Mlsem_common.Variable.t ->
Mlsem_types.TyScheme.t ->
Mlsem_common.Env.t ->
Mlsem_common.Env.tBinds a top-level variable, giving a mutable one the type its declaration fixes rather than the type inferred for its initializer.
val replace_in_env :
Mlsem_common.Variable.t ->
Mlsem_types.TyScheme.t ->
Mlsem_common.Env.t ->
Mlsem_common.Env.tThe four operations a mutable variable is encoded with, on an abstract reference type. Each raises Invalid_argument if the variable is not mutable.
val ref_uninit : Mlsem_common.Variable.t -> SA.eCreation of an uninitialized cell.
val ref_cons : Mlsem_common.Variable.t -> SA.t -> SA.eCreation of a cell holding the given expression.
val ref_get : Mlsem_common.Variable.t -> SA.eRead of the cell.
val ref_assign : Mlsem_common.Variable.t -> SA.t -> SA.eWrite of the given expression into the cell.
val as_ref_assign : SA.e -> Mlsem_common.Variable.t optionRecognizes an expression produced by ref_assign, returning the variable being assigned.
val content_ty :
Mlsem_common.Variable.t ->
Mlsem_types.Ty.t ->
Mlsem_types.Ty.t optioncontent_ty v ty is the type of the values that can be assigned to v, given the type ty of its cell (as produced by the encoding), if it can be determined (i.e. if v is annotated, or if ty is a single ref atom).