Module type Memory_sig.MEMORY
Memory map adresses to values. These types may differ (for instance, an array functor can takes integer as adresses, but can contain any value).
include AADT_WITH_BOOLEAN
include WITH_BOOLEAN_REDEFINITION with module Context = Scalar.Context
include Sig.With_Boolean_Forward
include Sig.With_Boolean
with type boolean := boolean
with module Context = Scalar.Context
module Context = Scalar.Contextmodule Boolean : Datatype_sig.S with type t = booleanval serialize_boolean :
Context.t ->
boolean ->
Context.t ->
boolean ->
'a Context.in_acc ->
(boolean, 'a) Context.resultEmpty denotes that the concretization has no value (or it is the concrete value representing the absence of value). Note that this does not necessarily imply that some error occured; for instance the offset of an uninitialized pointer can be represented with empty. Emptyness testing is a simple way of communicating between domains.
module Boolean_Forward :
Operator.BOOLEAN_FORWARD
with module Arity := Sig.Context_Arity_Forward(Context)
and type boolean := booleanval query_boolean : Context.t -> boolean -> Lattices.Quadrivalent.ttype address = Address.binaryval pretty : Scalar.Context.t -> Stdlib.Format.formatter -> memory -> unitval load :
size:Units.In_bits.t ->
Scalar.Context.t ->
memory ->
address ->
Block.Value.binaryval store :
size:Units.In_bits.t ->
Scalar.Context.t ->
memory ->
address ->
Block.Value.binary ->
memoryval load_block : Scalar.Context.t -> memory -> address -> Block.blockval store_block :
Scalar.Context.t ->
memory ->
address ->
Block.block ->
memoryval serialize :
widens:bool ->
Scalar.Context.t ->
memory ->
Scalar.Context.t ->
memory ->
'a Scalar.Context.in_acc ->
(memory, 'a) Scalar.Context.resultval malloc :
id:Operator.Malloc_id.t ->
malloc_size:Units.In_bytes.t ->
Scalar.Context.t ->
memory ->
address * memoryAllocates a separated block of memory, identified by id. The values initially contained is empty.
val free : Scalar.Context.t -> memory -> address -> memoryFree a memory region.
val unknown : level:int -> Scalar.Context.t -> memoryAn initial, unknown region.
val memory_empty : Scalar.Context.t -> memoryAn empty region, with no bound address.
val addresses_in_memory :
Scalar.Context.t ->
memory ->
Scalar.Context.t ->
memory ->
(Block.Value.binary * Block.Value.binary) listinclude WITH_MEMORY_QUERIES
with module Context := Scalar.Context
and type memory := memory
and type address := address
and type offset := Block.Offset.offset
val should_focus :
size:Units.In_bits.t ->
Scalar.Context.t ->
memory ->
address ->
(address * Block.Offset.offset) optionshould_focus ~size ctx mem addr asks the domain whether it is useful to "focus" (or "unfold", i.e. try to represent precisely the memory region pointed to by addr, as long as aliasing info ensures that it is sound) a loaded value. size should be the size of addr. If the answer is yes, then the returned value should contain three things about the region to focus: its base, the offset of the end and the offset of addr in it (in bits).
val may_alias :
ptr_size:Units.In_bits.t ->
Scalar.Context.t ->
size1:Block.Offset.offset ->
size2:Block.Offset.offset ->
address ->
address ->
boolmay_alias ~ptr_size ~size1 ~size2 ctx addr1 addr2 should return whether the region starting at addr1 of size size1 bytes and the region starting at addr2 of size size2 bytes may have a non-empty intersection. This function is used by focusing abstractions to discard a focused region when writing in a possibly aliased address. ptr_size is the size in bits of both addr1 and addr2.
val is_weak : size:Units.In_bits.t -> Scalar.Context.t -> address -> boolis_weak ~size ctx addr asks the domain whether the address addr points to a weak type which indicates that the address will not alias with any other