Module WpAnnot


module WpAnnot: sig .. end
Every access to annotations have to go through here, so this is the place where we decide what the computation is allowed to use.

val rte_wp : (string * (Db_types.kernel_function -> bool) * string) list
val rte_generated : Db_types.kernel_function -> bool
val missing_rte : Db_types.kernel_function -> string list
val compute_rte_for : Db_types.kernel_function -> unit
val ip_complete : Db_types.kernel_function -> Property.identified_property list
val ip_disjoint : Db_types.kernel_function -> Property.identified_property list
val ip_contract : Db_types.kernel_function -> Property.identified_property list
val ip_external : Db_types.kernel_function -> Property.identified_property list
module FunctionContracts: Wprop.Indexed2(Dashtbl.Default_key_marshaler(Kernel_function))(Dashtbl.Default_key_marshaler(Datatype.String))(sig
type key = Db_types.kernel_function * string 
val size : int
val kind : [> `Correctness ]
val dependencies : State.t list
val state_name : Kernel_function.t * string -> string
val state_proxy : Db_types.kernel_function * 'a ->
'b -> (string * Property.identified_property list) option
end)
module LoopInvariants: Wprop.Indexed(Dashtbl.Default_key_marshaler(Cil_datatype.Stmt))(sig
type key = Cil_types.stmt 
val size : int
val kind : [> `Correctness ]
val dependencies : State.t list
val state_name : Cil_types.stmt -> string
val state_proxy : 'a -> 'b -> 'c option
end)
module LoopConsolidation: Wprop.Updater(sig
val name : string
val kind : [> `Correctness ]
val dependencies : State.t list
end)
module WPUnreachable: Wprop.Updater(sig
val name : string
val kind : [> `Correctness ]
val dependencies : State.t list
end)

type prop_kind =
| PKProp
| PKEstablished
| PKPreserved
| PKPropLoop
| PKVarDecr
| PKVarPos
| PKAFctOut
| PKAFctExit

type prop_id = {
   p_kind : prop_kind;
   p_prop : Property.t;
   p_part : (int * int) option;
}
Kind of PO: normal, establishment, preservation, ...
val property_of_id : prop_id -> Property.t
returns the annotation which lead to the given PO.
val pid_for_function : FunctionContracts.key1 ->
model:FunctionContracts.key2 -> prop_id
module PropSet: Property.Set

type proof = {
   target : Property.t;
   proved : proofpart array;
   induction : Cil_types.stmt option;
   mutable dependencies : PropSet.t;
   mutable invariants : PropSet.t;
}
A proof accumulator for a set of related prop_id

