forked from thehandsomepanther/system-f
-
Notifications
You must be signed in to change notification settings - Fork 0
/
syntax.mli
36 lines (32 loc) · 913 Bytes
/
syntax.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
open Core
(* Variables *)
type var = Var.t
(* Types *)
type typ = IntT
| ArrT of typ list * typ
| TupT of typ list
| VarT of int
| AllT of int * typ
| HoleT of typ option ref
(* Expressions *)
type exp =
| VarE of var
| LetE of (var * exp * typ) list * exp
| IntE of int
| SubE of exp * exp
| If0E of exp * exp * exp
| TupE of exp list
| PrjE of exp * int
| LamE of (var * typ) list * exp
| AppE of exp * exp list
| FixE of var * typ * exp
| LAME of int * exp
| APPE of exp * typ list
| HoleE of exp ref
val string_of_type : typ -> string
val view_type : typ -> typ
val type_has_hole : typ -> bool
val ref_occurs_in : typ option ref -> typ -> bool
val normalize_complete_type : typ -> typ
val fv : exp -> Var.Set.t
val normalize_expr : exp -> exp