module Annotations:sig
..end
val code_annot : ?emitter:Emitter.t ->
?filter:(Cil_types.code_annotation -> bool) ->
Cil_types.stmt -> Cil_types.code_annotation list
emitter
(resp. filter
) is specified, return only the annotations that
has been generated by this emitter
(resp. that satisfies the given
predicate).val code_annot_emitter : ?filter:(Emitter.t -> Cil_types.code_annotation -> bool) ->
Cil_types.stmt -> (Cil_types.code_annotation * Emitter.t) list
Annotations.code_annot
, but also returns the emitter who emitted the
annotation.exception No_funspec of Emitter.t
val funspec : ?emitter:Emitter.t ->
?populate:bool -> Cil_types.kernel_function -> Cil_types.funspec
emitter
is specified, return only the annotations that
has been generated by this emitter
. If populate
is set to false
(default is true
), then the default contract of function declaration is
generated.No_funspec
whenever the given function has no specificationval behaviors : ?emitter:Emitter.t ->
?populate:bool ->
Cil_types.kernel_function ->
(Cil_types.identified_predicate, Cil_types.identified_term)
Cil_types.behavior list
emitter
and populate
is similar to Annotations.funspec
.No_funspec
whenever the given function has no specificationval decreases : ?emitter:Emitter.t ->
?populate:bool ->
Cil_types.kernel_function -> Cil_types.term Cil_types.variant option
emitter
and populate
is similar to Annotations.funspec
.No_funspec
whenever the given function has no specificationval terminates : ?emitter:Emitter.t ->
?populate:bool ->
Cil_types.kernel_function -> Cil_types.identified_predicate option
emitter
and populate
is similar to Annotations.funspec
.No_funspec
whenever the given function has no specificationval complete : ?emitter:Emitter.t ->
?populate:bool -> Cil_types.kernel_function -> string list list
emitter
and populate
is similar to Annotations.funspec
.No_funspec
whenever the given function has no specificationval disjoint : ?emitter:Emitter.t ->
?populate:bool -> Cil_types.kernel_function -> string list list
emitter
and populate
is similar to
Annotations.funspec
.No_funspec
whenever the given function has no specificationval model_fields : ?emitter:Emitter.t -> Cil_types.typ -> Cil_types.model_info list
val iter_code_annot : (Emitter.t -> Cil_types.code_annotation -> unit) -> Cil_types.stmt -> unit
val fold_code_annot : (Emitter.t -> Cil_types.code_annotation -> 'a -> 'a) ->
Cil_types.stmt -> 'a -> 'a
val iter_all_code_annot : ?sorted:bool ->
(Cil_types.stmt -> Emitter.t -> Cil_types.code_annotation -> unit) -> unit
sorted
is true
(the default), iteration is sorted according
to the location of the statements and by emitter. Note that the
sorted version is less efficient than the unsorted iteration.val fold_all_code_annot : ?sorted:bool ->
(Cil_types.stmt -> Emitter.t -> Cil_types.code_annotation -> 'a -> 'a) ->
'a -> 'a
sorted
argument.val iter_global : (Emitter.t -> Cil_types.global_annotation -> unit) -> unit
val fold_global : (Emitter.t -> Cil_types.global_annotation -> 'a -> 'a) -> 'a -> 'a
val iter_requires : (Emitter.t -> Cil_types.identified_predicate -> unit) ->
Cil_types.kernel_function -> string -> unit
val fold_requires : (Emitter.t -> Cil_types.identified_predicate -> 'a -> 'a) ->
Cil_types.kernel_function -> string -> 'a -> 'a
val iter_assumes : (Emitter.t -> Cil_types.identified_predicate -> unit) ->
Cil_types.kernel_function -> string -> unit
val fold_assumes : (Emitter.t -> Cil_types.identified_predicate -> 'a -> 'a) ->
Cil_types.kernel_function -> string -> 'a -> 'a
val iter_ensures : (Emitter.t ->
Cil_types.termination_kind * Cil_types.identified_predicate -> unit) ->
Cil_types.kernel_function -> string -> unit
val fold_ensures : (Emitter.t ->
Cil_types.termination_kind * Cil_types.identified_predicate -> 'a -> 'a) ->
Cil_types.kernel_function -> string -> 'a -> 'a
val iter_assigns : (Emitter.t -> Cil_types.identified_term Cil_types.assigns -> unit) ->
Cil_types.kernel_function -> string -> unit
val fold_assigns : (Emitter.t -> Cil_types.identified_term Cil_types.assigns -> 'a -> 'a) ->
Cil_types.kernel_function -> string -> 'a -> 'a
val iter_allocates : (Emitter.t -> Cil_types.identified_term Cil_types.allocation -> unit) ->
Cil_types.kernel_function -> string -> unit
val fold_allocates : (Emitter.t -> Cil_types.identified_term Cil_types.allocation -> 'a -> 'a) ->
Cil_types.kernel_function -> string -> 'a -> 'a
val iter_extended : (Emitter.t -> string * int * Cil_types.identified_predicate list -> unit) ->
Cil_types.kernel_function -> string -> unit
val fold_extended : (Emitter.t -> string * int * Cil_types.identified_predicate list -> 'a -> 'a) ->
Cil_types.kernel_function -> string -> 'a -> 'a
val iter_behaviors : (Emitter.t ->
(Cil_types.identified_predicate, Cil_types.identified_term)
Cil_types.behavior -> unit) ->
Cil_types.kernel_function -> unit
val fold_behaviors : (Emitter.t ->
(Cil_types.identified_predicate, Cil_types.identified_term)
Cil_types.behavior -> 'a -> 'a) ->
Cil_types.kernel_function -> 'a -> 'a
val iter_complete : (Emitter.t -> string list -> unit) -> Cil_types.kernel_function -> unit
val fold_complete : (Emitter.t -> string list -> 'a -> 'a) ->
Cil_types.kernel_function -> 'a -> 'a
val iter_disjoint : (Emitter.t -> string list -> unit) -> Cil_types.kernel_function -> unit
val fold_disjoint : (Emitter.t -> string list -> 'a -> 'a) ->
Cil_types.kernel_function -> 'a -> 'a
val iter_terminates : (Emitter.t -> Cil_types.identified_predicate -> unit) ->
Cil_types.kernel_function -> unit
val fold_terminates : (Emitter.t -> Cil_types.identified_predicate -> 'a -> 'a) ->
Cil_types.kernel_function -> 'a -> 'a
val iter_decreases : (Emitter.t -> Cil_types.term Cil_types.variant -> unit) ->
Cil_types.kernel_function -> unit
val fold_decreases : (Emitter.t -> Cil_types.term Cil_types.variant -> 'a -> 'a) ->
Cil_types.kernel_function -> 'a -> 'a
val add_code_annot : Emitter.t ->
?kf:Cil_types.kernel_function ->
Cil_types.stmt -> Cil_types.code_annotation -> unit
kf
is
provided, the function runs faster.
There might be at most one statement contract associated to a given statement and a given set of enclosing behaviors. Trying to associate more than one will result in a merge of the contracts.
The same things happens with loop assigns and allocates/frees.
There can be at most one loop variant registered per statement.
Attempting to register a second one will result in a fatal error.
val add_assert : Emitter.t ->
?kf:Cil_types.kernel_function ->
Cil_types.stmt -> Cil_types.predicate Cil_types.named -> unit
kf
is
provided, the function runs faster.val add_global : Emitter.t -> Cil_types.global_annotation -> unit
type'a
contract_component_addition =Emitter.t ->
Cil_types.kernel_function ->
?stmt:Cil_types.stmt -> ?active:string list -> 'a -> unit
stmt
). In the latter case active
may be used to state the
list of enclosing behavior(s) for which the contract is supposed to hold.
active
defaults to the empty list, meaning that the contract must
always hold.type'a
behavior_component_addition =Emitter.t ->
Cil_types.kernel_function ->
?stmt:Cil_types.stmt -> ?active:string list -> ?behavior:string -> 'a -> unit
behavior
inside a contract. The
contract is found in a similar way as for Annotations.contract_component_addition
functions. Similarly, active
has the same meaning as for
Annotations.contract_component_addition
.
Default for behavior
is Cil.default_behavior_name
.
Since Aluminium-20160501
val add_behaviors : ?register_children:bool ->
Cil_types.funbehavior list contract_component_addition
register_children
is true
(the default), inner clauses of the
behavior will also be registered by the function.val add_decreases : Emitter.t ->
Cil_types.kernel_function -> Cil_types.term Cil_types.variant -> unit
val add_terminates : Cil_types.identified_predicate contract_component_addition
val add_complete : string list contract_component_addition
Fatal
if one of the given name
is either an unknown behavior or Cil.default_behavior_name
.val add_disjoint : string list contract_component_addition
Fatal
if one of the given name
is either an unknown behavior or Cil.default_behavior_name
.val add_requires : Cil_types.identified_predicate list behavior_component_addition
val add_assumes : Cil_types.identified_predicate list behavior_component_addition
Does nothing but emitting a warning if an attempt is
made to add assumes clauses to the default behavior.
Change in Aluminium-20160501: restructuration of annotations management
val add_ensures : (Cil_types.termination_kind * Cil_types.identified_predicate) list
behavior_component_addition
val add_assigns : keep_empty:bool ->
Cil_types.identified_term Cil_types.assigns
behavior_component_addition
If keep_empty
is true
and the assigns clause were empty, then
the assigns clause remains empty. (That corresponds to the ACSL semantics of
an assigns clause: if no assigns is specified, that is equivalent to assigns
everything.)
Change in Aluminium-20160501: restructuration of annotations management
val add_allocates : Cil_types.identified_term Cil_types.allocation
behavior_component_addition
val add_extended : (string * int * Cil_types.identified_predicate list)
behavior_component_addition
val remove_code_annot : Emitter.t ->
?kf:Cil_types.kernel_function ->
Cil_types.stmt -> Cil_types.code_annotation -> unit
val remove_global : Emitter.t -> Cil_types.global_annotation -> unit
val remove_behavior : ?force:bool ->
Emitter.t ->
Cil_types.kernel_function ->
(Cil_types.identified_predicate, Cil_types.identified_term)
Cil_types.behavior -> unit
force
is false
(which is the default),
it is not possible to remove a behavior whose the name is used in a
complete/disjoint clause. If force
is true
, it is the responsibility
of the user to ensure that complete/disjoint clauses refer to existing
behaviors.val remove_behavior_components : Emitter.t -> Cil_types.kernel_function -> Cil_types.funbehavior -> unit
val remove_decreases : Emitter.t -> Cil_types.kernel_function -> unit
val remove_terminates : Emitter.t -> Cil_types.kernel_function -> unit
val remove_complete : Emitter.t -> Cil_types.kernel_function -> string list -> unit
val remove_disjoint : Emitter.t -> Cil_types.kernel_function -> string list -> unit
val remove_requires : Emitter.t ->
Cil_types.kernel_function -> Cil_types.identified_predicate -> unit
val remove_assumes : Emitter.t ->
Cil_types.kernel_function -> Cil_types.identified_predicate -> unit
val remove_ensures : Emitter.t ->
Cil_types.kernel_function ->
Cil_types.termination_kind * Cil_types.identified_predicate -> unit
val remove_allocates : Emitter.t ->
Cil_types.kernel_function ->
Cil_types.identified_term Cil_types.allocation -> unit
val remove_assigns : Emitter.t ->
Cil_types.kernel_function ->
Cil_types.identified_term Cil_types.assigns -> unit
val remove_extended : Emitter.t ->
Cil_types.kernel_function ->
string * int * Cil_types.identified_predicate list -> unit
val has_code_annot : ?emitter:Emitter.t -> Cil_types.stmt -> bool
true
iff there is some annotation attached to the given statement
(and generated by the given emitter, if any).val emitter_of_code_annot : Cil_types.code_annotation -> Cil_types.stmt -> Emitter.t
Not_found
if the code annotation does not exist, or if it is
registered at another statement.val emitter_of_global : Cil_types.global_annotation -> Emitter.t
Not_found
if the global annotation is not registered.val logic_info_of_global : string -> Cil_types.logic_info list
Not_found
if no global annotation declare such a variableval behavior_names_of_stmt_in_kf : Cil_types.kernel_function -> string list
val code_annot_of_kf : Cil_types.kernel_function ->
(Cil_types.stmt * Cil_types.code_annotation) list
val fresh_behavior_name : Cil_types.kernel_function -> string -> string
val code_annot_state : State.t
val funspec_state : State.t
val global_state : State.t
val populate_spec_ref : (Cil_types.kernel_function -> Cil_types.funspec -> bool) Pervasives.ref
val unsafe_add_global : Emitter.t -> Cil_types.global_annotation -> unit
val register_funspec : ?emitter:Emitter.t -> ?force:bool -> Cil_types.kernel_function -> unit
val remove_alarm_ref : (Emitter.Usable_emitter.t ->
Cil_types.stmt -> Cil_types.code_annotation -> unit)
Pervasives.ref