Skip to content

A Python library for running Robinson's unification algorithm on a set of type constraints.

Notifications You must be signed in to change notification settings

bluegreengreen/pyrobinson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

pyrobinson

pyrobinson is a Python library for running Robinson's unification algorithm on a set of type constraints, generating type substitutions.

Installation

You can install pyrobinson using pip.

First, clone the repository:

git clone git@github.com:bluegreengreen/pyrobinson.git

Then, navigate to the project directory and install the package:

cd pyrobinson
pip install .

Now it's time to Rob and roll! (...it's what Alan Robinson would have wanted)

Usage

After installation, you can use pyrobinson via the CLI:

pyrobinson <input_file>

See below for details on the input file format. You can also run

pyrobinson --help

to see all available options.

You can also import pyrobinson as a module in your Python code.

Note that your terminal must support Unicode characters to display the types correctly.

Formatting

pyrobinson expects a file containing type constraints, one per line. Each constraint should be in the format:

T1 = T2

where T1 and T2 are types. Types can be any of the following:

  • Type variables (α1, α2, ...) or (a1, a2, ...)
  • Booleans (B)
  • Function types (T1 -> T2)

Brackets are not currently supported. Soon to come, I promise!

About

A Python library for running Robinson's unification algorithm on a set of type constraints.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages