module Int_val:sig..end
Integer values abstractions: an abstraction represents a set of integers. Provided with a lattice structure and over-approximations of arithmetic operations.
Abstractions do not represent the empty set. Instead, operations creating empty sets return `Bottom.
include Datatype.S_with_collections
module Widen_Hints: Datatype.Integer.Set
typesize_widen_hint =Integer.t
typegeneric_widen_hint =Widen_Hints.t
include Eva_lattice_type.Full_AI_Lattice_with_cardinality
val zero : t
val one : t
val minus_one : t
val zero_or_one : t
val positive_integers : tAll positive integers, including 0.
val negative_integers : tAll negative integers, including 0.
val inject_singleton : Integer.t -> tReturns an exact abstraction of the given integer.
val inject_range : Integer.t option -> Integer.t option -> tinject_range min max returns an abstraction of all integers between
min and max included. None means that the abstraction is unbounded.
val inject_interval : min:Integer.t option ->
max:Integer.t option -> rem:Integer.t -> modu:Integer.t -> tBuilds an abstraction of all integers between min and max included and
congruent to rem modulo modu. For min and max, None is the
corresponding infinity. Checks that min <= max, modu > 0 and
0 <= rest < modu, and fails otherwise. If possible, reduces min and
max according to the modulo.
val make : min:Integer.t option ->
max:Integer.t option -> rem:Integer.t -> modu:Integer.t -> tAs inject_interval, but also checks that min and max are congruent to
rem modulo modu.
val min_int : t -> Integer.t optionReturns the smallest integer represented by an abstraction. Returns None if it does not exist, i.e. if the abstraction is unbounded.
val max_int : t -> Integer.t optionReturns the highest integer represented by an abstraction. Returns None if it does not exist, i.e. if the abstraction is unbouded.
val min_and_max : t -> Integer.t option * Integer.t optionReturns the smallest and highest integers represented by an abstraction.
val min_max_rem_modu : t -> Integer.t option * Integer.t option * Integer.t * Integer.tReturns min, max, rem, modu such that for all integers i represented by
the given abstraction, i satisfies min ≤ i ≤ max and i ≅ rem modu.
exception Not_Singleton
val project_int : t -> Integer.tProjects a singleton abstraction into an integer.
Not_Singleton if the cardinal of the argument is not 1.val is_small_set : t -> boolIs an abstraction internally represented as a small integer set?
val project_small_set : t -> Integer.t list optionval is_singleton : t -> bool
val cardinal_zero_or_one : t -> bool
val cardinal : t -> Integer.t option
val cardinal_estimate : size:Integer.t -> t -> Integer.t
val cardinal_less_than : t -> int -> int
val cardinal_is_less_than : t -> int -> bool
val is_zero : t -> bool
val contains_zero : t -> bool
val contains_non_zero : t -> boolval add : t -> t -> tAddition of two integer abstractions.
val add_under : t -> t -> t Lattice_bounds.or_bottomUnder-approximation of the addition of two integer abstractions
val add_singleton : Integer.t -> t -> tAddition of an integer abstraction with a singleton integer. Exact operation.
val neg : t -> tNegation of an integer abstraction.
val abs : t -> tAbsolute value of an integer abstraction.
val scale : Integer.t -> t -> tscale f v returns an abstraction of the integers f * x
for all x in v. This operation is exact.
val scale_div : pos:bool -> Integer.t -> t -> tscale_div f v is an over-approximation of the elements x / f for all
elements x in v. Uses the computer division (like in C99) if pos is
false, and the euclidean division if pos is true.
val scale_div_under : pos:bool -> Integer.t -> t -> t Lattice_bounds.or_bottomUnder-approximation of the division.
val scale_rem : pos:bool -> Integer.t -> t -> tOver-approximation of the remainder of the division. Uses the computer
division (like in C99) if pos is false, and the euclidean division if
pos is true.
val mul : t -> t -> t
val div : t -> t -> t Lattice_bounds.or_bottom
val c_rem : t -> t -> t Lattice_bounds.or_bottom
val shift_left : t -> t -> t Lattice_bounds.or_bottom
val shift_right : t -> t -> t Lattice_bounds.or_bottom
val bitwise_and : t -> t -> t
val bitwise_or : t -> t -> t
val bitwise_xor : t -> t -> t
val bitwise_signed_not : t -> t
val bitwise_unsigned_not : size:int -> t -> tval cast_int_to_int : size:Integer.t -> signed:bool -> t -> t
val subdivide : t -> t * tSplits an abstraction into two abstractions.
val extract_bits : start:Integer.t -> stop:Integer.t -> t -> tExtracts bits from start to stop from the given integer abstraction,
start and stop being included.
val create_all_values : signed:bool -> size:int -> tBuilds an abstraction of all integers in a C integer type.
val all_values : size:Integer.t -> t -> boolall_values ~size v returns true iff v contains all integer values
representable in size bits.
val overlaps : partial:bool -> size:Integer.t -> t -> t -> bool
val complement_under : size:int -> signed:bool -> t -> t Lattice_bounds.or_bottomReturns an under-approximation of the integers of the given size and signedness that are *not* represented by the given value.
val fold_int : ?increasing:bool -> (Integer.t -> 'a -> 'a) -> t -> 'a -> 'aIterates on all integers represented by an abstraction, in increasing order
by default. If increasing is set to false, iterate by decreasing order.
Abstract_interp.Error_Top if the abstraction is unbounded.