package colibri2

  1. Overview
  2. Docs

Colibri2 core: define basic types and the solver

Egraph

The Egraph contains all the context of a state of the analysis. Moreover it handles:

  • the consolidation of the unique domain for each equivalence class
  • execute callbacks when some events happens

The Egraph is piloted by a scheduler which distinguished four different phases:

  1. Propagation phase
  2. Decision phase
  3. LastEffort phase
  4. FixingModel phase

Each phase starts when there is nothing more to do in the previous phase, but a later phase can add work to a previous phase. A decision adds new possible propagations

module Egraph : sig ... end

Ground terms

The main representations of constraints are the ground terms. Each ground terms is associated to a node in the Egraph. The terms are simplified from the input syntax by substituting let bindings and separate the other bindings:

This separation allows to consider most of the time only Ground.Term.t terms.

module Ground : sig ... end

Different Object

The different kind of terms are reunited as Node.t by being indexed into theory terms ThTerm.t. Predefined theory terms are:

The theory terms can be transformed without cost directly as Node.t. New kind of theory terms are obtained by applying the functor ThTerm.Register

module Node : sig ... end

The nodes form equivalence class inside the Egraph

module ThTerm : sig ... end

ThTerm allows to associates an OCaml type to a uniq Node.t using an indexing table

Another kind of nodes are values. They are disjoint but similar to theory terms. The goal of the solver is to find one Value.t for each expression of the input problem. They are registered using Value.Register.

module Value : sig ... end

One Value.t can be associated to an equivalence class and a Value.t is associated to an uniq Node.t

Domains are additional informations associated to each equivalence class inside the _Egraph.t. They can be registered using Dom.register or when the domain is simple by Dom.Lattice

module Dom : sig ... end
module Expr : sig ... end

The module Expr corresponds to the typed expression parsed and typed by Dolmen. It is generally not useful.

module Builtin = Dolmen_std.Builtin

Fix the models

The module Interp handles:

module Interp : sig ... end

Custom Environment and data-structures

module Env : sig ... end

Theory specific environment

module Datastructure : sig ... end

Events

The modification of the Egraph (events) can be monitored through daemons.

module type Daemon = sig ... end

Attach a callback executed when different modifications of the Egraph happens

module Daemon : Daemon

Attach a callback executed when different modifications of the Egraph happens

Same as Daemon but they are scheduled to run as soon as possible during the FixingModel phase

Attach a callback executed when different modifications of the Egraph happens

Attach a callback executed when different modifications of the Egraph happens

module DaemonWithFilter : sig ... end

Attach a callback executed when different modifications of the Egraph happens

module Monad : sig ... end
module DaemonWithKey : sig ... end
module Events : sig ... end

Low level API

Choices

module Choice : sig ... end

Helpers

module Init : sig ... end
module Debug : sig ... end
module Options : sig ... end

For schedulers

The following functions are necessary only to the scheduler

module ForSchedulers : sig ... end
OCaml

Innovation. Community. Security.