package frama-c
Install
dune-project
Dependency
Authors
-
MMichele Alberti
-
TThibaud Antignac
-
GGergö Barany
-
PPatrick Baudin
-
TThibaut Benjamin
-
AAllan Blanchard
-
LLionel Blatter
-
FFrançois Bobot
-
RRichard Bonichon
-
QQuentin Bouillaguet
-
DDavid Bühler
-
ZZakaria Chihani
-
LLoïc Correnson
-
JJulien Crétin
-
PPascal Cuoq
-
ZZaynah Dargaye
-
BBasile Desloges
-
JJean-Christophe Filliâtre
-
PPhilippe Herrmann
-
MMaxime Jacquemin
-
FFlorent Kirchner
-
AAlexander Kogtenkov
-
TTristan Le Gall
-
JJean-Christophe Léchenet
-
MMatthieu Lemerre
-
DDara Ly
-
DDavid Maison
-
CClaude Marché
-
AAndré Maroneze
-
TThibault Martin
-
FFonenantsoa Maurica
-
MMelody Méaulle
-
BBenjamin Monate
-
YYannick Moy
-
PPierre Nigron
-
AAnne Pacalet
-
VValentin Perrelle
-
GGuillaume Petiot
-
DDario Pinto
-
VVirgile Prevosto
-
AArmand Puccetti
-
FFélix Ridoux
-
VVirgile Robles
-
JJan Rochel
-
MMuriel Roger
-
JJulien Signoles
-
NNicolas Stouls
-
KKostyantyn Vorobyov
-
BBoris Yakobowski
Maintainers
Sources
sha256=0c80dae8074fcb3f6a33d7a41faf9939a2a336478a8d2c79e20e2d7bab953735
doc/frama-c.kernel/Frama_c_kernel/Ival/index.html
Module Frama_c_kernel.Ival
Arithmetic lattices. The interfaces of this module may change between Frama-C versions. Contact us if you need stable APIs.
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.
module Widen_Hints = Datatype.Integer.Settype size_widen_hint = Integer.ttype numerical_widen_hint = Widen_Hints.t * Fc_float.Widen_Hints.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
module Set : Datatype.Set with type elt = tmodule Map : Datatype.Map with type key = tmodule Hashtbl : Datatype.Hashtbl with type key = tinclude Lattice_type.Full_AI_Lattice_with_cardinality
with type t := t
and type widen_hint = size_widen_hint * numerical_widen_hint
include Lattice_type.AI_Lattice_with_cardinal_one
with type t := t
with type widen_hint = size_widen_hint * numerical_widen_hint
include Lattice_type.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 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 : 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.
val bottom : tsmallest element
include Lattice_type.With_Top with type t := t
val top : tlargest element
include Lattice_type.With_Widening
with type t := t
with type widen_hint = size_widen_hint * numerical_widen_hint
type widen_hint = size_widen_hint * numerical_widen_hinthints for the widening
val widen : widen_hint -> t -> t -> twiden h t1 t2 is an over-approximation of join t1 t2. Assumes is_included t1 t2
include Lattice_type.With_Cardinal_One with type t := t
include Lattice_type.With_Intersects with type t := t
include Lattice_type.With_Enumeration with type t := t
val is_bottom : t -> boolval is_float : t -> boolval is_int : t -> boolAddition 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.
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.
val zero : tThe lattice element that contains only the integer 0.
val one : tThe lattice element that contains only the integer 1.
val minus_one : tThe lattice element that contains only the integer -1.
val zero_or_one : tThe lattice element that contains only the integers 0 and 1.
val positive_integers : tThe lattice element that contains exactly the positive or null integers
val negative_integers : tThe lattice element that contains exactly the negative or null integers
val float_zeros : tThe lattice element containing exactly -0. and 0.
val is_zero : t -> boolval is_one : t -> boolval contains_zero : t -> boolcontains the zero value (including -0. for floating-point ranges)
val contains_non_zero : t -> boolval top_float : tval top_single_precision_float : tBuilding Ival
val inject_float_interval : float -> float -> tNone 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
val cardinal_zero_or_one : t -> boolval is_singleton_int : t -> boolval is_small_set : t -> boolcardinal 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.
val cardinal_less_than : t -> int -> intcardinal_less_than t n returns the cardinal of t is this cardinal is at most n.
val cardinal_is_less_than : t -> int -> boolSame 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_interp.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).
Builds a sequence of integer values of the ival in increasing order. The resulting sequence might be infinite.
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.
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.
val interp_boolean : contains_zero:bool -> contains_non_zero:bool -> tExtract bits from start to stop from the given Ival, start and stop being included. size is the size of the entire ival.
val create_all_values : signed:bool -> size:int -> tall_values ~size v returns true iff v contains all integer values representable in size bits.
val backward_mult_int_left :
right:t ->
result:t ->
t option Lattice_bounds.or_bottomval backward_comp_int_left : Abstract_interp.Comp.t -> t -> t -> tbackward_comp_int op l r reduces l into l' so that l' op r holds. l is assumed to be an integer
val backward_comp_float_left_true :
Abstract_interp.Comp.t ->
Fval.kind ->
t ->
t ->
tval backward_comp_float_left_false :
Abstract_interp.Comp.t ->
Fval.kind ->
t ->
t ->
tSame as backward_comp_int_left, except that the arguments should now be floating-point values.
val forward_comp_int :
Abstract_interp.Comp.t ->
t ->
t ->
Abstract_interp.Comp.resultval scale_int_base : Int_Base.t -> t -> tval of_int : int -> tval of_int64 : int64 -> tCasts
Casts the given float into an integer. NaN and out-of-bounds values are ignored.
val reinterpret_as_float : Cil_types.fkind -> t -> tBitwise 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).
val complement_int_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 ival.
val pretty_debug : Format.formatter -> t -> unit