module Make:
| Parameters: |
|
module M:Sigs.Model
typeloc =M.loc
typevalue =M.loc Sigs.value
typelogic =M.loc Sigs.logic
typeregion =M.loc Sigs.region
typeresult =M.loc Sigs.result
typesigma =M.Sigma.t
Frames are compilation environment for ACSL. A frame typically
manages the current function, formal paramters, the memory environments
at different labels and the \result and \exit_status values.
The frame also holds the gamma environment responsible for accumulating typing constraints, and the pool for generating fresh logic variables.
Notice that a frame is not responsible for holding the environment
at label Here, since this is managed by a specific compilation
environment, see Sigs.LogicSemantics.env below.
type frame
val pp_frame : Format.formatter -> frame -> unit
val get_frame : unit -> frameval in_frame : frame -> ('a -> 'b) -> 'a -> 'bLang.gamma and Lang.pool contexts are also set accordingly.val mem_at_frame : frame -> Clabels.c_label -> sigmaHere.val set_at_frame : frame ->
Clabels.c_label -> sigma -> unitval mem_frame : Clabels.c_label -> sigmamem_at_frame but for the current frame.val mk_frame : ?kf:Cil_types.kernel_function ->
?result:result ->
?status:Lang.F.var ->
?formals:value Cil_datatype.Varinfo.Map.t ->
?labels:sigma Clabels.LabelMap.t ->
?descr:string -> unit -> frameval local : descr:string -> frameval frame : Cil_types.kernel_function -> frametype call
val call : ?result:M.loc ->
Cil_types.kernel_function ->
value list -> callresult is specified, the called function will stored its result
at the provided location in the current frame (the callee).val call_pre : sigma ->
call ->
sigma -> frameval call_post : sigma ->
call ->
sigma Sigs.sequence -> frameval return : unit -> Cil_types.typval result : unit -> resultval status : unit -> Lang.F.varval guards : frame -> Lang.F.pred listtype env
Here.
Remark: don't confuse the current memory state with the
memory state at label Here. The current memory state is the one
we have at hand when compiling a term or a predicate. Hence, inside
\at(e,L) the current memory state when compiling e is the one at L.
val mk_env : ?here:sigma ->
?lvars:Cil_types.logic_var list -> unit -> env
Current and Here memory points are initialized to ~here, if
provided.
The logic variables stand for
formal parameters of ACSL logic function and ACSL predicates.
val current : env -> sigmamove before.val move_at : env ->
sigma -> envHere memory state.
This memory state becomes also the new current one.val mem_at : env -> Clabels.c_label -> sigmaHere and the current frame
otherwize.val env_at : env -> Clabels.c_label -> enve inside
\at(e,L) ACSL construct.val lval : env -> Cil_types.term_lval -> Cil_types.typ * M.locval term : env -> Cil_types.term -> Lang.F.termval pred : Sigs.polarity ->
env -> Cil_types.predicate -> Lang.F.predval region : env ->
unfold:bool -> Cil_types.term -> region~unfold:true, compound memory locations are expanded
field-by-field.val assigned_of_lval : env ->
unfold:bool -> Cil_types.lval -> regionval assigned_of_froms : env ->
unfold:bool -> Cil_types.from list -> regionval assigned_of_assigns : env ->
unfold:bool -> Cil_types.assigns -> region optionNone means everyhting is assigned.val val_of_term : env -> Cil_types.term -> Lang.F.termterm above but reject any set of locations.val loc_of_term : env -> Cil_types.term -> locterm above but expects a single loc or a single
pointer value.val lemma : LogicUsage.logic_lemma -> Definitions.dlemmaval vars : region -> Lang.F.Vars.tval occurs : Lang.F.var -> region -> boolval check_assigns : sigma ->
written:region ->
assignable:region -> Lang.F.pred