Asllib.StaticEnvSourceStatic Environment used for type-checking (cf Typing.
type global = {declared_types : (AST.ty * SideEffect.TimeFrame.t) ASTUtils.IMap.t;Maps a type name t to its declaration and its time-frame.
As expressions on which a type depends need to be statically evaluable, the only effects allowed in a type are statically evaluable, so need to be reading immutable (global) storage elements. This makes it possible only to store the time-frame of the type, and not the whole side-effect set.
*)constant_values : AST.literal Storage.t;Maps a global constant name to its value.
*)storage_types : (AST.ty * AST.global_decl_keyword) ASTUtils.IMap.t;Maps global declared storage elements to their types.
*)subtypes : AST.identifier ASTUtils.IMap.t;Maps an identifier s to its parent in the subtype relation.
*)subprograms : (AST.func * SideEffect.SES.t) ASTUtils.IMap.t;Maps each subprogram runtime name to its signature and the side-effects inferred for it.
*)overloaded_subprograms : ASTUtils.ISet.t ASTUtils.IMap.t;Maps the name of each declared subprogram to the equivalence class of all the subprogram runtime names that were declared with this name.
*)expr_equiv : AST.expr ASTUtils.IMap.t;Maps every expression to a reduced immutable form.
*)}Store all the global environment information at compile-time.
type local = {constant_values : AST.literal Storage.t;Maps a local constant to its value.
*)storage_types : (AST.ty * AST.local_decl_keyword) ASTUtils.IMap.t;Maps an locally declared names to their type.
*)expr_equiv : AST.expr ASTUtils.IMap.t;Maps immutable storage to their oldest equivalent expression.
*)return_type : AST.ty option;Local return type, None for procedures, global constants, or setters.
}Store all the local environment information at compile-time.
lookup x env is the value of x as defined in environment.
type_of env "x" is the type of "x" in the environment env.
val add_global_storage :
AST.identifier ->
AST.ty ->
AST.global_decl_keyword ->
global ->
globaladd_local_immutable_expr x e env binds x to e in env. x is assumed to name an immutable local storage element. e is supposed to be the oldest expression corresponding to x.
add_global_immutable_expr x e env binds x to e in env. x is assumed to name an immutable global storage element. e is supposed to be the oldest expression corresponding to x.