Module Register.Hoare


module Hoare: Hoare_mem.Create(D)(A)(R)

val unsupported : ?model:string -> ('a, Format.formatter, unit, 'b) Pervasives.format4 -> 'a
module Shared: Hoare_lib.Create(D)
module F: D.F
module Model: sig .. end
val cast_loc_to_loc : Cil_types.typ -> Cil_types.typ -> 'a -> 'b
include struct ... end
val cvar : 'a -> Shared.Globals.t -> Model.loc
val field : Model.loc ->
Cil_types.fieldinfo -> Model.loc
val index : Model.loc ->
'a -> Model.D.integer -> Model.loc
val shift : Model.loc ->
'a -> Formula.integer F.term -> Model.loc
val startof : Model.loc -> 'a -> Model.loc
val field_access : Formula.abstract F.term ->
Cil_types.fieldinfo -> Model.D.abstract

type mem = {
   variables : F.var Cil_datatype.Varinfo.Hashtbl.t;
}
type frame = {
   kf : Kernel_function.t;
   mutable states : (Clabels.c_label * mem) list;
   mutable result : F.var option;
   mutable exit_status : F.var option;
   mutable ret_type : Cil_types.typ option;
}
val new_frame : Kernel_function.t ->
m_here:mem option ->
m_pre:mem option ->
m_post:mem option ->
F.var option -> frame
val new_mem : unit -> mem
val mem_at : frame -> Clabels.c_label -> mem
gives the memory state for that label. Create it if it doesn't exist.
val get_var : create:bool ->
mem ->
Cil_datatype.Varinfo.Hashtbl.key -> F.var
Get the wp variable of the C variable. With create, create it if it doesn't exist.
Raises Not_found when create=false and the variable doesn't exist.
val result : frame -> F.var * Cil_types.typ
val exit_status : frame -> F.var
val set_exit_status : frame -> F.var -> frame
val get_exit_status : frame -> F.var option
val term_load : mem ->
Model.loc -> Formula.abstract F.term
val load : mem ->
Ctypes.c_object -> Model.loc -> value
val base_address : 'a -> Model.loc -> Model.loc
val block_length : 'a -> Model.loc -> Formula.integer D.F.term
type wp = F.pred 
val update_at_label : frame ->
Clabels.c_label ->
Model.D.F.pred -> Model.D.F.pred
val quantify_at_label : frame ->
Clabels.c_label ->
Model.D.F.pred -> Model.D.F.pred
val mk_mu : mem ->
Model.loc ->
F.var *
(Model.D.abstract ->
Formula.abstract F.term) *
(Model.D.abstract ->
Formula.abstract F.term ->
Model.D.abstract)
compute m_0 where : mu_i = mu (obj_(i-1), d_i -> mu_(i+1)) and at the last step (n), mu_(n+1) = exp. obj_i is the expression of lval at step (i).

For instance, if lval is x.d1.d2.d3, obj_0 = x ; mu_0 = mu_1 obj_1 = x.d1 ; mu_1 = mu (obj_0, d1 -> mu_2) etc. So finally, we should get : mu_0 = mu (x, d1 -> mu (x.d1, d2 -> mu (x.d1.d2, d3 -> exp)))

The recursive call at step (i) returns :

obj_0 is not always (F.var v) because of range (see havoc functions).
val get_var_and_mu : mem ->
Model.loc ->
Formula.abstract F.term ->
F.var * Model.D.abstract
Returns (v, mu) where v is the variable to substitute (base of lval), and mu the expression of its new value after and assignment lval = exp;
val subst : frame ->
Model.loc ->
Formula.abstract F.term ->
Model.D.F.pred -> Model.D.F.pred
val subst_lval : frame ->
'a ->
Model.loc ->
value -> Model.D.F.pred -> Model.D.F.pred
val subst_result : frame ->
value option ->
Model.D.F.pred -> Model.D.F.pred
val add_array_length_hyp : 'a -> Cil_types.varinfo -> F.pred -> F.pred
val add_var_decl_hyp : 'a -> F.pred -> Cil_types.varinfo -> F.pred
Add some hypotheses about the variable because we are going out of its scope. The quantification could be done here, but it is done through quantify_at_vars I guess.
val local_scope : frame ->
Cil_types.varinfo list ->
Mcfg.scope -> F.pred -> F.pred
process local scope : bool=true for allocation, false for free
val valid : 'a ->
Model.loc Model.D.assigned -> D.F.pred
val separated : Model.loc Model.D.assigned ->
Model.loc Model.D.assigned -> D.F.pred
type m_dzone 
type dzone = m_dzone F.term 
val tau_of_dzone : Formula.tau
val dzone_assigned : 'a -> 'b
val dzone_subset : 'a -> 'b -> 'c
val dzone_union : 'a -> 'b -> 'c
val dzone_empty : unit -> 'a
val effect_supported : bool
type region 
val pp_region : 'a -> 'b -> unit
val region_assigned : 'a -> 'b
val region_empty : 'a -> 'b
val region_union : 'a -> 'b -> 'c
val region_included : 'a -> 'b -> 'c
val region_separated : 'a -> 'b -> 'c
val region_fingerprint : 'a -> 'b -> 'c
val region_supported : bool
val assigns_goal : 'a -> 'b -> 'c -> 'd
val assigns_supported : bool
val subst_havoc : frame ->
Model.loc Model.D.assigned ->
Model.D.havoc list
Compute the WP for the predicate p of something that modifies only the assigned locations out_locs. The idea is to assigns arbitrary values "out" to the lvalues in out_locs. Because the modified locations are evaluated in the pre-state, we don't have commutativity problems, ie. assigns X, TX can be processed in any order because the X in mu (T, .(X) -> out) is \at(Lbefore, X).
type closure = Cil_types.varinfo * string 
val pp_closure : Format.formatter -> Cil_types.varinfo * string -> unit
val userdef_frame : unit -> frame
val collect_signature : 'a -> 'b -> 'c -> 'c list * ('b * 'a) list -> 'c list * ('b * 'a) list
val userdef_signature : frame ->
'a ->
'b ->
F.var list *
(Cil_datatype.Varinfo.Hashtbl.key * string) list
val userdef_closure : mem ->
Cil_datatype.Varinfo.Hashtbl.key * 'a -> 'b F.term
val label_at_closure : 'a * 'b -> 'b