Frama-C API - Multidim
type index = Frama_c_kernel.Z.t * (Frama_c_kernel.Z.t * Frama_c_kernel.Z.t) listoffset is an abstraction for array indexes when these arrays are used as a representation of multidimensional arrays or structures. They have the form :
o + d₁×0,b₁ + ... + dₙ×0,bₙ
or, more formally
{ o + Σ dᵢ×xᵢ | ∀i 1≤i≤n ⇒ xᵢ ∊ 0, bᵢ }
This is a generalisation of integers intervals with modulo implemented in Ival : o + d×0, b
The list of dᵢ is sorted in descending order and we may add the constraint
dᵢ×bᵢ < dᵢ₋₁
which is verified for normal multidimensional arrays handling.
include Frama_c_kernel.Datatype.S with type t = index
include Frama_c_kernel.Datatype.S_no_copy with type t = index
include Frama_c_kernel.Datatype.Ty with type t = index
type t = indexval ty : t Frama_c_kernel.Type.tval datatype_descr : t Frama_c_kernel.Descr.tDatatype descriptor.
val packed_descr : Frama_c_kernel.Structural_descr.packPacked version of the descriptor.
val reprs : t listList of representants of the descriptor.
val hash : t -> intHash function: same spec than Hashtbl.hash.
val pretty : Stdlib.Format.formatter -> t -> unitPretty print each value in an user-friendly way.
val mem_project : (Frama_c_kernel.Project_skeleton.t -> bool) -> t -> boolmem_project f x must return true iff there is a value p of type Project.t in x such that f p returns true.
val zero : tval of_int : int -> tval of_integer : Frama_c_kernel.Z.t -> tval of_ival : Frama_c_kernel.Ival.t -> tval is_zero : t -> boolval is_singleton : t -> boolval hull : t -> Frama_c_kernel.Z.t * Frama_c_kernel.Z.tval first_dimension : t -> (Frama_c_kernel.Z.t * t) optionval add_integer : t -> Frama_c_kernel.Z.t -> tval sub_integer : t -> Frama_c_kernel.Z.t -> tval mul_integer : t -> Frama_c_kernel.Z.t -> tval mod_integer : t -> Frama_c_kernel.Z.t -> tval of_exp : (Frama_c_kernel.Cil_types.exp -> t) -> Frama_c_kernel.Cil_types.exp -> tval of_offset : (Frama_c_kernel.Cil_types.exp -> t) -> Frama_c_kernel.Cil_types.typ -> Frama_c_kernel.Cil_types.offset -> t