package codex

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

Module Lattices.QuadrivalentSource

The quadrivalent lattice for booleans, with four elements: Bottom, True, False, and Top.

Sourcetype boolean =
  1. | Bottom
  2. | True
  3. | False
  4. | Top

Standard abstraction for booleans; powerset of {true;false}

include Datatype_sig.S with type t = boolean
Sourcetype t = boolean
Sourceval equal : t -> t -> bool

Any notion of equality is allowed, as long as it is an equivalence relation, and that if a == b, then equal a b.

Sourceval compare : t -> t -> int

compare is a total order, and should be compatible with equal.

Sourceval hash : t -> int

hash requires that equal values have the same hash.

Sourceval pretty : Format.formatter -> t -> unit
Sourceval join : t -> t -> t

Computes the least upper bound of two elements.

Sourceval includes_or_widen : previous:t -> t -> bool * t

In a fixpoint iteration of a function \mathcal{F}, previous is the previous element of the fixpoint iteration sequence. The other element is the newly computed (tentative) element, i.e. \mathcal{F}(previous). If the new element is included in previous, true is returned, together with new (the smaller element): the post-fixpoint of \mathcal{F} has been found (further calls to \mathcal{F} can decrease the sequence). Else, the returned element should be used as the next element of the fixpoint iteration sequence; the operator guarantees its convergence. For lattices of finite height, the widening part can just perform an over-approximation of the join; however note that it is not required that the sequence is monotonic.

Sourceval includes : t -> t -> bool

includes a b holds if b \sqsubseteq a, i.e., b is at least as precise as a.

Sourceval widen : previous:t -> t -> t

Widening operator used in fixpoint iteration to enforce convergence.

Sourceval inter : t -> t -> t
include Sig.WITH_BOTTOM with type t := t
Sourceval bottom : unit -> t
Sourceval is_bottom : t -> bool
Sourceval top : unit -> t
Sourceval singleton : bool -> t
Sourceval to_quadrivalent : t -> Lattices__.Boolean_standard.Quadrivalent.t
Sourceval boolean_bottom : boolean
Sourceval of_bools : may_be_false:bool -> may_be_true:bool -> boolean

The result of of_bools may_be_false may_be_false:

  • May be false (i.e. False of Top) if may_be_false is true, and must not be otherwise (i.e. True or Bottom)
  • May be true (i.e. True of Top) if may_be_true is true, and must not be otherwise (i.e. False or Bottom)
Sourceval to_bools : boolean -> bool * bool

returns (may_be_false, may_be_true), as defined in of_bools.

Sourceval truth_value : boolean -> boolean