type proofpart =
| Noproof
| Complete
| Parts of Bitvector.t
type induction = Cil_types.stmt option 
val is_assigns : prop_id -> bool
val is_requires : prop_id -> bool
val get_stmt : Property.identified_property -> Cil_types.stmt option
val get_induction : prop_id -> Cil_types.stmt option
val target : proof -> Property.t
val dependencies : proof -> PropSet.elt list
val subproofs : prop_kind -> int
val subproof_idx : prop_kind -> int
val create_proof : prop_id -> proof
to be used only once for one of the related prop_id
val add_proof : proof -> prop_id -> prop_id list -> unit
accumulate int the proof the partial proof for this prop_id
val is_composed : proof -> bool
whether a proof needs several lemma to be complete
val is_proved : proof -> bool
wether all partial proofs have been accumulated or not
val consolidate_loop : proof -> unit
val mk_prop : prop_kind -> Property.t -> prop_id
val mk_annot_id : Db_types.kernel_function ->
Cil_types.stmt -> Cil_types.code_annotation -> Property.identified_property
val mk_code_annot_id : Db_types.kernel_function ->
Cil_types.stmt -> Cil_types.code_annotation -> prop_id
val mk_establish_id : Db_types.kernel_function ->
Cil_types.stmt -> Cil_types.code_annotation -> prop_id
val mk_preserve_id : Db_types.kernel_function ->
Cil_types.stmt -> Cil_types.code_annotation -> prop_id
val mk_inv_hyp_id : Db_types.kernel_function ->
Cil_types.stmt -> Cil_types.code_annotation -> prop_id
val mk_var_decr_id : Db_types.kernel_function ->
Cil_types.stmt -> Cil_types.code_annotation -> prop_id
val mk_var_pos_id : Db_types.kernel_function ->
Cil_types.stmt -> Cil_types.code_annotation -> prop_id
val mk_disj_bhv_id : Property.identified_disjoint -> prop_id
val mk_compl_bhv_id : Property.identified_complete -> prop_id
val mk_decrease_id : Property.identified_decrease -> prop_id
val mk_axiom_id : string -> prop_id
val mk_stmt_assigns_id : Property.identified_assigns -> prop_id
val mk_loop_assigns_id : Property.identified_assigns -> prop_id
val mk_fout_assigns_id : Property.identified_assigns -> prop_id
val mk_exit_assigns_id : Property.identified_assigns -> prop_id
val mk_predicate_id : Property.identified_predicate -> prop_id
val mk_pre_id : Db_types.kernel_function ->
Cil_types.kinstr ->
Cil_types.funbehavior -> Cil_types.identified_predicate -> prop_id
val mk_stmt_post_id : Db_types.kernel_function ->
Cil_types.stmt ->
Cil_types.funbehavior ->
Cil_types.termination_kind ->
Cil_types.identified_predicate -> prop_id
val mk_fct_post_id : Db_types.kernel_function ->
Cil_types.funbehavior ->
Cil_types.termination_kind ->
Cil_types.identified_predicate -> prop_id
val split : (prop_id -> 'a -> unit) -> prop_id -> 'a Bag.t -> unit
val pp_names : Format.formatter -> string list -> unit
val code_annot_names : Cil_types.code_annotation -> string list
val user_prop_names : prop_id -> string list
val string_of_termination_kind : Cil_types.termination_kind -> string
val predicate_kind_txt : Property.predicate_kind -> Cil_types.kinstr -> string
val id_prop_txt : Property.identified_property -> string
val prop_main : prop_id -> string
val prop_txt : prop_id -> string
generates an unique name for a given PO.
val label_of_kind : prop_kind -> string
val label_of_prop_id : prop_id -> string
Short description of the kind of PO
val pp_id : Format.formatter -> prop_id -> unit
val kind_order : prop_kind -> int
val compare_prop_id : prop_id -> prop_id -> int
val set_unreachable : prop_id -> unit
type t_pred = Cil_types.predicate Cil_types.named 

type a_fun =
| Assigns_FctOut
| Assigns_FctExit
| Assigns_Stmt
| Assigns_Loop

type a_kind =
| LoopAssigns
| StmtAssigns

type t_assigns = {
   a_label : Cil_types.logic_label;
   a_fun : a_fun;
   a_kind : a_kind;
   a_assigns : Cil_types.identified_term Cil_types.assigns list;
}
type t_axiom = string * Cil_types.logic_label list * Cil_types.predicate Cil_types.named 
type t_id_pred = prop_id * t_pred 
type t_id_axiom = prop_id * t_axiom 
type t_id_assigns = prop_id * t_assigns 
val body_of_id_pred : 'a * 'b -> 'b
val id_of_id_pred : 'a * 'b -> 'a
val body_of_id_assigns : 'a * 'b -> 'b
val id_of_id_assigns : 'a * 'b -> 'a

type annot_kind =
| Ahyp
| Agoal
| Aboth
| Acut
| Ainv
val new_loops : bool

type t_annots = {
   p_hyp : t_id_pred list;
   p_goal : t_id_pred list;
   p_both : (bool * t_id_pred) list;
   p_cut : (bool * t_id_pred) list;
   p_inv : (bool * t_id_pred) list;
   a_goal : t_id_assigns option;
   a_hyp : t_id_assigns option;
}
val get_goal_only : t_annots -> t_id_pred list
val get_hyp_only : t_annots -> t_id_pred list
val get_hyp_goal : t_annots -> t_id_pred list
the bool in get_cut results says if the property has to be considered as a both goal and hyp (goal=true, or hyp only (goal=false)
val get_cut : t_annots -> (bool * t_id_pred) list
get_inv only gives the general invariants (not loop invariant)
val get_inv : t_annots -> t_id_pred list
val get_asgn_hyp : t_annots -> t_id_assigns option
val get_asgn_goal : t_annots -> t_id_assigns option
val pp_annots : Format.formatter -> t_annots -> unit
module Hannots: Cil2cfg.HE(sig
type t = WpAnnot.t_annots 
end)

type assigns =
| NoAssigns
| OnlyAssigns
| WithAssigns

type asked_bhv =
| FunBhv of string
| StmtBhv of Cil2cfg.node * Cil_types.stmt * string

type asked_prop =
| AllProps
| NamedProp of string
| IdProp of Property.t
module HdefAnnotBhv: Cil2cfg.HE(sig
type t = Cil_types.stmt * int 
end)

type strategy_info = {
   kf : Kernel_function.t;
   cfg : Cil2cfg.t;
   new_loops : bool;
   cur_bhv : asked_bhv;
   asked_bhvs : asked_bhv list;
   asked_prop : asked_prop;
   assigns_filter : assigns;
   def_annots_info : HdefAnnotBhv.t;
}
val new_loop_computation : strategy_info -> bool

type strategy_for_froms = {
   get_pre : unit -> t_annots;
}
type strategy_kind =
| SKannots (*normal mode for annotations*)
| SKfroms of strategy_for_froms

type strategy = {
   behavior_name : string option;
   info : strategy_info;
   has_asgn_goal : bool; (*Tell if the stategy includes some other goals*)
   has_prop_goal : bool; (*Tell if the stategy includes some arbitrary invariant properties*)
   has_inv_prop : Cil2cfg.edge list;
   get_annots : Cil2cfg.edge -> t_annots;
   global_axioms : t_id_axiom list;
   called_preconditions : Kernel_function.t -> t_id_pred list;
   called_postconditions : Kernel_function.t -> t_id_pred list;
   called_exit_postconditions : Kernel_function.t -> t_id_pred list;
   called_assigns : Kernel_function.t -> Cil_types.identified_term Cil_types.assigns list;
   strategy_kind : strategy_kind;
}
val has_asgn_goal : bool Pervasives.ref
val has_prop_goal : bool Pervasives.ref
val pp_assigns_mode : Format.formatter -> strategy_info -> unit
val pp_asked_prop : Format.formatter -> strategy_info -> unit
val pp_strategy_info : Format.formatter -> strategy_info -> unit
val cur_fct_default_bhv : strategy_info -> bool
val proved : prop_id -> bool
val goal_to_select : strategy_info -> prop_id -> bool
val empty_acc : t_annots
val merge_acc : t_annots -> t_annots -> t_annots
val add_prop : strategy_info ->
t_annots ->
annot_kind ->
NormAtLabels.label_mapping * prop_id *
Cil_types.predicate Cil_types.named -> t_annots
val add_glob_axiom : string ->
(prop_id *
(string * Cil_types.logic_label list * Cil_types.predicate Cil_types.named))
list ->
Cil_types.logic_label list ->
Cil_types.predicate Cil_types.named ->
(prop_id *
(string * Cil_types.logic_label list * Cil_types.predicate Cil_types.named))
list
val prepare_pre_pred : strategy_info ->
Cil_types.kinstr ->
Cil_types.funbehavior ->
Cil_types.identified_predicate ->
Cil_types.predicate Cil_types.named ->
NormAtLabels.label_mapping * prop_id *
Cil_types.predicate Cil_types.named
val prepare_pre : strategy_info ->
Cil_types.kinstr ->
Cil_types.funbehavior ->
Cil_types.identified_predicate ->
NormAtLabels.label_mapping * prop_id *
Cil_types.predicate Cil_types.named
val prepare_fct_post : strategy_info ->
Cil_types.funbehavior ->
Cil_types.termination_kind ->
'a ->
Cil_types.identified_predicate ->
NormAtLabels.label_mapping * prop_id *
Cil_types.predicate Cil_types.named
val prepare_stmt_spec_post : strategy_info ->
Cil_types.funbehavior ->
Cil_types.stmt ->
Cil_types.logic_label option ->
Cil_types.predicate Cil_types.named ->
Cil_types.termination_kind ->
Cil_types.identified_predicate ->
NormAtLabels.label_mapping * prop_id *
Cil_types.predicate Cil_types.named
val prepare_var_decr : strategy_info ->
Cil_types.stmt ->
Cil_types.code_annotation ->
'a -> NormAtLabels.label_mapping * prop_id * 'a
val prepare_var_pos : strategy_info ->
Cil_types.stmt ->
Cil_types.code_annotation ->
'a -> NormAtLabels.label_mapping * prop_id * 'a
val prepare_inv_establish : strategy_info ->
Cil_types.stmt ->
Cil_types.code_annotation ->
'a -> NormAtLabels.label_mapping * prop_id * 'a
val prepare_inv_preserve : strategy_info ->
Cil_types.stmt ->
Cil_types.code_annotation ->
'a -> NormAtLabels.label_mapping * prop_id * 'a
val prepare_inv_fixpoint : strategy_info ->
Cil_types.stmt ->
Cil_types.code_annotation ->
'a -> NormAtLabels.label_mapping * prop_id * 'a
val prepare_behaviors_spec : Cil_types.kinstr -> 'a -> 'b -> NormAtLabels.label_mapping * 'a * 'b
val prepare_annot : bool ->
strategy_info ->
Cil_types.stmt ->
Cil_types.logic_label option ->
Cil_types.code_annotation ->
'a -> NormAtLabels.label_mapping * prop_id * 'a
val add_assigns : strategy_info ->
annot_kind ->
Cil_types.kinstr ->
Cil_types.funbehavior option ->
Cil_types.identified_term Cil_types.assigns list ->
t_annots -> t_assigns -> t_annots
val merge_assigns : NormAtLabels.label_mapping ->
Cil_types.identified_term Cil_types.assigns list ->
Cil_types.identified_term Cil_types.assigns list
val add_loop_assigns : strategy_info ->
annot_kind ->
Cil_types.stmt ->
Cil_types.identified_term Cil_types.assigns list ->
t_annots -> t_annots
val ki_assigns_labels : Cil_types.kinstr -> Cil_types.logic_label * NormAtLabels.label_mapping
val get_spec_assigns : Cil_types.kinstr ->
('a, Cil_types.identified_predicate, Cil_types.identified_term)
Cil_types.spec ->
Cil_types.logic_label * Cil_types.identified_term Cil_types.assigns list
val add_bhv_assigns : strategy_info ->
annot_kind ->
Cil_types.kinstr ->
t_annots ->
a_fun -> Cil_types.funbehavior -> t_annots
val add_spec_assigns_as_hyp : strategy_info ->
Cil_types.kinstr ->
t_annots ->
('a, Cil_types.identified_predicate, Cil_types.identified_term)
Cil_types.spec -> t_annots
val get_named_bhv : string ->
('a, 'b) Cil_types.behavior list -> ('a, 'b) Cil_types.behavior option
val get_behav : strategy_info ->
Cil_types.kinstr ->
('a, 'b) Cil_types.behavior list -> ('a, 'b) Cil_types.behavior option
val get_behavior_names : with_default:bool -> ('a, 'b, 'c) Cil_types.spec -> string list

type test_behav_res =
| TBRno
| TBRhyp
| TBRpart
| TBRok
val is_annot_for_config : strategy_info ->
Cil2cfg.edge list -> Cil_types.stmt -> string list -> test_behav_res
val build_bhv_assumes : (Cil_types.identified_predicate, 'a) Cil_types.behavior ->
Cil_types.predicate Cil_types.named
val get_bhv_assumes : ('a, Cil_types.identified_predicate, 'b) Cil_types.spec ->
string list -> Cil_types.predicate Cil_types.named list
val add_fct_pre : strategy_info ->
t_annots -> Cil_types.funspec -> t_annots
val get_fct_post : strategy_info ->
Cil_types.termination_kind ->
('a, Cil_types.identified_predicate, Cil_types.identified_term)
Cil_types.spec -> t_annots
val get_variant : (Cil_types.term, 'a, 'b) Cil_types.spec -> unit
val get_terminates : ('a, Cil_types.identified_predicate, 'b) Cil_types.spec -> unit
val add_disjoint_behaviors_props : strategy_info ->
Cil_types.kinstr ->
('a, Cil_types.identified_predicate, 'b) Cil_types.spec ->
t_annots -> t_annots
val add_complet_behaviors_props : strategy_info ->
Cil_types.kinstr ->
('a, Cil_types.identified_predicate, 'b) Cil_types.spec ->
t_annots -> t_annots
val add_behaviors_props : strategy_info ->
Cil_types.kinstr ->
('a, Cil_types.identified_predicate, 'b) Cil_types.spec ->
t_annots -> t_annots
val add_stmt_spec_precond_as_hyp : strategy_info ->
Cil_types.stmt ->
('a, Cil_types.identified_predicate, Cil_types.identified_term)
Cil_types.spec -> t_annots -> t_annots
val add_stmt_spec_postcond : strategy_info ->
Cil_types.stmt ->
Cil_types.logic_label option ->
Cil_types.funbehavior ->
annot_kind ->
t_annots * t_annots -> t_annots * t_annots
val add_stmt_spec_before : strategy_info ->
Cil_types.stmt ->
('a, Cil_types.identified_predicate, Cil_types.identified_term)
Cil_types.spec -> t_annots -> t_annots
val add_stmt_spec_after : strategy_info ->
Cil_types.stmt ->
Cil_types.logic_label option ->
(Cil_types.term, Cil_types.identified_predicate, Cil_types.identified_term)
Cil_types.spec ->
t_annots * t_annots -> t_annots * t_annots
val get_stmt_annots : strategy_info ->
loop:bool ->
Cil2cfg.edge list ->
Cil_types.stmt ->
Cil_types.logic_label option ->
t_annots * (t_annots * t_annots)
val mk_variant_properties : Cil_types.stmt ->
Cil_types.term ->
Cil_types.predicate Cil_types.named * Cil_types.predicate Cil_types.named
val get_loop_annots : strategy_info ->
Cil2cfg.edge list ->
Cil_types.stmt -> t_annots * t_annots * t_annots
val get_fct_assigns : strategy_info ->
a_fun ->
('a, Cil_types.identified_predicate, Cil_types.identified_term)
Cil_types.spec -> t_annots
val add_on_edges : Hannots.t -> Hannots.ti -> Cil2cfg.edge list -> unit
val get_behavior_annots : Cil2cfg.t -> strategy_info -> Cil2cfg.edge list * Hannots.t
val get_ext_preconditions : Kernel_function.t ->
('a, Cil_types.identified_predicate, Cil_types.identified_term)
Cil_types.spec ->
(prop_id * Cil_types.predicate Cil_types.named) list
val get_ext_postconditions : Kernel_function.t ->
Cil_types.termination_kind ->
(prop_id * Cil_types.predicate Cil_types.named) list
val get_ext_fct_assigns : ('a, Cil_types.identified_predicate, Cil_types.identified_term)
Cil_types.spec -> Cil_types.identified_term Cil_types.assigns list
val get_global_annotations : unit ->
(prop_id *
(string * Cil_types.logic_label list * Cil_types.predicate Cil_types.named))
list
val behavior_name_of_config : strategy_info -> string option
val build_bhv_strategy : strategy_info -> strategy
val internal_function_behaviors : Cil2cfg.t ->
(Cil2cfg.node * Cil_types.stmt * string) list * HdefAnnotBhv.t
val get_asked_bhv_from_name : (Cil2cfg.node * Cil_types.stmt * string) list ->
string list -> Cil_types.kinstr option -> string -> asked_bhv list
val process_unreached_annots : Cil2cfg.t -> Cil2cfg.node_type list -> unit
Get the not yet proved properties of unreachable CFG nodes.
val get_loop_assigns_for_from : Cil_types.stmt -> Cil_types.identified_term Cil_types.assigns list
val mk_assign_annots_for_froms : strategy_info ->
Cil_types.funbehavior ->
'a -> Cil_types.identified_term Cil_types.assigns -> Hannots.t
val call_post_for_froms : Kernel_function.t ->
Cil_types.termination_kind ->
(prop_id * Cil_types.predicate Cil_types.named) list
val mk_assign_strategy_for_froms : strategy_info ->
Cil_types.funbehavior ->
t_annots ->
int -> Cil_types.identified_term Cil_types.assigns -> strategy
val build_strategy_for_froms : strategy_info -> strategy list
val do_froms : unit -> bool
val get_strategies : assigns ->
Cil2cfg.t ->
string list option ->
Cil_types.kinstr option -> asked_prop -> strategy list
val get_prop_strategies : ?assigns:assigns ->
Cil2cfg.t -> string list option * string -> strategy list
Similar to get_id_prop_strategies but with a named property. (useful for command line option). The behavior list has to be the behaviors of the property. TODO: it should be removed when we will be able to compute it.
val get_id_prop_strategies : ?assigns:assigns -> Cil2cfg.t -> Property.t -> strategy list
Compute the strategies to prove the selected property.
val get_behavior_strategies : ?assigns:assigns -> Cil2cfg.t -> string list -> strategy list
Compute the strategy to prove all the properties of the behavior. Notice that is a property is related to several behaviors, it might not be fully proved with this strategy. Can return more strategies than names in the input list because a name can be used for several (disjoint) statement spec.
val get_function_strategies : ?assigns:assigns -> Cil2cfg.t -> strategy list
Compute the strategies to prove all the properties of the selected function.