-
Notifications
You must be signed in to change notification settings - Fork 0
/
closure.mli
40 lines (39 loc) · 1.1 KB
/
closure.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
37
38
39
40
type closure = { entry : Id.l; actual_fv : Id.t list }
type t =
| Unit
| Int of int
| Float of float
| Neg of Id.t
| Add of Id.t * Id.t
| Sub of Id.t * Id.t
| Mul of Id.t * Id.t
| Div of Id.t * Id.t
| FNeg of Id.t
| FAdd of Id.t * Id.t
| FSub of Id.t * Id.t
| FMul of Id.t * Id.t
| FDiv of Id.t * Id.t
| IfEq of Id.t * Id.t * t * t
| IfNEq of Id.t * Id.t * t * t
| IfLE of Id.t * Id.t * t * t
| IfLT of Id.t * Id.t * t * t
| Let of (Id.t * Type.t) * t * t
| Var of Id.t
| MakeCls of (Id.t * Type.t) * closure * t
| AppCls of Id.t * Id.t list
| AppDir of Id.l * Id.t list
| Tuple of Id.t list
| LetTuple of (Id.t * Type.t) list * Id.t * t
| Get of Id.t * Id.t
| Put of Id.t * Id.t * Id.t
| ExtArray of Id.l
| ExprWithPos of t * Syntax.pos
type fundef = { name : Id.l * Type.t;
args : (Id.t * Type.t) list;
formal_fv : (Id.t * Type.t) list;
body : t }
type prog = Prog of fundef list * t
val fv : t -> S.t
val f : KNormal.t -> prog
val closureProg2String : prog -> string
val closureProg2StringWithoutPos : prog -> string