mlspec

Last updated: 2018-06-02 15:24:59 +0100

Upstream URL: git clone http://chriswarbo.net/git/mlspec.git

Repo

View repository

View issue tracker

Contents of README follows


MLSpec: Machine Learning for QuickSpec

This project constructs “theories” for the QuickSpec system to explore.

It reads from stdin or a filename argument, and parses a JSON array of arrays of function descriptions.

A function description looks like:

{
    "package" : "foo"
  , "module"  : "Bar.Baz"
  , "name"    : "quux"
  , "type"    : "Bar.T a -> Baz.U b"
  , "arity"   : 1
}

Each array will be turned into a QuickSpec signature and explored.

Equations found by all of these explorations are printed to stdout as JSON objects, one per line.

Formatting

Equations

Each equation is an object with the following fields:

Terms

A term is an object, with a role field containing one of "constant", "variable" or "application". The other fields depend on the term’s role:

Implementation Notes

We use the nix-eval package to run QuickSpec with all of the required packages available. If some packages aren’t in the default GHC package database, nix-eval will call the nix-shell command, so you’ll need a working installation of Nix in your path.

We include a Cabal test suite to check internal function behaviour. We also include an executable mlspec-test-quickspec for integration tests which use QuickSpec. We also have a test.sh script which invokes these as well as running various examples through the MLSpec executable.