Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
why3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
121
Issues
121
List
Boards
Labels
Service Desk
Milestones
Merge Requests
17
Merge Requests
17
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
6c2c5eff
Commit
6c2c5eff
authored
Dec 15, 2010
by
Jean-Christophe Filliâtre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc: syntax of formulas
parent
7aaff834
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
98 additions
and
18 deletions
+98
-18
Makefile.in
Makefile.in
+3
-2
doc/formula.bnf
doc/formula.bnf
+29
-0
doc/qualid.bnf
doc/qualid.bnf
+13
-0
doc/syntaxref.tex
doc/syntaxref.tex
+25
-2
doc/term.bnf
doc/term.bnf
+26
-13
tests/test-jcf.why
tests/test-jcf.why
+2
-1
No files found.
Makefile.in
View file @
6c2c5eff
...
...
@@ -749,7 +749,8 @@ clean::
DOC
=
doc/manual.pdf
# doc/manual.html
BNF
=
doc/term_bnf.tex
BNF
=
qualid term formula
BNFTEX
=
$(
addprefix
doc/,
$(
addsuffix
_bnf.tex,
$(BNF)
))
doc/%_bnf.tex
:
doc/%.bnf doc/bnf
doc/bnf
$<
>
$@
...
...
@@ -762,7 +763,7 @@ doc: $(DOC)
.PHONY
:
$(DOC)
doc/manual.pdf
:
$(BNF) doc/apidoc.tex doc/manual.tex doc/version.tex
doc/manual.pdf
:
$(BNF
TEX
) doc/apidoc.tex doc/manual.tex doc/version.tex
cd
doc
;
rubber
-d
manual.tex
# doc/manual.html: doc/manual.tex doc/version.tex
...
...
doc/formula.bnf
0 → 100644
View file @
6c2c5eff
\begin{syntax}
formula ::= "true" | "false" ;
| formula "->" formula ; implication
| formula "<->" formula ; equivalence
| formula "and" formula ; conjunction
| formula "/\" formula ; asymmetric conjunction
| formula "or" formula ; disjunction
| formula "\/" formula ; asymmetric disjunction
| "not" formula ; negation
| lqualid ; symbol
| prefix-op term ;
| term infix-op term ;
| lqualid term+ ; predicate application
| "if" formula "then" formula ;
"else" formula ; conditional
| "let" pattern "=" term "in" formula ; local binding
| "match" ("," term)+ "with" ;
"|"? ("|" formula-case)+ "end" ; pattern matching
| quantifier ("," binders )+ ;
triggers "." formula ; quantifier
| label formula ; label
| "(" formula ")" ; parentheses
\
quantifier ::= "forall" | "exists"
\
binders ::= lident+ ":" type
\
formula-case ::= pattern "->" formula ; %
\end{syntax}
doc/qualid.bnf
0 → 100644
View file @
6c2c5eff
\begin{syntax}
lalpha ::= "a"-"z" | "_"
\
ualpha ::= "A"-"Z"
\
lident ::= lalpha (alpha | digit | "'")*
\
uident ::= ualpha (alpha | digit | "'")*
\
lqualid ::= lident | uqualid "." lident ;
\
uqualid ::= uident | uqualid "." uident ;%
\end{syntax}
doc/syntaxref.tex
View file @
6c2c5eff
\chapter
{
Syntax Reference
}
\label
{
chap:syntaxref
}
This chapter gives the grammar for the input files
This chapter gives the grammar for the input files
.
\framebox
{
\input
{
./term
_
bnf.tex
}}
TODO: constants
\paragraph
{
Identifiers.
}
\begin{center}
\framebox
{
\input
{
./qualid
_
bnf.tex
}}
\end{center}
\paragraph
{
Terms.
}
The syntax of terms is given Figure~
\ref
{
fig:bnf:term
}
.
TODO: prefix and infix operators
\begin{figure}
\begin{center}
\framebox
{
\input
{
./term
_
bnf.tex
}}
\end{center}
\caption
{
Syntax of terms.
}
\label
{
fig:bnf:term
}
\end{figure}
\paragraph
{
Formulas.
}
The syntax of terms is given Figure~
\ref
{
fig:bnf:formula
}
.
\begin{figure}
\begin{center}
\framebox
{
\input
{
./formula
_
bnf.tex
}}
\end{center}
\caption
{
Syntax of formulas.
}
\label
{
fig:bnf:formula
}
\end{figure}
%%% Local Variables:
%%% mode: latex
...
...
doc/term.bnf
View file @
6c2c5eff
\begin{syntax}
term ::= integer ; integer constant
| real ; real constant
| qualid ; symbol
| prefix-op term ;
| term infix-op term ;
| lqualid term+ ; function application
| "if" formula "then" term "else" term ; conditional
| "let" pattern "=" term "in" term ; local binding
| "match" ("," term)+ "with" "|"? match-cases "end" ;
term ::= integer ; integer constant
| real ; real constant
| lqualid ; symbol
| prefix-op term ;
| term infix-op term ;
| lqualid term+ ; function application
| "if" formula "then" term ;
"else" term ; conditional
| "let" pattern "=" term "in" term
; local binding
| "match" ("," term)+ "with" ;
"|"? ("|" term-case)+ "end" ; pattern matching
| "(" term ("," term)* ")" ; tuple
| term ":" type ; cast
| label term ; label
| "(" term ")" ; parentheses%
\end{syntax}
| term ":" type ; cast
| label term ; label
| "(" term ")" ; parentheses
\
term-case ::= pattern "->" term ;
\
pattern ::= pattern "|" pattern ; or pattern
| pattern "," pattern ; tuple
| "_" ; catch-all
| lident ; variable
| uident pattern* ; constructor
| "(" pattern ")" ; parentheses
| pattern "as" lident ; binding %
\end{syntax}
\ No newline at end of file
tests/test-jcf.why
View file @
6c2c5eff
...
...
@@ -6,7 +6,8 @@ theory List
use import bool.Bool
logic x : int = if true then 1 else 3
logic x : int = match 1,2 with X u,y -> 3 end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment