Module Single_value_abstraction.Known_bits

Abstracts a number by bitwise information: each bit is marked by a bitvalue which is either One, Zero or Unknown

include Sig.SingleValueAbstraction
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
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.

type bitvalue =
  1. | One
  2. | Zero
  3. | Unknown
val testbit : t -> int -> bitvalue

testbit t i returns the value for the i-th bit of t