package fix
Build not checkedInstall
dune-project
Dependency
Authors
Maintainers
Sources
md5=ae129ed3822149a7f8c98f975512e534
sha512=1db240ff0a87200979bf4308e2110a37631f280e36c5f53dde767579ca63992a760eaeb6e1fc9a41c3f3a63d3dc29a3361114ad304cb09e83945ab4213ff5f6d
Description
Added to opam-repository:
README
Fix: memoization and fixed points made easy
fix is an OCaml library that helps with various constructions that involve memoization and recursion.
Installation
Type opam install fix.
Overview
At the top of an OCaml module, declare open Fix. This gives you access to the following submodules:
Gensymoffers a simple facility for generating fresh integer identifiers.Memoizeoffers 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.Tabulateoffers 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.Numberoffers a facility for discovering and numbering the reachable vertices in a directed graph.HashConsoffers support for setting up a hash-consed data type, that is, a data type whose values carry unique integer identifiers.Fixoffers 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 typevariable -> 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.Propdefines a few common partial orders, includingProp.Boolean,Prop.Option,Prop.Set.Gluecontains 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.
Demos
A few demos are provided:
brzsets 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 of the submodules listed above, and is accompanied with a commentary.cykpresents a CYK-style parsing algorithm as an instance ofFix.cfgusesFixto perform certain static analyses of a context-free grammar; this includes computing nullability information and FIRST sets.fibdefines Fibonacci's function in several different ways using the fixed-point combinators offered byMemoizeandFix.hcosets up simple-minded hash-consed trees usingHashCons.
Dev Dependencies
None
Optional Dependencies
None
Used by (10)
- ciao_lwt
- karamel
-
kremlin
< "transition" - lwt_ppx_to_let_syntax
-
ocamlformat
< "0.25.1" - ocamlformat-lib
- ocamlformat-mlx-lib
-
ocamlformat-rpc
< "0.21.0" - ocamlmig
- reason
Conflicts
None
Build status
Results of building fix with each compiler on check.ci.ocaml.org, run of against opam-repository 7cdc698. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
This version is not in the latest run; the versions below are.
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure