Module Checker__Location
type location={root : root;path : path;}locationis a compile-time notion of memory locations.locations start with aroot, and can be refined further via apath. Example:x .field1.field2 root ^^^ path ^^^^^^^^^^^^^^ ( * y ) .field root ^^^ path ^^^ ^^^^^^
and root=|Var of Checker.IR.variable|Abs of abstract_locroots of locations can either be concrete program variables (viaVar), or abstract locations (viaAbs), which are abstract tokens that represent a set of other locations.Locations starting with program variables (
Var) are called "concrete", and locations starting with abstract locations (Abs) are called "abstract".The
Varconstructor accepts an abstract location rather than a variable name. This helps avoid issues with name clash. A mapping between variable names and the corresponding abstract locations should be maintained elsewhere
and abstract_loc= private intand path= Checker.IR.path
val absloc_generator : < generate : abstract_loc; reset : unit; >val gen_absloc : unit -> abstract_locgenerate a new fresh abstract location. A wrapper of
absloc_generator
val var_to_loc : Checker.IR.variable -> locationcreate a location starting with a program variable with an empty path
val abs_to_loc : abstract_loc -> locationcreate a location starting with an abstract location with an empty path
val lvalue_to_loc : Checker.IR.lvalue -> locationcreate a location corresponding to a lvalue
type relation=|Eq|Irr|Lt of path|Gt of paththe relation between two locations or paths. The intuition behind the notion of "large" and "small" is how much a location covers. Detailed meaning of each case is:
a `Eq` bmeans thataandbare exactly identicala `Irr` bmeans thataandbare disjointa `Lt path` bmeans thatarefers to a part ofb, i.e.a = b.patha `Gt path` bmeans thatbrefers to a part ofa, i.e.b = a.path
module ConstrSet : sig ... endthe
ConstrSetsubmodule provides a data type for tracking constraints on abstract locations. Letl1,l2be twolocations. Herel2must start with an abstract location, hence represents a set of locations. Now constraints are of the forml1 in l2, meaning that the set of locations denoted byl2must containl1.l2is called the superset andl1is called the subset in the constraint