Commit b361cac9 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Simplify to avoid redundancy with the documentation.

parent e6ed1108
# Fix: memoization and fixed points made easy
`fix` is an OCaml library that helps with various constructions
that involve memoization and recursion.
`fix` is an OCaml library that helps with various algorithmic
constructions that involve memoization, recursion, and numbering.
## Installation
## Documentation
Type `opam install fix`.
## Overview
At the top of an OCaml module, declare `open Fix`.
This gives you access to the following submodules:
* [`CompactQueue`](src/CompactQueue.mli) offers **a minimalist mutable
FIFO queue** that is tuned for performance.
* [`DataFlow`](src/DataFlow.mli) performs a **forward data flow analysis**
over a directed graph. Like [`Fix`](src/Core.mli), it computes the
least function of type `variable -> property` that satisfies a fixed
point equation. It is less widely applicable than `Fix`, but, when
it is applicable, it is easier to use and more efficient than `Fix`.
`DataFlow.ForCustomMaps` is particularly **tuned for performance**.
* [`Gensym`](src/Gensym.mli) offers a simple facility
for **generating fresh integer identifiers**.
* [`Indexing`](src/Indexing.mli) offers **a safe API for manipulating indices
into fixed-size arrays**.
* [`Memoize`](src/Memoize.mli) offers a number of combinators
that help **construct possibly recursive memoizing functions**, that
is, functions that lazily record their input/output graph,
so as to avoid repeated computation.
* [`Tabulate`](src/Tabulate.mli) offers facilities
for **tabulating a function**, that is, eagerly evaluating this function
at every point in its domain, so as to obtain an equivalent
function that can be queried in constant time.
* [`Numbering`](src/Numbering.mli) offers a facility for
**assigning a unique number** to each value in a certain finite set
and translating (both ways) between values and their numbers.
* [`GraphNumbering`](src/GraphNumbering.mli) offers a facility for
**discovering and numbering the reachable vertices** in a finite directed graph.
* [`HashCons`](src/HashCons.mli) offers support for
**setting up a hash-consed data type**, that is, a data type whose
values carry unique integer identifiers.
* [`Fix`](src/Core.mli) offers support for **computing
the least solution of a set of monotone equations**,
as described in the unpublished paper
[Lazy Least Fixed Points in ML](
In other words, it allows defining a recursive function of
type `variable -> property`, where
**cyclic dependencies** between variables are allowed,
and properties must be equipped with a partial order.
The function thus obtained performs the fixed point
computation on demand, in an incremental manner,
and is memoizing.
This is typically used to perform a **backward data flow analysis**
over a directed graph.
* `Prop` defines a few common partial orders, including
* [`Glue`](src/Glue.mli) contains glue code that helps
build various implementations of association maps.
The signatures that appear in the above files,
such as `MEMOIZER`, `TABULATOR`, `SOLVER`, and so on,
are defined [here](src/
The [documentation of the latest released
is also available online.
See the [documentation of the latest released
## Demos
......@@ -85,7 +14,7 @@ A few demos are provided:
* [`brz`](demos/brz) sets up a hash-consed representation of regular
expressions and shows how to convert a regular expression to a deterministic
finite-state automaton by Brzozowski's method. This demo exploits almost all
finite-state automaton by Brzozowski's method. This demo exploits many
of the submodules listed above, and is accompanied with
[a commentary](misc/
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment