An implementation of the MPass programming language
based on a session type interpretation of pure linear
logic with recursion.

Examples: see lecture6.mps

Creating a standalone executable with mlton

% make mpass
% ./mpass lecture6.mps   (single file)
% make test         (regression testing)

Running interactively in SML/NJ

% sml
- CM.make "sources.cm";
- Top.mpass "lecture6.mps";    (* testing single file *)

Version notes

0.1 - first release
0.2 - bug fix, improved error messages
0.3 - subtyping with --subtyping (-s) flag; bug fix
0.4 - bug fixes
0.5 - observation depth with --depth <d> parameter
0.7 - bug fix

--------------------------------------------------
Grammar
--------------------------------------------------

COMMENTS

'%' <comment> '\n'  for single-line comment
'(*' <comment> '*)' for multi-line, properly nested comment

IDENTIFIERS

<special> ::= [!"#$%&'()*+,-./:;<=>?@[]^_`{|}~] (all except '_\ and whitespace)
<idchar> ::= [a-zA-Z_0-9']*
<id> ::= [a-zA-Z_]<idchar>*
<tag> ::= '<special> | '<idchar>+
<whitespace> ::= [ \n\t\r\v\f]+

Shadowing of variables is disallowed.

OPERATOR PRECEDENCE

<tp> operator precedence

  prec 5: *   (infix, right assoc)
  prec 4: -o  (infix, right assoc)

<proc> operator precedence

  ';' is right assoc
  so x : +{'e : 1} <- (send x 'e ; send x ()) ; recv x (...) requires parentheses

GRAMMAR

<tp> ::= <id>
       | '1'
       | '+' '{' <alts> '}'
       | '&' '{' <alts> '}'
       | <tp> '*' <tp>
       | <tp> '-o' <tp>
       | '(' <tp> ')'

<alts> ::= <tag> ':' <tp> [ ',' <alts> ]

<parm> ::= '(' <id> ':' <tp> ')'

<proc> ::= 'send' <id> <msg> [';' <proc>]
         | 'recv' <id> '(' <match> ')'
         | 'fwd' <id> <id>
         | 'call' <id> <id> <id>*
         | <id> [ ':' <tp> ] '<-' <proc> ';' <proc>
         | '(' <proc> ')'

<match> ::= <msg> '=>' <proc> [ '|' <match> ]

<msg> ::= '(' ')'
        | <tag>
        | <id>

<defn> ::= 'type' <id> = <tp>
         | 'proc' <id> <parm> <parms>* = <proc>
         | 'exec' <id>   % requires empty antecedent
         | 'fail' <defn>

<prog> ::= <defn>*
