Module Caveat_fol


module Caveat_fol: sig .. end
Specific Formula.S implementation for Caveat memory model implemented in Caveat_mem

val unsupported : ?model:string -> ('a, Format.formatter, unit, 'b) Pervasives.format4 -> 'a

Types



type data =
| D1null
| D1base of data
| D1addr of Cil_types.varinfo * Formula.tau (*D1addr(v,t) address of v where t is the type of v (not of its address.*)
| D1var of (Cil_types.varinfo * Clabels.c_label) option * Fol.Var.t
| D1depl of data * epath
| D1shift of data * dterm
| D1proj of data * epath
| D1indir of data
| D1mu of data * epath * dterm option
| D1muRange of data * dterm
| D1muI of data * dterm option * dterm option
| D1muIrange of data * dterm
Defines the data type for model Caveat. Everything is quite straitforward, except D1var. Notice that the operations like D1proj and co take a data as argument instead of a dterm like in previous versions. This ensures that we only deel with known data expressions. That is why we need D1var then, even if it can look redondant with Fol.Tvar. A D1var can represent a C variable when the option argument is Some x; the label says at which program point it's value is taken. Nonetheless, it can be None to represent logic variables. Don't forget that some logic variables can be used as temporaries and can be replace later on by C data, so we need to keep the data specific representation. Notice that the mu operation take an _optional_ expression : None means that we don't know the value, so it behaves like an havoc.

type epath =
| Pfield of Cil_types.fieldinfo
| Pidx of dterm
type dterm = data Fol.d_term 
type pred = dterm Fol.t_pred 
type 'a term = dterm 
include Fol_gformula
include Fol_gformula.Langage
include struct ... end

Variables


type fvar = Fol.Var.t 
type var = fvar 
val eq_var : Fol.Var.t -> Fol.Var.t -> bool
type pool = unit 
val pool : unit -> unit
val kind_of_var : Fol.Var.t -> Formula.kind
val fresh : 'a -> string -> Formula.kind -> Fol.Var.t
val freshen : 'a -> Fol.Var.t -> Fol.Var.t
val fvar_of_cvar : Cil_types.varinfo -> Formula.tau -> Fol.Var.t
This variable has to be used for the value of v at Here.
val get_var : create:bool ->
Fol.Var.t Cil_datatype.Varinfo.Hashtbl.t option ->
Clabels.c_label ->
Cil_datatype.Varinfo.Hashtbl.key ->
(Cil_datatype.Varinfo.Hashtbl.key -> Formula.tau) -> Fol.Var.t
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 fvar_of_cvar_at : create:bool ->
Fol.Var.t Cil_datatype.Varinfo.Hashtbl.t ->
Clabels.c_label ->
Cil_datatype.Varinfo.Hashtbl.key ->
(Cil_datatype.Varinfo.Hashtbl.key -> Formula.tau) -> Fol.Var.t
val tau_of_var : Fol.Var.t -> Formula.tau
val name_of_var : Fol.Var.t -> string
val basename_of_var : Fol.Var.t -> string
val data_of_lvar : Fol.Var.t -> data
val data_of_cvar_at : Fol.Var.t Cil_datatype.Varinfo.Hashtbl.t option ->
Clabels.c_label ->
Cil_datatype.Varinfo.Hashtbl.key ->
(Cil_datatype.Varinfo.Hashtbl.key -> Formula.tau) -> data
val data_of_cvar_at_l : Fol.Var.t Cil_datatype.Varinfo.Hashtbl.t ->
Clabels.c_label ->
Cil_datatype.Varinfo.Hashtbl.key ->
(Cil_datatype.Varinfo.Hashtbl.key -> Formula.tau) -> data
val term_of_var : Fol.Var.t -> 'a Fol.d_term
val var : Fol.Var.t -> 'a Fol.d_term
for Formula signature

Comparison


val eq_data : data -> data -> bool
val eq_epath : epath -> epath -> bool
val eq_term_opt : dterm option -> dterm option -> bool
val eq_term : dterm -> dterm -> bool

Ctypes


val ctype_of_fvar : Fol.Var.t -> Cil_types.typ option

Pretty Printers


val pp_var : Format.formatter -> Fol.Var.t -> unit
val pp_data : Format.formatter -> data -> unit
val pp_epath : Format.formatter -> epath -> unit
val pp_term : Format.formatter -> dterm -> unit
val pp_term_opt : Format.formatter -> dterm option -> unit
module Data: sig .. end
include struct ... end

Term smart constructors


val null : data
val base : data -> data
val addr : Cil_types.varinfo -> Formula.tau -> data
val shift_field : data -> Cil_types.fieldinfo -> data
val shift_index : data -> dterm -> data
val shift_epath : data -> epath -> data
val mk_mu : data ->
epath -> dterm option -> data
val mk_mu_range : data -> dterm -> data
val mk_mu_sh_indir : data ->
dterm option -> dterm option -> data
val mk_mu_range_indir : data -> dterm -> data
val shift_pointer : data -> dterm -> data
val proj : data -> epath -> dterm
val data_of_term : Data.d Fol.d_term -> Data.d
val indir_at : Fol.Var.t Cil_datatype.Varinfo.Hashtbl.t option ->
Clabels.c_label -> data -> dterm
val indir_here : data -> dterm
val indir : Fol.Var.t Cil_datatype.Varinfo.Hashtbl.t ->
Clabels.c_label -> data -> dterm
val term_of_data : 'a -> 'a Fol.d_term
val addr_of_data : data -> data
Pre the data should represent an object (as oposed to an address).
Raises Not_found when the data is based on a logic variable, because it cannot have any address.
Returns the data that represent the address of the data d.
include Fol_gformula.Predicate

Propagation in data


val do_path : (dterm -> dterm) ->
epath -> epath
val do_exp_in_data : (dterm -> dterm) -> data -> dterm
propagate expression transformation do_exp in the data d
val do_data_rec : (Data.d -> data) ->
(dterm -> dterm) ->
Data.d -> data
propagate transformations do_data and do_exp in d. Also apply do_data on the new d.

Substitution


val subst_data_in_pred : (Data.d -> Data.d) ->
Data.d Fol.d_term Fol.t_pred ->
Data.d Fol.d_term Fol.t_pred
val mk_let : fresh:bool ->
Fol.Var.t ->
data Fol.d_term ->
data Fol.d_term Fol.t_pred ->
data Fol.d_term Fol.t_pred
val p_subst : 'a ->
Fol.Var.t ->
data Fol.d_term ->
data Fol.d_term Fol.t_pred ->
data Fol.d_term Fol.t_pred
val e_rename : (Fol.Var.t * Fol.Var.t) list -> dterm -> dterm

Quantification


val p_forall : Fol.Var.t list -> data Fol.d_pred -> data Fol.d_pred
val p_exists : Fol.Var.t list -> data Fol.d_pred -> data Fol.d_pred
val data_has_var : Fol.Var.t list -> data -> bool
val path_has_var : Fol.Var.t list -> epath -> bool
val term_has_var : Fol.Var.t list -> dterm -> bool
val term_opt_has_var : Fol.Var.t list -> dterm option -> bool
val pred_has_var : Fol.Var.t list -> dterm Fol.t_pred -> bool
val term_closed : 'a Fol.d_term -> bool
val pred_closed : 'a Fol.d_pred -> bool
type alpha = Fol.Var.t Fol.Vmap.t 
val empty_alpha : 'a Fol.Vmap.t
val fold_alpha : (Fol.Vmap.key -> 'a -> 'b -> 'b) -> 'a Fol.Vmap.t -> 'b -> 'b
val data_alpha_cv : 'a -> data -> 'a * data
val p_more_alpha_cv : Fol.Var.t Fol.Vmap.t ->
data Fol.d_pred ->
Fol.Var.t Fol.Vmap.t * data Fol.d_pred
val p_alpha_cv : data Fol.d_pred -> Fol.Var.t list * data Fol.d_pred

Visit/fold


val visit_path : ('a -> dterm -> 'a) -> 'a -> epath -> 'a
val visit_exp_in_data : ('a -> data -> 'a) ->
('a -> dterm -> 'a) -> 'a -> data -> 'a
do_sub_data is a function applied to each sub-data of d (NOT on d). if not given, only visit sub-data to apply do_exp to expressions.
val visit_data_in_pred : all:bool ->
(('a -> dterm -> 'a) -> 'a -> data -> 'a) ->
'a -> data Fol.d_pred -> 'a
use to collect things about data: call do_data on each data node of e and recursively inside the data. If all, apply also do_data on sub-data, else only apply do_data on d in Tdata d, ie. top data.
val huge_pred : int -> 'a Fol.d_pred -> bool
val huge_term : int -> 'a Fol.d_term -> bool