Frama-C API - Int_set
Small sets of integers.
Above a certain limit fixed by set_small_cardinal
, these sets must be converted into intervals. The functions that make the set grow returns a set_or_top
type : either the resulting sets is small enough, or it is converted into an interval.
Sets are always non-empty. The functions reducing the sets returns a set or_bottom
type: either the result is non-empty, or it is `Bottom.
Returns the limit above which integer sets are converted into intervals.
Sets the limit above which integer sets are converted into intervals. This is used by the Eva plugin according to the -eva-ilevel option. Do not use.
include Datatype.S_with_collections
include Datatype.S
include Datatype.S_no_copy
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
.
module Set : Datatype.Set with type elt = t
module Map : Datatype.Map with type key = t
module Hashtbl : Datatype.Hashtbl with type key = t
Creates the set with integers from + k*period
for k
in {0 ... number-1}
. The resulting set contains number
integers. There is no verification about number
, but it should be stritly positive.
Creates a set from an integer list. The list must not be empty, and the list length must not exceed the small cardinal limit.
val remove : t -> Integer.t -> t Lattice_bounds.or_bottom
Removes an integer from a set. Returns Bottom if the resulting set is empty.
val one : t
val zero : t
val minus_one : t
val zero_or_one : t
val cardinal : t -> int
Returns the number of integers in a set.
Iterators on the integers of a set.
val filter : (Integer.t -> bool) -> t -> t Lattice_bounds.or_bottom
Sets whose cardinal exceeds a certain limit must be converted into intervals. Functions that make sets grow returns either a set small enough, or the information needed to construct the corresponding interval: the smallest and highest elements, and the periodicity of the integers of the set.
apply2 f s1 s2
applies f i1 i2
for all integers i1 in s1 and i2 in s2.
Lattice structure.
val join : t -> t -> set_or_top
val link : t -> t -> set_or_top
val meet : t -> t -> t Lattice_bounds.or_bottom
val narrow : t -> t -> t Lattice_bounds.or_bottom
val diff_if_one : t -> t -> t Lattice_bounds.or_bottom
val complement_under : min:Integer.t -> max:Integer.t -> t -> set_or_top_or_bottom
Semantics.
See Int_val
for more details.
val add : t -> t -> set_or_top
val add_under : t -> t -> set_or_top
val mul : t -> t -> set_or_top
val c_rem : t -> t -> set_or_top_or_bottom