Module Single_value_abstraction.Interval

Single value abstraction using intervals

type t = private {
  1. low : Z.t option;
  2. high : Z.t option;
}

A representation of intervals, None bound means plus/minus infinity. Invariant: low <= high (if neither are None)

val interval : Z.t option -> Z.t option -> t option

interval low high is a contructors for type t, ensures the invariant is respected

val remove_const : t -> Z.t -> t option

remove_const interval value returns the best abtraction for interval \ value (where \ is setminus). It returns None if that abstraction is bottom.

include Sig.SingleValueAbstraction with type t := t
include Sig.Doc
val id : string

Unique identifier for the domain, eg "N", "FA",...

val name : Stdlib.Format.formatter -> unit -> unit

Full human readable name

val state_name : string

Name of the domain's states

val doc : string

Long description of the domain

Type of abstract numbers, this represents a non-empty set of Z.t

include Std_extra.Types.TYPE with type t := t
include Std_extra.Types.PRINTABLE with type t := t
val compare : t -> t -> int
val order : t -> t -> Std_extra.Types.order
val equal : t -> t -> bool
val hash : t -> int
val contains : t -> Z.t -> bool

contains zs z is true if and only if the concretization of zs contains z. This essentially defines the concretization t -> Z.t set through its indicative function

val top : t

The top element, representing any number

val one : t

The best abstraction for the singleton {1}

val zero : t

The best abstraction for the singleton {0}

val non_zero : t

The best abstraction for Z \ {0}

val join : t -> t -> t

join a b is the union of both sets

val meet : t -> t -> t option

meet a b is the intersection of both sets, None when empty

val widen : t -> t -> t

widen is a union that should converge in finite time

val subseteq : t -> t -> bool

subseteq l r is true if and only if any number abstracted by l is also abstracted by r, e.g. if forall x, contains l x implies contains r x

val is_singleton : t -> Z.t option

is_singleton zs is Some z if zs represents the singleton {z}

val of_ternary : Ternary.t -> t

of_ternary t turns t seen as {0}, {1}, or {0,1} into its best abstraction

val to_ternary : t -> Ternary.t

to_ternary t is used to convert to a boolean value for test. Any non-zero value is Ternary.t.True, and zero is Ternary.t.False. A value containing both zero and non-zero values is Ternary.t.TrueFalse

module Forwards : sig ... end

Forward transfer functions for all expression constructs. Used to calculate the abstraction of an expression based on abstractions of its components

module Backwards : sig ... end

Backward transfer functions for all expression constructs. Used to refine abstractions of a constructs arguments given a precise abstraction of its results.