Frama-C API - Bytes
Association between bases and offsets in byte.
module M : sig ... endtype t = private | Top of Base.SetLattice.t * Origin.t(*Garbled mix of the addresses in the set
*)| Map of M.t(*Precise set of addresses+offsets
*)
Address sets have a lattice structure, including standard operations such as join, narrow, etc.
include Lattice_type.AI_Lattice_with_cardinal_one with type t := t
include Lattice_type.Bottom_Bounded_Join_Semi_Lattice with type t := t
include Lattice_type.Join_Semi_Lattice with type t := t
datatype of element of the lattice
include Datatype.S with type t := t
include Datatype.S_no_copy with type t := t
include Datatype.Ty with type t := t
val bottom : tsmallest element
include Lattice_type.With_Top with type t := t
val top : tlargest element
include Lattice_type.With_Cardinal_One with type t := t
include Lattice_type.With_Intersects with type t := t
type widen_hint = Ival.widen_hintval widen : ?size:Z.t -> ?hint:widen_hint -> t -> t -> tinclude Datatype.S_with_collections with type t := t
include Datatype.S with type t := t
include Datatype.S_no_copy with type t := t
include Datatype.Ty with type t := t
val packed_descr : Structural_descr.packPacked version of the descriptor.
val reprs : t listList of representants of the descriptor.
val hash : t -> intHash function: same spec than Hashtbl.hash.
val pretty : Stdlib.Format.formatter -> t -> unitPretty print each value in an user-friendly way.
val mem_project : (Project_skeleton.t -> bool) -> t -> boolmem_project f x must return true iff there is a value p of type Project.t in x such that f p returns true.
module Set : Datatype.Set with type elt = tmodule Map : Datatype.Map with type key = tmodule Hashtbl : Datatype.Hashtbl with type key = tval singleton_zero : tthe set containing only the value for to the C expression 0
val singleton_one : tthe set containing only the value 1
val zero_or_one : tval is_zero : t -> boolval is_bottom : t -> boolval top_int : tval top_float : tval top_single_precision_float : tadd b i addr binds b to i in addr when i is not Ival.bottom, and returns bottom otherwise.
val replace_base : Base.substitution -> t -> bool * treplace_base subst addr changes addresses addr by substituting the pointed bases according to subst. If substitution conflates different bases, the offsets bound to these bases are joined.
Is there a possibly non-empty intersection between two given locations represented by the starting addresses and a given size? If partial is true, returns true if the two locations may be overlapping without being equal. If partial is false, also returns true if the two locations may be equal. Returns false when the two locations cannot be overlapping.
Over-approximation of difference. arg2 needs to be exact or an under_approximation.
Over- and under-approximation of shifting the value by the given Ival.
Subtracts the offsets of two address sets addr1 and addr2. Returns the pointwise subtraction of their offsets off1 - factor * off2. factor defaults to 1.
Subtracts the offsets of two address sets. Same as sub_pointwise factor:1, except that garbled mixes from operands are propagated into the result.
val topify : Origin.kind -> t -> ttopify kind v converts v to a garbled mix of the addresses pointed to by v, with origin kind. Returns v unchanged if it is bottom, the singleton zero or already a garbled mix.
val inject_top_origin : Origin.t -> Base.Hptset.t -> tinject_top_origin origin bases creates a garbled mix of bases bases with origin origin.
Fold on all the bases of the address sets, including Top bases.
Fold with offsets, including in the case Top bases. In this case, Ival.top is supplied to the iterator.
fold_enum f addr acc enumerates addresses in addr, and passes them to f. Make sure to call cardinal_less_than before calling this function, as all possible combinations of bases/offsets are presented to f. Raises Abstract_interp.Error_Top if addr is Top _ or if one offset cannot be enumerated.
Builds a sequence of all bases (with their offsets) of the address set.
val cached_fold : cache:Hptmap_sig.cache_type -> f:(Base.t -> Ival.t -> 'a) -> joiner:('a -> 'a -> 'a) -> empty:'a -> t -> 'aCached version of fold_i, for advanced users
Number of addresses
val cardinal_zero_or_one : t -> boolval cardinal_less_than : t -> int -> intcardinal_less_than v card returns the cardinal of v if it is less than card, or raises Not_less_than.
if there is only one base b in the address set, then returns the pair b,o where o are the offsets associated to b.
if there is only one binding b -> o in the address set (that is, only one base b with cardinal_zero_or_one o), returns the pair b,o.
val get_bases : t -> Base.SetLattice.tReturns the bases the addresses may point to. Never fails, but may return Base.SetLattice.Top.
Local variables inside locations
contains_addresses_of_locals is_local addr returns true if addr contains the address of a variable for which is_local returns true
remove_escaping_locals is_local addr removes from addr the information associated with bases for which is_local returns true. The returned boolean indicates that addr contained some locals.
val contains_addresses_of_any_locals : t -> boolcontains_addresses_of_any_locals addr returns true iff addr contains the address of a local variable or of a formal variable.
Misc
val is_relationable : t -> boolis_relationable addr returns true iff addr represents a single memory address.
