-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgrammar.html
37 lines (27 loc) · 1.21 KB
/
grammar.html
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
<pre>
P ::= data type names
N ::= codata type names
f ::= function names
x ::= variable names
c ::= constructor names
d ::= destructor names
T ::= P | N
<span style="text-decoration: overline">T</span> ::= (T<sub>1</sub>, …, T<sub>n</sub>) | ()
e ::= x
| f <span style="text-decoration: overline">e</span>
| c <span style="text-decoration: overline">e</span>
| e.d <span style="text-decoration: overline">e</span>
<span style="text-decoration: overline">e</span> ::= (e<sub>1</sub>, …, e<sub>n</sub>) | ()
p ::= x
| c <span style="text-decoration: overline">p</span>
<span style="text-decoration: overline">p</span> ::= (p<sub>1</sub>, …, p<sub>n</sub>) | ()
q ::= f <span style="text-decoration: overline">p</span>
| q.d <span style="text-decoration: overline">p</span>
D ::= data P where {c <span style="text-decoration: overline">T</span>:P}
| codata N where {N.d <span style="text-decoration: overline">T</span>:T}
| function f <span style="text-decoration: overline">T</span>:T where {q = e}
Program ::= {D}
{one or more, separated by whitespace}
E ::= f <span style="text-decoration: overline">e</span>
| E.d <span style="text-decoration: overline">e</span>
</pre>