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
126
Issues
126
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
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
c7703c36
Commit
c7703c36
authored
Apr 12, 2017
by
MARCHE Claude
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc: update descr of range and float types
parent
e1bd1825
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
67 deletions
+68
-67
doc/syntaxref.tex
doc/syntaxref.tex
+65
-64
doc/theory2.bnf
doc/theory2.bnf
+2
-0
doc/type.bnf
doc/type.bnf
+1
-3
No files found.
doc/syntaxref.tex
View file @
c7703c36
...
...
@@ -126,6 +126,71 @@ Note that the syntax for type
expressions notably differs from the usual ML syntax (
\eg
the
type of polymorphic lists is written
\texttt
{
list 'a
}
, not
\texttt
{
'a list
}
).
\subsection
{
Formulas
}
The syntax for formulas is given Figure~
\ref
{
fig:bnf:formula
}
.
The various constructs have the following priorities and
associativities, from lowest to greatest priority:
\begin{center}
\begin{tabular}
{
|l|l|
}
\hline
construct
&
associativity
\\
\hline\hline
\texttt
{
if then else
}
/
\texttt
{
let in
}
&
--
\\
label
&
--
\\
\texttt
{
->
}
/
\texttt
{
<->
}
&
right
\\
\texttt
{
by
}
/
\texttt
{
so
}
&
right
\\
\verb
!
\/
!
/
\verb
!
||
!
&
right
\\
\verb
|
/\
|
/
\verb
!
&&
!
&
right
\\
\texttt
{
not
}
&
--
\\
infix level 1
&
left
\\
infix level 2
&
left
\\
infix level 3
&
left
\\
infix level 4
&
left
\\
prefix
&
--
\\
\hline
\end{tabular}
\end{center}
Note that infix symbols of level 1 include equality (
\texttt
{
=
}
) and
disequality (
\texttt
{
<>
}
).
\begin{figure}
\begin{center}
\framebox
{
\input
{
./formula
_
bnf.tex
}}
\end{center}
\caption
{
Syntax for formulas.
}
\label
{
fig:bnf:formula
}
\end{figure}
Notice that there are two symbols for the conjunction:
\verb
|
/\
|
and
\verb
|
&&
|
, and similarly for disjunction. They are logically
equivalent, but may be treated slightly differently by some
transformations. For instance,
\texttt
{
split
}
transforms the goal
\verb
|
A /\ B
|
into subgoals
\verb
|
A
|
and
\verb
|
B
|
, whereas it transforms
\verb
|
A && B
|
into subgoals
\verb
|
A
|
and
\verb
|
A -> B
|
. Similarly, it
transforms
\verb
!
not (A || B)
!
into subgoals
\verb
|
not A
|
and
\verb
|
not ((not A) /\ B)
|
.
The
\texttt
{
by
}
/
\texttt
{
so
}
connectives are proof indications. They are
logically equivalent to their first argument, but may affect the result
of some transformations. For instance, the
\texttt
{
split
\_
goal
}
transformations interpret those connectives as introduction of logical cuts
(see~
\ref
{
tech:trans:split
}
for details).
\subsection
{
Theories
}
The syntax for theories is given on Figure~
\ref
{
fig:bnf:theorya
}
and~
\ref
{
fig:bnf:theoryb
}
.
\begin{figure}
\begin{center}
\framebox
{
\input
{
./theory
_
bnf.tex
}}
\end{center}
\caption
{
Syntax for theories (part 1).
}
\label
{
fig:bnf:theorya
}
\end{figure}
\begin{figure}
\begin{center}
\framebox
{
\input
{
./theory2
_
bnf.tex
}}
\end{center}
\caption
{
Syntax for theories (part 2).
}
\label
{
fig:bnf:theoryb
}
\end{figure}
\subsubsection
{
Algebraic types
}
TO BE COMPLETED
...
...
@@ -221,70 +286,6 @@ axiom fliteral42_axiom : f'real fliteral42 = 0.5 /\ f'isFinite fliteral42
This type is used in the standard library in the theories
\texttt
{
ieee
\_
float.Float32
}
and
\texttt
{
ieee
\_
float.Float64
}
.
\subsection
{
Formulas
}
The syntax for formulas is given Figure~
\ref
{
fig:bnf:formula
}
.
The various constructs have the following priorities and
associativities, from lowest to greatest priority:
\begin{center}
\begin{tabular}
{
|l|l|
}
\hline
construct
&
associativity
\\
\hline\hline
\texttt
{
if then else
}
/
\texttt
{
let in
}
&
--
\\
label
&
--
\\
\texttt
{
->
}
/
\texttt
{
<->
}
&
right
\\
\texttt
{
by
}
/
\texttt
{
so
}
&
right
\\
\verb
!
\/
!
/
\verb
!
||
!
&
right
\\
\verb
|
/\
|
/
\verb
!
&&
!
&
right
\\
\texttt
{
not
}
&
--
\\
infix level 1
&
left
\\
infix level 2
&
left
\\
infix level 3
&
left
\\
infix level 4
&
left
\\
prefix
&
--
\\
\hline
\end{tabular}
\end{center}
Note that infix symbols of level 1 include equality (
\texttt
{
=
}
) and
disequality (
\texttt
{
<>
}
).
\begin{figure}
\begin{center}
\framebox
{
\input
{
./formula
_
bnf.tex
}}
\end{center}
\caption
{
Syntax for formulas.
}
\label
{
fig:bnf:formula
}
\end{figure}
Notice that there are two symbols for the conjunction:
\verb
|
/\
|
and
\verb
|
&&
|
, and similarly for disjunction. They are logically
equivalent, but may be treated slightly differently by some
transformations. For instance,
\texttt
{
split
}
transforms the goal
\verb
|
A /\ B
|
into subgoals
\verb
|
A
|
and
\verb
|
B
|
, whereas it transforms
\verb
|
A && B
|
into subgoals
\verb
|
A
|
and
\verb
|
A -> B
|
. Similarly, it
transforms
\verb
!
not (A || B)
!
into subgoals
\verb
|
not A
|
and
\verb
|
not ((not A) /\ B)
|
.
The
\texttt
{
by
}
/
\texttt
{
so
}
connectives are proof indications. They are
logically equivalent to their first argument, but may affect the result
of some transformations. For instance, the
\texttt
{
split
\_
goal
}
transformations interpret those connectives as introduction of logical cuts
(see~
\ref
{
tech:trans:split
}
for details).
\subsection
{
Theories
}
The syntax for theories is given on Figure~
\ref
{
fig:bnf:theorya
}
and~
\ref
{
fig:bnf:theoryb
}
.
\begin{figure}
\begin{center}
\framebox
{
\input
{
./theory
_
bnf.tex
}}
\end{center}
\caption
{
Syntax for theories (part 1).
}
\label
{
fig:bnf:theorya
}
\end{figure}
\begin{figure}
\begin{center}
\framebox
{
\input
{
./theory2
_
bnf.tex
}}
\end{center}
\caption
{
Syntax for theories (part 2).
}
\label
{
fig:bnf:theoryb
}
\end{figure}
\subsection
{
Files
}
A
\why
input file is a (possibly empty) list of theories.
...
...
doc/theory2.bnf
View file @
c7703c36
...
...
@@ -3,6 +3,8 @@
| "=" type ; alias type
| "=" "|"? type-case ("|" type-case)* ; algebraic type
| "=" "{" record-field (";" record-field)* "}" ; record type
| "<" "range" integer integer ">" ; range type
| "<" "float" integer integer ">" ; float type
\
type-case ::= uident label* type-param*
\
...
...
doc/type.bnf
View file @
c7703c36
...
...
@@ -3,7 +3,5 @@
| "'" lident ; type variable
| "()" ; empty tuple type
| "(" type ("," type)+ ")" ; tuple type
| "(" type ")" ; parentheses
| "<" "range" integer integer ">" ; range type
| "<" "float" integer integer ">" ; float type %
| "(" type ")" ; parentheses %
\end{syntax}
\ No newline at end of file
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