-
Notifications
You must be signed in to change notification settings - Fork 2
/
Syntax.v
34 lines (29 loc) · 894 Bytes
/
Syntax.v
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
(** This file defines the syntax of the System T extended with stream types. *)
(* Types *)
Inductive ty :=
| tbool : ty
| tnat : ty
| tarrow : ty -> ty -> ty
| stream : ty -> ty.
Notation " A '→' B " := (tarrow A B) (at level 30, right associativity) : t_scope.
Notation " 'ω' " := tnat : t_scope.
Notation " '2' " := tbool : t_scope.
Open Scope t_scope.
(* Terms *)
(* The formalisation uses de Bruijn indices to deal with binders. *)
Inductive te :=
| var : nat -> te
| lam : ty -> te -> te
| appl : te -> te -> te
| z : te
| s : te -> te
| rec : te -> te -> te -> te
| hd : te -> te
| tl : te -> te
| seed : te -> te -> te -> te
| TT : te
| FF : te.
Notation "'λ' A , M " := (lam A M) (at level 50) : t_scope.
Notation " # n " := (var n) (at level 20) : t_scope.
Notation " M @ N " := (appl M N) (at level 40, left associativity) : t_scope.
Close Scope t_scope.