Functions for Propositions (i.e., Symbolic Heaps)
Proposition.
type 'a t = private {sigma : sigma; | (** spatial part *) |
sub : InferIR.Sil.exp_subst; | (** substitution *) |
pi : pi; | (** pure part *) |
sigma_fp : sigma; | (** abduced spatial part *) |
pi_fp : pi; | (** abduced pure part *) |
}the kind 'a should range over normal and exposed
type to describe different strategies for initializing fields of a structure. No_init does not
initialize any fields of the struct. Fld_init initializes the fields of the struct with fresh
variables (C) or default values (Java).
val pp_sub : InferStdlib.Pp.env ‑> Format.formatter ‑> InferIR.Sil.subst ‑> unitPretty print a substitution.
Split sigma into stack and nonstack parts. The boolean indicates whether the stack should only include local variales.
val prop_update_obj_sub : InferStdlib.Pp.env ‑> 'a t ‑> InferStdlib.Pp.envUpdate the object substitution given the stack variables in the prop
val pp_prop_with_typ : InferStdlib.Pp.env ‑> Format.formatter ‑> normal t ‑> unitPretty print a proposition with type information
val pp_proplist_with_typ : InferStdlib.Pp.env ‑> Format.formatter ‑> normal t list ‑> unitPretty print a list propositions with type information
val d_proplist_with_typ : 'a t list ‑> unitval pi_free_vars : pi ‑> InferIR.Ident.t InferStdlib.IStd.Sequence.tval sigma_free_vars : sigma ‑> InferIR.Ident.t InferStdlib.IStd.Sequence.tval free_vars : normal t ‑> InferIR.Ident.t InferStdlib.IStd.Sequence.tval gen_free_vars : normal t ‑> (unit, InferIR.Ident.t) InferStdlib.IStd.Sequence.Generator.tval footprint_free_vars : normal t ‑> InferIR.Ident.t InferStdlib.IStd.Sequence.tval sorted_gen_free_vars : sorted t ‑> (unit, InferIR.Ident.t) InferStdlib.IStd.Sequence.Generator.tval non_pure_free_vars : normal t ‑> InferIR.Ident.t InferStdlib.IStd.Sequence.tval dfs_sort : InferIR.Tenv.t ‑> normal t ‑> sorted tval pi_sub : InferIR.Sil.subst ‑> InferIR.Sil.atom list ‑> InferIR.Sil.atom listApply substitution for pi
val sigma_sub : InferIR.Sil.subst ‑> InferIR.Sil.hpred list ‑> InferIR.Sil.hpred listApply subsitution for sigma
val prop_sub : InferIR.Sil.subst ‑> 'a t ‑> exposed tApply subsitution to prop. Result is not normalized.
val prop_expmap : (InferIR.Exp.t ‑> InferIR.Exp.t) ‑> 'a t ‑> exposed tApply the substitution to all the expressions in the prop.
val sigma_replace_exp : InferIR.Tenv.t ‑> (InferIR.Exp.t * InferIR.Exp.t) list ‑> InferIR.Sil.hpred list ‑> InferIR.Sil.hpred listRelaces all expressions in the hpred list using the first argument.
Assume that the first parameter defines a partial function.
No expressions inside hpara are replaced.
val mk_inequality : InferIR.Tenv.t ‑> InferIR.Exp.t ‑> InferIR.Sil.atomTurn an inequality expression into an atom
val atom_exp_le_const : InferIR.Sil.atom ‑> (InferIR.Exp.t * InferIR.IntLit.t) optionIf the atom is e<=n return e,n
val atom_const_lt_exp : InferIR.Sil.atom ‑> (InferIR.IntLit.t * InferIR.Exp.t) optionIf the atom is n<e return n,e
val exp_normalize_prop : ?destructive:bool ‑> InferIR.Tenv.t ‑> 'a t ‑> InferIR.Exp.t ‑> InferIR.Exp.tNormalize exp using the pure part of prop. Later, we should change this such that the
normalization exposes offsets of exp as much as possible.
If destructive is true then normalize more aggressively, which may lose some useful structure
or types.
val exp_normalize_noabs : InferIR.Tenv.t ‑> InferIR.Sil.subst ‑> InferIR.Exp.t ‑> InferIR.Exp.tNormalize the expression without abstracting complex subexpressions
val exp_collapse_consecutive_indices_prop : InferIR.Typ.t ‑> InferIR.Exp.t ‑> InferIR.Exp.tCollapse consecutive indices that should be added. For instance,
this function reduces x11 to x2. The typ argument is used
to ensure the soundness of this collapsing.
val lexp_normalize_prop : InferIR.Tenv.t ‑> 'a t ‑> InferIR.Exp.t ‑> InferIR.Exp.tNormalize exp used for the address of a heap cell.
This normalization does not combine two offsets inside exp.
val atom_normalize_prop : InferIR.Tenv.t ‑> 'a t ‑> InferIR.Sil.atom ‑> InferIR.Sil.atomval sigma_normalize_prop : InferIR.Tenv.t ‑> 'a t ‑> InferIR.Sil.hpred list ‑> InferIR.Sil.hpred listval prop_compact : InferIR.Sil.sharing_env ‑> normal t ‑> normal tReturn a compact representation of the prop
val mk_neq : InferIR.Tenv.t ‑> InferIR.Exp.t ‑> InferIR.Exp.t ‑> InferIR.Sil.atomConstruct a disequality.
val mk_eq : InferIR.Tenv.t ‑> InferIR.Exp.t ‑> InferIR.Exp.t ‑> InferIR.Sil.atomConstruct an equality.
val mk_pred : InferIR.Tenv.t ‑> InferIR.PredSymb.t ‑> InferIR.Exp.t list ‑> InferIR.Sil.atomConstruct a positive pred.
val mk_npred : InferIR.Tenv.t ‑> InferIR.PredSymb.t ‑> InferIR.Exp.t list ‑> InferIR.Sil.atomConstruct a negative pred.
val create_strexp_of_type : InferIR.Tenv.t ‑> struct_init_mode ‑> InferIR.Typ.t ‑> InferIR.Exp.t option ‑> InferIR.Sil.inst ‑> InferIR.Sil.strexpcreate a strexp of the given type, populating the structures if expand_structs is true
val mk_ptsto : InferIR.Tenv.t ‑> InferIR.Exp.t ‑> InferIR.Sil.strexp ‑> InferIR.Exp.t ‑> InferIR.Sil.hpredConstruct a pointsto.
val mk_ptsto_exp : InferIR.Tenv.t ‑> struct_init_mode ‑> (InferIR.Exp.t * InferIR.Exp.t * InferIR.Exp.t option) ‑> InferIR.Sil.inst ‑> InferIR.Sil.hpredConstruct a points-to predicate for an expression using either the provided expression name as
base for fresh identifiers.
val mk_ptsto_lvar : InferIR.Tenv.t ‑> struct_init_mode ‑> InferIR.Sil.inst ‑> (InferIR.Pvar.t * InferIR.Exp.t * InferIR.Exp.t option) ‑> InferIR.Sil.hpredConstruct a points-to predicate for a single program variable.
If expand_structs is true, initialize the fields of structs with fresh variables.
val mk_lseg : InferIR.Tenv.t ‑> InferIR.Sil.lseg_kind ‑> InferIR.Sil.hpara ‑> InferIR.Exp.t ‑> InferIR.Exp.t ‑> InferIR.Exp.t list ‑> InferIR.Sil.hpredConstruct a lseg predicate
val mk_dllseg : InferIR.Tenv.t ‑> InferIR.Sil.lseg_kind ‑> InferIR.Sil.hpara_dll ‑> InferIR.Exp.t ‑> InferIR.Exp.t ‑> InferIR.Exp.t ‑> InferIR.Exp.t ‑> InferIR.Exp.t list ‑> InferIR.Sil.hpredConstruct a dllseg predicate
val prop_reset_inst : (InferIR.Sil.inst ‑> InferIR.Sil.inst) ‑> 'a t ‑> exposed tReset every inst in the prop using the given map
val prop_hpred_star : 'a t ‑> InferIR.Sil.hpred ‑> exposed tConjoin a heap predicate by separating conjunction.
val prop_sigma_star : 'a t ‑> InferIR.Sil.hpred list ‑> exposed tConjoin a list of heap predicates by separating conjunction
val prop_atom_and : InferIR.Tenv.t ‑> ?footprint:bool ‑> normal t ‑> InferIR.Sil.atom ‑> normal tConjoin a pure atomic predicate by normal conjunction.
val conjoin_eq : InferIR.Tenv.t ‑> ?footprint:bool ‑> InferIR.Exp.t ‑> InferIR.Exp.t ‑> normal t ‑> normal tConjoin exp1=exp2 with a symbolic heap prop.
val conjoin_neq : InferIR.Tenv.t ‑> ?footprint:bool ‑> InferIR.Exp.t ‑> InferIR.Exp.t ‑> normal t ‑> normal tConjoin exp1!=exp2 with a symbolic heap prop.
val prop_rename_primed_footprint_vars : InferIR.Tenv.t ‑> normal t ‑> normal tCanonicalize the names of primed variables.
val exist_quantify : InferIR.Tenv.t ‑> ?ids_queue:unit InferIR.Ident.HashQueue.t ‑> InferIR.Ident.t list ‑> normal t ‑> normal tExistentially quantify the ids in prop.
val prop_normal_vars_to_primed_vars : InferIR.Tenv.t ‑> normal t ‑> normal tconvert the footprint vars to primed vars.
val prop_primed_vars_to_normal_vars : InferIR.Tenv.t ‑> normal t ‑> normal tconvert the primed vars to normal vars.
val set : ?sub:InferIR.Sil.exp_subst ‑> ?pi:pi ‑> ?sigma:sigma ‑> ?pi_fp:pi ‑> ?sigma_fp:sigma ‑> 'a t ‑> exposed tSet individual fields of the prop.
val prop_iter_to_prop : InferIR.Tenv.t ‑> 'a prop_iter ‑> normal tReturn the prop associated to the iterator.
val prop_iter_add_atom : bool ‑> 'a prop_iter ‑> InferIR.Sil.atom ‑> 'a prop_iterAdd an atom to the pi part of prop iter. The first parameter records whether it is done during footprint or during re - execution.
val prop_iter_remove_curr_then_to_prop : InferIR.Tenv.t ‑> 'a prop_iter ‑> normal tRemove the current element from the iterator, and return the prop associated to the resulting iterator.
val prop_iter_current : InferIR.Tenv.t ‑> 'a prop_iter ‑> InferIR.Sil.hpred * 'aReturn the current hpred and state.
val prop_iter_update_current : 'a prop_iter ‑> InferIR.Sil.hpred ‑> 'a prop_iterUpdate the current element of the iterator.
val prop_iter_prev_then_insert : 'a prop_iter ‑> InferIR.Sil.hpred ‑> 'a prop_iterInsert before the current element of the iterator.
val prop_iter_footprint_free_vars : 'a prop_iter ‑> InferIR.Ident.t InferStdlib.IStd.Sequence.tFind fav of the footprint part of the iterator
val prop_iter_free_vars : 'a prop_iter ‑> InferIR.Ident.t InferStdlib.IStd.Sequence.tFind fav of the iterator
val prop_iter_get_footprint_sigma : 'a prop_iter ‑> InferIR.Sil.hpred listExtract the sigma part of the footprint
val prop_iter_replace_footprint_sigma : 'a prop_iter ‑> InferIR.Sil.hpred list ‑> 'a prop_iterReplace the sigma part of the footprint
val prop_iter_find : unit prop_iter ‑> (InferIR.Sil.hpred ‑> 'a option) ‑> 'a prop_iter optionScan sigma to find an hpred satisfying the filter function.
val prop_iter_update_current_by_list : 'a prop_iter ‑> InferIR.Sil.hpred list ‑> unit prop_iterUpdate the current element of the iterator by a nonempty list of elements.
val prop_iter_make_id_primed : InferIR.Tenv.t ‑> InferIR.Ident.t ‑> 'a prop_iter ‑> 'a prop_iterRename ident in iter by a fresh primed identifier
module Metrics : sig ... endmodule CategorizePreconditions : sig ... end