Module Types.TypedC
TypedC: Grammar for describing the types for the type-based domain, and operations on concrete types.
val pp_value : Stdlib.Format.formatter -> value -> unitval pp_array_length : Stdlib.Format.formatter -> array_length -> unitmodule Pred : sig ... endtype basic = Units.In_bytes.t * stringtype structure = {st_byte_size : Units.In_bytes.t;st_members : (Units.In_bytes.t * string * typ) list;
}and descr = | Void| Base of basic(*Base types. Note that even if they have a name, they are not a definition (e.g., you cannot have pointers to byte.
*)| Structure of structure| StructureFAM of {}(*Structure with flexible array member, decomposed as fix prefix * array.
*)| Ptr of pointer(*Todo: we should always have a size (possibly an existentially-qualified variable).
*)| Array of typ * array_length(*Arguments: element type, and the number of elements, if statically known.
*)| Function of funtyp| Application of name| Existential of typ * string * typ| Union of union| Weak of typ
and constr_name = | ConstrName of string| ConstrNameFunc of string| ConstrNameUnion of string| ConstrNameStruct of string| ConstrNameEnum of string| ConstrNameArray of constr_name
Called type name in OOPSLA, but is the name of a family of region names when there are arguments.
Each constr_name is associated to a unique id and arity to give a constr.
val pp : Stdlib.Format.formatter -> typ -> unitval pp_constr : Stdlib.Format.formatter -> constr -> unitequiv a b returns true if it can show that a is a subtype of b and b is a subtype a.
module Constr : sig ... endmodule Build : sig ... endval is_flexible_array : typ -> boolval is_function_pure : typ -> boolcontains t u determines whether t contains u. (Definition: t contains u iff t = u or a component of t (e.g. a structure member) contains u.
val sizeof : typ -> Units.In_bytes.tReturns the size of the type (in bytes), if possible
These functions allow to update or query the binding from type names to types.
Unroll the definitions of a type (i.e. replace a name with the corresponding type)
val substitute_in_type : typ -> (value_symbol * Pred.expr) list -> typSubstitutes the symbolic variables in the type typ by the corresponding expressions in bindings
val word : byte_size:Units.In_bytes.t -> typAdditionnal functions used for type domains
type constr_def = typ * string listval add_constr_definition : constr -> constr_def -> unitMaps a name to a type constructor.
val constr_of_name : constr -> constr_def optionfind the constr_def associated to a constr, or None if none.
print the constructor map, for debug purposes.
print all the stored maps, for debug purposes
val add_function_name_definition : string -> typ -> bool -> unitval function_of_name : string -> typ optionRetrieve the type associated to a function name, or None if there is none.
val function_definition_of_name : string -> fundef optionRetrieve the type associated to a function name, and whether it was declared inline; or None if not found.
print the function map, for debug purposes.
val add_global_name_definition : string -> typ -> unitval global_of_name : string -> typ optionRetrieve the type associated to a function name, or None if not found.