module Make:functor (C:Sigs.Chunk) ->functor (H:Qed.Collection.Swith type t = C.t) ->Sigs.Sigmawith type chunk = C.t and module Chunk = H
| Parameters: |
|
type chunk
The type of memory chunks.
module Chunk:Qed.Collection.Swith type t = chunk
typedomain =Chunk.Set.t
Memory footprint.
type t
Environment assigning logic variables to chunk.
Memory chunk variables are assigned lazily. Hence, the vector is empty unless a chunk is accessed. Pay attention to this when you merge or havoc chunks.
New chunks are generated from the context pool of Lang.freshvar.
val pretty : Stdlib.Format.formatter -> t -> unitFor debugging purpose
val create : unit -> tInitially empty environment.
val mem : t -> chunk -> boolWhether a chunk has been assigned.
val get : t -> chunk -> Lang.F.varLazily get the variable for a chunk.
val value : t -> chunk -> Lang.F.termSame as Lang.F.e_var of get.
val copy : t -> tDuplicate the environment. Fresh chunks in the copy are not duplicated into the source environment.
val join : t -> t -> Passive.tMake two environment pairwise equal via the passive form.
Missing chunks in one environment are added with the corresponding variable of the other environment. When both environments don't agree on a chunk, their variables are added to the passive form.
val assigned : pre:t ->
post:t -> domain -> Lang.F.pred Bag.tMake chunks equal outside of some domain.
This is similar to join, but outside the given footprint of an
assigns clause. Although, the function returns the equality
predicates instead of a passive form.
Like in join, missing chunks are reported from one side to the
other one, and common chunks are added to the equality bag.
val choose : t -> t -> tMake the union of each sigma, choosing the minimal variable in case of conflict. Both initial environments are kept unchanged.
val merge : t -> t -> t * Passive.t * Passive.tMake the union of each sigma, choosing a new variable for each conflict, and returns the corresponding joins. Both initial environments are kept unchanged.
val merge_list : t list -> t * Passive.t listSame than Sigs.Sigma.merge but for a list of sigmas. Much more efficient
than folding merge step by step.
val iter : (chunk -> Lang.F.var -> unit) -> t -> unitIterates over the chunks and associated variables already accessed so far in the environment.
val iter2 : (chunk -> Lang.F.var option -> Lang.F.var option -> unit) ->
t -> t -> unitSame as iter for both environments.
val havoc_chunk : t -> chunk -> tGenerate a new fresh variable for the given chunk.
val havoc : t -> domain -> tAll the chunks in the provided footprint are generated and made fresh.
Existing chunk variables outside the footprint are copied into the new
environment. The original environement itself is kept unchanged. More
efficient than iterating havoc_chunk over the footprint.
val havoc_any : call:bool -> t -> tAll the chunks are made fresh. As an optimisation,
when ~call:true is set, only non-local chunks are made fresh.
Local chunks are those for which Chunk.is_frame returns true.
val remove_chunks : t -> domain -> tReturn a copy of the environment where chunks in the footprint have been removed. Keep the original environment unchanged.
val domain : t -> domainFootprint of a memory environment. That is, the set of accessed chunks so far in the environment.
val union : domain -> domain -> domainSame as Chunk.Set.union
val empty : domainSame as Chunk.Set.empty
val writes : t Sigs.sequence -> domainwrites s indicates which chunks are new in s.post compared
to s.pre.