Frama-C:
Plug-ins:
Libraries:

Frama-C API - Set

Sets of equalities.

include Frama_c_kernel.Datatype.S
include Frama_c_kernel.Datatype.S_no_copy
val datatype_name : string

Unique name of the datatype.

val datatype_descr : t Frama_c_kernel.Descr.t

Datatype descriptor.

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 : (Frama_c_kernel.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.

val copy : t -> t

Deep copy: no possible sharing between x and copy x.

The set operators are redefined so that equalities involving a same term are joined: ∀ e₁, e₂ ∈ Set, e₁ ≠ e₂ ⇔ e₁ ∩ e₂ = ∅

val empty : t
val is_empty : t -> bool
val union : t -> t -> t
val inter : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : (equality -> unit) -> t -> unit
val fold : (equality -> 'a -> 'a) -> t -> 'a -> 'a
val for_all : (equality -> bool) -> t -> bool
val exists : (equality -> bool) -> t -> bool
val elements : t -> equality list
val choose : t -> equality
val remove : Hcexprs.kill_type -> Eva_ast.lval -> t -> t

remove lval set remove any expression e such that lval belongs to syntactic_lval e from the set of equalities set.

val unite : (elt * Hcexprs.lvalues) -> (elt * Hcexprs.lvalues) -> t -> t

unite (a, a_set) (b, b_set) map unites a and b in map. a_set must be equal to syntactic_lval a, and b_set to syntactic_lval b.

val find : elt -> t -> equality

find elt set return the (single) equality involving elt that belongs to set, or raise Not_found if no such equality exists.

val find_option : elt -> t -> equality option

Same as find, but return None in the last case.

val mem : equality -> t -> bool

mem equality set = true iff ∃ eq ∈ set, equality ⊆ eq

val contains : elt -> t -> bool

contains elt set = true iff elt belongs to an equality of set.

val deep_fold : (equality -> elt -> 'a -> 'a) -> t -> 'a -> 'a
val cardinal : t -> int
val lvalues_only_left : t -> t -> elt tree