Frama-C API - Int_interval
Integer intervals with congruence. An interval defined by min, max, rem, modu
represents all integers between the bounds min
and max
and congruent to rem
modulo modu
. A value of None
for min
(resp. max
) represents -infinity (resp. +infinity). modu
is > 0, and 0 <= rem < modu
.
include Datatype.S_with_collections
include Datatype.S
include Datatype.S_no_copy
include Datatype.Ty
module Set : Datatype.Set with type elt = t
module Map : Datatype.Map with type key = t
module Hashtbl : Datatype.Hashtbl with type key = t
include Eva_lattice_type.Full_AI_Lattice_with_cardinality with type t := t
include Eva_lattice_type.AI_Lattice_with_cardinal_one with type t := t
include Eva_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 packed_descr : Structural_descr.pack
Packed version of the descriptor.
val reprs : t list
List of representants of the descriptor.
val hash : t -> int
Hash function: same spec than Hashtbl.hash
.
val pretty : Stdlib.Format.formatter -> t -> unit
Pretty print each value in an user-friendly way.
val mem_project : (Project_skeleton.t -> bool) -> t -> bool
mem_project f x
must return true
iff there is a value p
of type Project.t
in x
such that f p
returns true
.
include Eva_lattice_type.With_Top with type t := t
val top : t
largest element
include Eva_lattice_type.With_Cardinal_One with type t := t
val cardinal_zero_or_one : t -> bool
include Eva_lattice_type.With_Narrow with type t := t
val narrow : t -> t -> t Lattice_bounds.or_bottom
over-approximation of intersection
include Eva_lattice_type.With_Under_Approximation with type t := t
val meet : t -> t -> t Lattice_bounds.or_bottom
under-approximation of intersection
include Eva_lattice_type.With_Intersects with type t := t
include Eva_lattice_type.With_Diff with type t := t
val diff : t -> t -> t Lattice_bounds.or_bottom
diff t1 t2
is an over-approximation of t1-t2
. t2
must be an under-approximation or exact.
include Eva_lattice_type.With_Diff_One with type t := t
val diff_if_one : t -> t -> t Lattice_bounds.or_bottom
diff_if_one t1 t2
is an over-approximation of t1-t2
.
include Eva_lattice_type.With_Enumeration with type t := t
Fold on the elements of the value one by one if possible. Raises Abstract_interp.Not_less_than
when there is an infinite number of elements to enumerate.
val cardinal_less_than : t -> int -> int
Raises Abstract_interp.Not_less_than
whenever the cardinal of the given lattice is strictly higher than the given integer.
type widen_hint = Datatype.Integer.Set.t
Hints for the widening: set of relevant thresholds.
val widen : ?size:Integer.t -> ?hint:widen_hint -> t -> t -> t
widen ~size ~hint t1 t2
is an over-approximation of join t1 t2
. size
is the size (in bits) of the widened value, hint
is a set of relevant thresholds for the widened interval bounds.
Checks that the interval defined by min, max, rem, modu
is well formed.
Makes the interval of all integers between min
and max
and congruent to rem
modulo modu
. Fails if these conditions does not hold:
- min ≤ max
- 0 ≤ rem < modu
- min ≅ rem
modu
∧ max ≅ remmodu
Makes the interval of all integers between min
and max
.
Returns the bounds of the given interval. None
means infinity.
Returns the bounds and the modulo of the given interval.
Returns the number of integers represented by the given interval. Returns None
if the interval represents an infinite number of integers.
val complement_under : min:Integer.t -> max:Integer.t -> t -> t Lattice_bounds.or_bottom
Returns an under-approximation of the integers between min
and max
that are *not* represented by the given interval.
Interval semantics.
See Int_val
for more details.
val add_under : t -> t -> t Lattice_bounds.or_bottom
val scale_div_under : pos:bool -> Integer.t -> t -> t Lattice_bounds.or_bottom
val div : t -> t -> t Lattice_bounds.or_bottom
val c_rem : t -> t -> t Lattice_bounds.or_bottom
Misc.
val reduce_sign : t -> bool -> t Lattice_bounds.or_bottom
val reduce_bit : int -> t -> bool -> t Lattice_bounds.or_bottom