package goblint

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type idx

Type of indices in offset.

include Printable.S with type t = idx Goblint_lib__.Offset_intf.t
type t = [
  1. | `NoOffset
    (*

    No offset. Marks the end of offset list.

    *)
  2. | `Field of CilType.Fieldinfo.t * idx Goblint_lib__.Offset_intf.t
    (*

    Offset starting with a struct field.

    *)
  3. | `Index of idx * idx Goblint_lib__.Offset_intf.t
    (*

    Offset starting with an array index.

    *)
]
val equal : t -> t -> bool
val hash : t -> int
val compare : t -> t -> int
val show : t -> string
val pretty : unit -> t -> Printable.Pretty.doc
val printXml : 'a BatInnerIO.output -> t -> unit
val name : unit -> string
val to_yojson : t -> Yojson.Safe.t
val tag : t -> int

Unique ID, given by HConsed, for context identification in witness

val arbitrary : unit -> t QCheck.arbitrary
val relift : t -> t
val is_definite : t -> bool

Whether offset has only definite integer indexing (and fields).

val contains_index : t -> bool

Whether offset contains any indexing.

val add_offset : t -> t -> t

add_offset o1 o2 appends o2 to o1.

val remove_offset : t -> t

Remove last indexing or field from offset.

val prefix : t -> t -> t option

prefix o1 o2 checks if o1 is a prefix of o2.

  • returns

    Some o if it is (such that add_offset o1 o = o2), None if it is not.

val map_indices : (idx -> idx) -> t -> t

Apply function to all indexing.

val top_indices : t -> t

Change all indices to top indices.

val to_cil : t -> GoblintCil.offset

Convert to CIL offset.

val to_exp : t -> GoblintCil.exp Goblint_lib__.Offset_intf.t

Convert to Goblint offset with GoblintCil.exp indices.

val to_cil_offset : t -> GoblintCil.offset

Version of to_cil which drops indices for ArrayDomain.

val cmp_zero_offset : t -> [ `MustZero | `MustNonzero | `MayZero ]

Compare offset to zero offset.

Zero indices and first fields of a struct are in the same physical memory location as the outer object.

  • returns

    `MustZero if definitely zero, `MustNonzero if definitely not zero, `MayZero if unknown.

val type_of : base:GoblintCil.typ -> t -> GoblintCil.typ

Type of the offset on the base type.

  • raises Type_of_error

    if could not follow offset completely.

OCaml

Innovation. Community. Security.