package goblint

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

Address lattice.

Actually a disjoint union of lattices without top or bottom. Addresses are grouped as follows:

  • Each Addr, modulo precise index expressions in the offset, is a sublattice with ordering induced by Mval.
  • NullPtr is a singleton sublattice.
  • UnknownPtr is a singleton sublattice.
  • If ana.base.strings.domain is disjoint, then each StrPtr is a singleton sublattice. Otherwise, all StrPtr are together in one sublattice with flat ordering.

Parameters

Signature

include sig ... end
type t = AddressBase(Mval).t =
  1. | Addr of Mval.t
    (*

    Pointer to mvalue.

    *)
  2. | NullPtr
    (*

    NULL pointer.

    *)
  3. | UnknownPtr
    (*

    Unknown pointer. Could point to globals, heap and escaped variables.

    *)
  4. | StrPtr of StringDomain.t
    (*

    String literal pointer. StrPtr None abstracts any string pointer

    *)
val of_string : string -> t

Convert string to StrPtr.

val to_string : t -> string option

Convert StrPtr to string if possible.

val to_c_string : t -> string option

Convert StrPtr to C string if possible.

val to_n_c_string : int -> t -> string option

Convert StrPtr to C string of given maximum length if possible.

val to_string_length : t -> int option

Find length of C string if possible.

val is_definite : t -> bool

Whether address is a NULL pointer or an mvalue that has only definite integer indexing (and fields).

val add_offset : t -> Mval.idx Offset.t -> t

add_offset a o appends o to an mvalue address a.

val of_var : GoblintCil.varinfo -> t

Convert from variable (without offset).

val of_mval : Mval.t -> t

Convert from mvalue.

val to_var : t -> GoblintCil.varinfo option

Convert to variable if possible.

val to_var_may : t -> GoblintCil.varinfo option

Convert to variable with any offset if possible.

val to_var_must : t -> GoblintCil.varinfo option

Convert to variable without offset if possible.

val to_mval : t -> Mval.t option

Convert to mvalue if possible.

val to_exp : t -> GoblintCil.exp

Convert to CIL expression.

val type_of : t -> GoblintCil.typ

Type of address.

include Lattice.S with type t := t
include Lattice.PO with type t := t
include Printable.S with type t := t
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 leq : t -> t -> bool
val join : t -> t -> t
val meet : t -> t -> t
val widen : t -> t -> t

widen x y assumes leq x y. Solvers guarantee this by calling widen old (join old new).

val narrow : t -> t -> t
val pretty_diff : unit -> (t * t) -> Lattice.Pretty.doc

If leq x y = false, then pretty_diff () (x, y) should explain why.

val bot : unit -> t
val is_bot : t -> bool
val top : unit -> t
val is_top : t -> bool
val top_indices : t -> t

Change all indices to top indices.

val semantic_equal : t -> t -> bool option

Check semantic equality of two addresses.

  • returns

    Some true if definitely equal, Some false if definitely not equal, None if unknown.

OCaml

Innovation. Community. Security.