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.
- Release history
- Download the source code
- Have a look at the syntax of processes accepted by Hypha
- Check out some references on the linear π-Calculus
History
- 29 Nov 2013: added support for fst and snd operators as suggested by one of the FoSSaCS reviewers; generalized syntax for sends and receives, now the subject can be an arbitrary expression.
- 30 Aug 2013: initial release.
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 | ::= | Expression!Expression Continuation | output |
| | Expression?(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 | fst | snd | unary operators |
var | ::= | [a-z] [a-z 0-9 _ ']* | variable |
n | ::= | [0-9]+ | integer |
References
- Luca Padovani, Type Reconstruction for the Linear π-Calculus with Composite and Equi-Recursive Types, 2013.
- Atsushi Igarashi, Naoki Kobayashi, Type Reconstruction for Linear π-Calculus with I/O Subtyping, Information and Computation, 161(1):1-44, 2000
- Naoki Kobayashi, Benjamin C. Pierce, David N. Turner, Linearity and the pi-calculus, ACM Transactions on Programming Languages and Systems, 21(5):914-947, ACM, 1999