package codex

  1. Overview
  2. Docs
The Codex library for building static analysers based on abstract interpretation

Install

dune-project
 Dependency

Authors

Maintainers

Sources

1.0-rc4.tar.gz
md5=bc7266a140c6886add673ede90e335d3
sha512=8da42c0ff2c1098c5f9cb2b5b43b306faf7ac93b8f5ae00c176918cee761f249ff45b29309f31a05bbcf6312304f86a0d5a000eb3f1094d3d3c2b9b4c7f5c386

doc/codex.single_value_abstraction/Single_value_abstraction/Quadrivalent/index.html

Module Single_value_abstraction.QuadrivalentSource

The lattice for four-valued boolean logic. It represents the powerset of {true,false}. See Lattices.Quadrivalent.

The transfer functions are implemented naturally following the Galois connection between this lattice and the {true,false} powerset. For instance, A \land^{\#} B = \alpha(\{\, a \land b \mid a \in \gamma(A),\ b \in \gamma(B) \,\}) The operations on True, False and Top correspond to Kleene's strong three-valued logic.

Those on True, False and Bottom correspond to Kleene's weak three-valued logic (= Bochvar three-valued logic).

However, note that this four-valued logic is different Belnap's four-valued logic. It should be seen as a combination of Kleene's strong and weak ternary logics.

Note: For the lattice implementor, it may be sometimes difficult to know whether the answer to a predicate should be Top or Bottom. Implementation should be guided by the Gallois connection to the collecting semantics. For instance, when implementing abstract equality ==^\#: A ==^{\#} B = \gamma( \{ a \in \alpha(A), b \in \alpha(B): a == b \})

Thus ==^\# returns Bottom if either A or B concretize only into the empty set.

Sourcetype boolean = Lattices.Quadrivalent.boolean =
  1. | Bottom
  2. | True
  3. | False
  4. | Top
Sourceval name : string
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 or 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 refine : older:boolean -> newer:boolean -> boolean option

It attempts to refine the abstract value older with the information provided by newer.