-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsyntax.mli
More file actions
27 lines (24 loc) · 1.34 KB
/
Copy pathsyntax.mli
File metadata and controls
27 lines (24 loc) · 1.34 KB
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
(* syntax.mli *)
type var = string (* Variable, represented by it's identifier *)
type pos = int * int (* Position in source code: line * column *)
type op = string (* Operator, represented by it's identifier *)
type 'ty valexp = (* Expression of Value annotated with type 'ty *)
Unit (* Unit value: "()" *)
| Var of var (* Variable *)
| Bool of bool (* Boolean value *)
| Int of int (* Integer *)
| Op of op * 'ty * pos (* Operator, of type 'ty, at pos *)
| App of 'ty valexp * 'ty valexp (* Application: function * argument *)
| Pair of 'ty valexp * 'ty valexp (* Pair: fst * snd *)
type 'ty procexp = (* Expression of Processes annotated with type 'ty *)
Zero (* Zero process *)
| Rep of 'ty procexp (* Infinite Repetition of a Process *)
| Par of 'ty procexp * 'ty procexp (* Parallel of two processes *)
| Nu of var * 'ty * 'ty procexp * pos (* New Channel and type of the channel *)
| If of 'ty valexp * 'ty procexp * 'ty procexp * pos (* If-Then-Else *)
| In of var * var * 'ty * 'ty procexp * pos (* Input from channel, bind value to variable with type *)
| Out of var * 'ty valexp * 'ty procexp * pos (* Output to channel, with value *)
val alphaconversion: 'a procexp -> 'a procexp
val freevars: 'a procexp -> var list
val map_type: ('a -> 'a) -> 'a procexp -> 'a procexp
val string_of_proc: ('a -> string) -> 'a procexp -> string