module Typed_syntax:sig
..end
typeid =
string
typefield =
string
type
arithOp =
| |
Plus |
| |
Minus |
| |
Times |
type
intCmp =
| |
LT |
| |
GT |
| |
EQ |
type
typ =
| |
TNum |
(* | num | *) |
| |
TBool |
(* | bool | *) |
| |
TFun of |
(* | t1 -> t2 | *) |
| |
TPair of |
(* | (t1, t2) | *) |
| |
TList of |
(* | t list | *) |
type
exp =
| |
Int of |
(* | decimal integer | *) |
| |
Bool of |
(* | either true or false | *) |
| |
Arith of |
(* | e1 + e2 , e1 - e2 , or e1 * e2 | *) |
| |
Cmp of |
(* | e1 < e2 , e1 > e2 , or e1 = e2 | *) |
| |
If of |
(* | if e1 then e2 else e2 | *) |
| |
Id of |
(* | first charater must be a letter or an underscore; remaining characters may include letters, numbers, and underscores | *) |
| |
Let of |
(* | let x = e1 in e2 | *) |
| |
Fun of |
(* | fun (x : t) -> e | *) |
| |
Fix of |
(* | fix (x : t) -> e | *) |
| |
App of |
(* | e1 e2 | *) |
| |
Empty of |
(* | empty<t> | *) |
| |
Cons of |
(* | e1 :: e2 | *) |
| |
Head of |
(* | head e | *) |
| |
Tail of |
(* | tail e | *) |
| |
IsEmpty of |
(* | empty? e | *) |
| |
Pair of |
(* | (e1, e2) | *) |
| |
ProjL of |
(* | e.1 | *) |
| |
ProjR of |
(* | e.2 | *) |