pyrobinson is a Python library for running Robinson's unification algorithm on a set of type constraints, generating type substitutions.
You can install pyrobinson using pip.
First, clone the repository:
git clone git@github.com:bluegreengreen/pyrobinson.gitThen, 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)
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 --helpto 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.
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!