-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsyntax.elf
More file actions
46 lines (36 loc) · 759 Bytes
/
Copy pathsyntax.elf
File metadata and controls
46 lines (36 loc) · 759 Bytes
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
41
42
43
44
45
%{ syntax.elf }%
%% expressions (terms)
exp : type. %name exp E.
%% types
typ : type. %name typ T.
%% nats
nat : type. %name nat N.
z : nat.
s : nat -> nat.
%worlds () (nat).
%% characters
char : type.
a : char.
b : char.
c : char.
%worlds () (char).
%% strings
str : type. %name str S.
eps : str. %% epsilon
%% char prepend operation
, : char -> str -> str. %infix right 10 ,.
%worlds () (str).
%% Auxilary judgments for wrapping objects (values) as expressions
enat : nat -> exp.
estr : str -> exp.
%% Define expressions
add : exp -> exp -> exp.
cat : exp -> exp -> exp.
let : exp -> (exp -> exp) -> exp.
len : exp -> exp.
%block exp-block : block {x:exp}.
%worlds (exp-block) (exp).
%% Define types
num : typ.
string : typ.
%worlds () (typ).