Module Framac_ival.Bottom

Types, monads and utilitary functions for lattices in which the bottom is managed separately from other values.

module Type : sig ... end
include module type of Type
type 'a or_bottom = [
  1. | `Value of 'a
  2. | `Bottom
]
val (>>-) : 'a or_bottom -> ('a -> 'b or_bottom) -> 'b or_bottom

This monad propagates the `Bottom value if needed.

val (>>-:) : 'a or_bottom -> ('a -> 'b) -> 'b or_bottom

Use this monad if the following function returns a simple value.

val is_bottom : 'a or_bottom -> bool
val non_bottom : 'a or_bottom -> 'a
val equal : ('a -> 'a -> bool) -> 'a or_bottom -> 'a or_bottom -> bool
val is_included : ('a -> 'a -> bool) -> 'a or_bottom -> 'a or_bottom -> bool
val join : ('a -> 'a -> 'a) -> 'a or_bottom -> 'a or_bottom -> 'a or_bottom
val join_list : ('a -> 'a -> 'a) -> 'a or_bottom list -> 'a or_bottom
val narrow : ('a -> 'a -> 'a or_bottom) -> 'a or_bottom -> 'a or_bottom -> 'a or_bottom
val pretty : (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> 'a or_bottom -> unit

Datatype constructor.

Bounds a semi-lattice.

In a lattice where the elements are lists of non-bottom values, the empty list is the bottom case.

val to_list : 'a or_bottom -> 'a list

Conversion functions.

val bot_of_list : 'a list -> 'a list or_bottom
val list_of_bot : 'a list or_bottom -> 'a list
val all : 'a or_bottom list -> 'a list
val add_to_list : 'a or_bottom -> 'a list -> 'a list

elt >:: list adds elt to the list if it is not bottom.

module Top : sig ... end

Lattices in which both top and bottom are managed separately