-
Notifications
You must be signed in to change notification settings - Fork 22
/
syntax.bnf
89 lines (69 loc) · 2.55 KB
/
syntax.bnf
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<ident> ::= [a-zA-Z0-9_!?] [a-zA-Z0-9_!?']*
| '{|' <string> '|}'
<mident> ::= [a-zA-Z0-9_]* | '{|' <string> '|}'
<qident> ::= <mident> '.' <ident>
<definibility> ::= 'injective'
| 'private'
| 'private' 'injective'
| 'def'
<ilist(x)> ::= [x+]
<line> ::= <rule>+ '.'
| 'def' <ident> <ilist(<param>)> [<of_ty>] ':=' <term> '.'
| 'thm' <ident> <ilist(<param>)> [<of_ty>] ':=' <term> '.'
| [<definibility>] <ident> <ilist(<param>)> <of_ty> '.'
| 'def'AC <ident> '[' <term> ']' '.'
| 'private' 'def'AC <ident> '[' <term> ']' '.'
| 'def'ACU <ident> '[' <term> ',' <term> ']' '.'
| 'private' 'def'ACU <ident> '[' <term> ',' <term> ']' '.'
| '#EVAL' <term> '.'
| '#EVAL' <eval_config> <term> '.'
| '#INFER' <term> '.'
| '#INFER' <eval_config> <term> '.'
| '#CHECK' <aterm> ':' <term> '.'
| '#CHECKNOT' <aterm> ':' <term> '.'
| '#ASSERT' <aterm> ':' <term> '.'
| '#ASSERTNOT' <aterm> ':' <term> '.'
| '#CHECK' <aterm> '=' <term> '.'
| '#CHECKNOT' <aterm> '=' <term> '.'
| '#ASSERT' <aterm> '=' <term> '.'
| '#ASSERTNOT' <aterm> '=' <term> '.'
| '#PRINT' '"' <string> '"' '.'
| '#GDT' <ident> '.'
| '#GDT' <qident> '.'
| '#NAME' '.'
| '#REQUIRE' '.'
| PRAGMA
| EOF
<eval_config> ::= '[' <ident> (',' <ident>)* ']'
<of_ty> ::= ':' <term>
<param> ::= '(' <pid> ':' <term> ')'
<rule> ::= '[' <context> ']' <top_pattern> '-->' <term>
| '{' <ident> '}' '[' <context> ']' <top_pattern>
'-->' <term>
| '{' <qident> '}' '[' <context> ']' <top_pattern>
'-->' <term>
<decl> ::= <ident> ':' <term>
| <ident>
<context> ::= [<decl> (',' <decl>)*]
<top_pattern> ::= <ident> <pattern_wp>*
| <qident> <pattern_wp>*
| '(' <top_pattern> ')' <pattern_wp>*
<pid> ::= <ident>
<pattern_wp> ::= <ident>
| <qident>
| '{' <term> '}'
| '(' <pattern> ')'
<pattern> ::= <pid> '=>' <pattern>
| <pattern_wp>+
<sterm> ::= <qident>
| <ident>
| '(' <term> ')'
| 'Type'
<aterm> ::= <sterm> <sterm>*
<term> ::= <aterm>
| <pid> ':' <aterm> '->' <term>
| '(' <pid> ':' <aterm> ')' '->' <term>
| <aterm> '->' <term>
| <pid> '=>' <term>
| <pid> ':' <aterm> '=>' <term>
| '(' <pid> ':' <aterm> ':=' <aterm> ')' '=>' <term>