package goblint
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=20d5b7332a9f6072ab9ba86c4a53b898eaf681286c56a8805c41850bbf3ddf41
sha512=7c7685cfcd9aa866bc40e813df2bfcb3c79b3d40e615d8d6d0939c5798b9d70dd7f2ba87a741f5ba0ce891e9d254627207fb28057f1f2f6611e4e0d128fd6a71
doc/goblint.lib/Goblint_lib/UnionFind/T/index.html
Module UnionFind.T
The terms consist of address constants and dereferencing function with sum of an integer. The dereferencing function is parametrized by the size of the element in the memory. We store the CIL expression of the term in the data type, such that it it easier to find the types of the dereferenced elements. Also so that we can easily convert back from term to Cil expression.
type exp = GoblintCil.Cil.exptype t = termval equal : t -> t -> Ppx_deriving_runtime.boolval hash : t -> intval compare : t -> t -> Ppx_deriving_runtime.inttype v_prop = propval equal_v_prop : v_prop -> v_prop -> Ppx_deriving_runtime.boolval hash_v_prop : v_prop -> intval compare_v_prop : v_prop -> v_prop -> Ppx_deriving_runtime.intval is_addr : term -> boolval get_size_in_bits : GoblintCil.Cil.typ -> Z.tval show_type : GoblintCil.exp -> stringval show : t -> stringval show_prop : prop -> stringval get_var : term -> DuplicateVars.Var.tval contains_variable : DuplicateVars.Var.t list -> term -> boolReturns true if the second parameter contains one of the variables defined in the list "variables".
val eval_int : Queries.ask -> GoblintCil.exp -> IntDomain.IntDomTuple.int_tUse query EvalInt for an expression.
val eval_int_opt :
Queries.ask ->
GoblintCil.exp ->
IntDomain.IntDomTuple.int_t optionval type_of_element : GoblintCil.Cil.typ -> GoblintCil.typ optionReturns Some type for a pointer to a type and None if the result is not a pointer.
val get_element_size_in_bits : GoblintCil.Cil.typ -> Z.tReturns the size of the type. If typ is a pointer, it returns the size of the elements it points to. If typ is an array, it returns the size of the elements of the array (even if it is a multidimensional array. Therefore get_element_size_in_bits int[][][] = sizeof(int)).
val is_struct_type : GoblintCil.Cil.typ -> boolval is_struct_ptr_type : GoblintCil.Cil.typ -> boolval aux_term_of_varinfo : Goblint_lib__DuplicateVars.VarType.t -> termval term_of_varinfo : Goblint_lib__DuplicateVars.VarType.t -> termval offset_to_index :
?typ:GoblintCil.typ ->
PreValueDomain.Offs.t ->
IntDomain.IntDomTuple.tFrom a offset, compute the index in bits
val cil_offs_to_idx :
Queries.ask ->
GoblintCil.offset ->
GoblintCil.Cil.typ ->
IntDomain.IntDomTuple.tConvert a Cil offset to an integer offset.
val z_of_offset :
Queries.ask ->
GoblintCil.offset ->
GoblintCil.Cil.typ ->
IntDomain.IntDomTuple.int_tConvert an offset to an integer of Z, if posible. Otherwise, this throws UnsupportedCilExpression.
val can_be_dereferenced : GoblintCil.Cil.typ -> boolval type_of_term : term -> GoblintCil.typval to_cil : term -> GoblintCil.expval default_int_type : GoblintCil.ikindval to_cil_constant : Z.t -> GoblintCil.Cil.typ option -> GoblintCil.expReturns a Cil expression which is the constant z divided by the size of the elements of t.
val to_cil_sum : Z.t -> GoblintCil.exp -> GoblintCil.expval get_field_offset : CilType.Fieldinfo.t -> IntDomain.IntDomTuple.int_tReturns the integer offset of a field of a struct.
val is_field : GoblintCil.offset -> boolval add_index_to_exp : GoblintCil.exp -> GoblintCil.offset -> GoblintCil.expval check_valid_pointer : GoblintCil.exp -> boolReturns true if the Cil expression represents a 64 bit data type which is not a float. So it must be either a pointer or an integer that has the same size as a pointer.
Only keeps the variables that are actually pointers (or 64-bit integers).
val dereference_exp : GoblintCil.exp -> Z.t -> GoblintCil.expGet a Cil expression that is equivalent to *(exp + offset), by taking into account type correctness.
val get_size : term -> Z.tval of_offset :
Queries.ask ->
term ->
GoblintCil.offset ->
GoblintCil.Cil.typ ->
GoblintCil.exp ->
termval of_lval : Queries.ask -> GoblintCil.lval -> termval of_cil_neg :
Queries.ask ->
bool ->
GoblintCil.exp ->
term option * GoblintCil.Cilint.cilint optionConverts the negation of the expression to a term if neg = true. If neg = false then it simply converts the expression to a term.
val of_cil :
Queries.ask ->
GoblintCil.exp ->
term option * GoblintCil.Cilint.cilint optionConvert the expression to a term, and additionally check that the term is 64 bits. If it's not a 64bit pointer, it returns None, None.
val two_terms_of_cil :
Queries.ask ->
bool ->
GoblintCil.exp ->
(term option * GoblintCil.Cilint.cilint option)
* (term option * GoblintCil.Cilint.cilint option)Converts a cil expression e = "t1 + off1 - (t2 + off2)" to two terms (Some t1, Some off1), (Some t2, Some off2)
val prop_of_cil : Queries.ask -> GoblintCil.Cil.exp -> bool -> prop list`prop_of_cil e pos` parses the expression `e` (or `not e` if `pos = false`) and returns a list of length 1 with the parsed expresion or an empty list if the expression can't be expressed with the type `prop`.
val prop_to_cil : prop -> GoblintCil.exp