Hypha - Type Reconstruction for the Linear π-Calculus

Hypha is a prototype implementation of the type reconstruction algorithm described in Type Reconstruction for the Linear π-Calculus with Composite and Equi-Recursive Types. It is implemented in Haskell, comes with the full source code (see the download section below) and a bunch of examples. Beware that the algorithm has not been optimized in any particularly clever way, so it may take a long time to terminate on large processes.

Download

The source code of Hypha can be downloaded at the links below. You need GHC, Alex and Happy to compile the tool. The easiset way to get them all at once is to install the Haskell Platform. A Makefile is provided.

Syntax

Process ::= var!Expression output
| var?(Pattern)Continuation input
| let Pattern = Expression in Process local binding
| case Expression of [ Pattern => Process | Pattern => Process ] pattern matching
| if Expression then Process else Process conditional
| Process | Process parallel composition
| new var in Process new channel
| { ProcessOpt } group
| *Process replication
Continuation ::= idle process
| . Process process
ProcessOpt ::= idle process
| Process process
Pattern ::= _ anonymous
| var variable
| Pattern, Pattern pair
| (Pattern) group
Expression ::= () unit
| n integer
| true boolean true
| false boolean false
| var variable
| unop Expression unary operator
| Expression binop Expression binary operator
| (Expression) group
binop ::= and | or | < | > | = | <= | >= | <> | + | - | * | / | , binary operators
unop ::= not | inl | inr unary operators
var ::= [a-z] [a-z 0-9 _ ']* variable
n ::= [0-9]+ integer

References