package codex
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=bc7266a140c6886add673ede90e335d3
sha512=8da42c0ff2c1098c5f9cb2b5b43b306faf7ac93b8f5ae00c176918cee761f249ff45b29309f31a05bbcf6312304f86a0d5a000eb3f1094d3d3c2b9b4c7f5c386
doc/codex.framac_ival/Framac_ival/Ival/index.html
Module Framac_ival.IvalSource
Arithmetic lattices. The interfaces of this module may change between Frama-C versions. Contact us if you need stable APIs.
type t = private | Set of Abstract_interp.Int.t array| Float of Fval.t(*Top(min, max, rem, modulo)represents the interval betweenminandmax, congruent toremmodulomodulo. A value ofNoneformin(resp.max) represents -infinity (resp. +infinity).modulois > 0, and0 <= rem < modulo.Actual
*)Topis thus represented by Top(None,None,Int.zero,Int.one)| Top of Abstract_interp.Int.t option * Abstract_interp.Int.t option * Abstract_interp.Int.t * Abstract_interp.Int.t
General guidelines of this module
- Functions suffixed by
_intexpect arguments that are integers. Hence, they will fail on an ival with constructorFloat. Conversely,_floatsuffixed functions expect float arguments: the constructorFloat, or the singleton set[| Int.zero |], that can be tested byis_zero.
- see the comment in
Lattice_typeabout over- and under-approximations, and exact operations.
include Datatype_sig.S with type t := t
Any notion of equality is allowed, as long as it is an equivalence relation, and that if a == b, then equal a b.
Addition of two integer (ie. not Float) ivals.
Underapproximation of the same operation
Underapproximation of the same operation
Addition of an integer ival with an integer. Exact operation.
A None result means the argument is unbounded. Raises Error_Bottom if the argument is bottom.
A None result means the argument is unbounded. Raises Error_Bottom if the argument is bottom.
A None result means the argument is unbounded. Raises Error_Bottom if the argument is bottom.
A None result means the argument is unbounded. Raises Error_Bottom if the argument is bottom.
Returns the minimal and maximal integers represented by an ival. None means the argument is unbounded.
returns the bounds of the float interval, (or None if the argument is exactly NaN), and a boolean indicating the possibility that the value may be NaN.
The lattice element that contains only the integer 0.
The lattice element that contains only the integer 1.
The lattice element that contains only the integer 1.
The lattice element that contains only the integer -1.
The lattice element that contains exactly the positive or null integers
The lattice element that contains exactly the negative or null integers
contains the zero value (including -0. for floating-point ranges)
contains the zero value (including -0. for floating-point ranges)
Building Ival
None means unbounded. The interval is inclusive.
val inject_interval :
min:Integer.t option ->
max:Integer.t option ->
rem:Integer.t ->
modu:Integer.t ->
tBuilds the set of integers between min and max included and congruent to rem modulo modulo. For min and max, None is the corresponding infinity. Checks that modu > 0 and 0 <= rest < modu, and fails otherwise.
Cardinality
cardinal v returns n if v has finite cardinal n, or None if the cardinal is not finite.
cardinal_estimate v ~size returns an estimation of the cardinal of v, knowing that v fits in size bits.
cardinal_less_than t n returns the cardinal of t is this cardinal is at most n.
Same than cardinal_less_than but just return if it is the case.
Iterate on the integer values of the ival in increasing order. Raise Abstract_interp.Error_Top if the argument is a float or a potentially infinite integer.
Iterate on the integer values of the ival in decreasing order. Raise Abstract_Interp.Error_Top if the argument is a float or a potentially infinite integer.
Iterate on every value of the ival. Raise Abstract_intrep.Error_Top if the argument is a non-singleton float or a potentially infinite integer.
Given i an integer abstraction min..max, fold_int_bounds f i acc tries to apply f to min, max, and i' successively, where i' is i from which min and max have been removed. If min and/or max are infinite, f is called with an argument i' unreduced in the corresponding direction(s).
has_greater_min_bound i1 i2 returns 1 if the interval i1 has a better minimum bound (i.e. greater) than the interval i2. i1 and i2 should not be bottom.
has_smaller_max_bound i1 i2 returns 1 if the interval i1 has a better maximum bound (i.e. lower) than the interval i2. i1 and i2 should not be bottom.
scale f v returns the interval of elements x * f for x in v. The operation is exact, except when v is a float.
scale_div ~pos:false f v is an over-approximation of the set of elements x c_div f for x in v.
scale_div ~pos:true f v is an over-approximation of the set of elements x e_div f for x in v.
scale_div_under ~pos:false f v is an under-approximation of the set of elements x c_div f for x in v.
scale_div_under ~pos:true f v is an under-approximation of the set of elements x e_div f for x in v.
Integer division
scale_rem ~pos:false f v is an over-approximation of the set of elements x c_rem f for x in v.
scale_rem ~pos:true f v is an over-approximation of the set of elements x e_rem f for x in v.
Extract bits from start to stop from the given Ival, start and stop being included. size is the size of the entire ival.
all_values ~size v returns true iff v contains all integer values representable in size bits.
backward_comp_int op l r reduces l into l' so that l' op r holds. l is assumed to be an integer
Same as backward_comp_int_left, except that the arguments should now be floating-point values.
Casts
Casts the given float into an integer. NaN and out-of-bounds values are ignored.
Bitwise reinterpretation of the given value as a float of the given kind.
Bitwise reinterpretation of the given value, of size size, as an integer of the given signedness (and size).
Value of option -ilevel