/
logic.tex
45 lines (45 loc) · 1.21 KB
/
logic.tex
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
\begin{syntax}
C-external-declaration [Extension to the C \ifCPPnc{and C++} standard grammar for external declarations as global \ifCPPnc{or class} declarations] ::= "/*@" logic-def+"*/"
\
logic-def ::= logic-const-def ;
| logic-function-def ;
| logic-predicate-def ;
| lemma-def ;
| data-inv-def;
\
type-var ::= id
\
type-expr ::= type-var ; type variable
| id;
"<" type-expr;
(, type-expr)* ">" ; polymorphic type
\
type-var-binders ::= "<" type-var;
(, type-var)* ">"
\
poly-id ::= id type-var-binders ; polymorphic object
; identifier
\
logic-const-def ::= "logic" \ifCPPnc#( "static" | "virtual" )?#;
type-expr;
poly-id "=" term ";"
\
logic-function-def ::= "logic" \ifCPPnc#( "static" | "virtual" )?#;
type-expr;
poly-id parameters;
"=" term ";"
\
logic-predicate-def ::=
"predicate" \ifCPPnc#( "static" | "virtual" )?#;
poly-id parameters?;
"=" pred ";"
\
parameters ::= "(" parameter;
(, parameter)* ")"
\
parameter ::= type-expr id
\
lemma-def ::= clause-kind?;
"lemma" poly-id ":";
pred ";"
\end{syntax}