Skip to content

Commit 66a0f23

Browse files
authored
snapshot v4 5 0 (#41)
- **Removing old latest** - **Documentation snapshot for v4.5.0**
1 parent 73da6bd commit 66a0f23

File tree

435 files changed

+51015
-587
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

435 files changed

+51015
-587
lines changed

Snapshots.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ layout: default
77

88
- [Current development version](https://dafny.org/dafny)
99
- [Latest release snapshot](https://dafny.org/latest)
10+
- [v4.5.0](https://dafny.org/v4.5.0)
1011
- [v4.4.0](https://dafny.org/v4.4.0)
1112
- [v4.3.0](https://dafny.org/v4.3.0)
1213
- [v4.2.0](https://dafny.org/v4.2.0)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
text.dfy(2,29): Error: Dafny's heuristics failed to confirm 'byte' to be a compatible native type. Hint: try writing a newtype constraint of the form 'i:int | lowerBound <= i < upperBound && (...any additional constraints...)'
1+
text.dfy(2,29): Error: Dafny's heuristics failed to confirm 'byte' to be a compatible native type. Hint: try writing a newtype constraint of the form 'i: int | lowerBound <= i < upperBound && (...any additional constraints...)'.
22
1 resolution/type errors detected in text.dfy
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
text.dfy(1,23): Verification out of resource (f (correctness))
1+
text.dfy(1,23): Error: Verification out of resource (f)
22

33
Dafny program verifier finished with 0 verified, 0 errors, 1 out of resource

latest/DafnyRef/Attributes.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,15 @@ Print effects are enforced only with `--track-print-effects`.
393393
`{:priority N}` assigns a positive priority 'N' to a method or function to control the order
394394
in which methods or functions are verified (default: N = 1).
395395

396-
### 11.2.14. `{:rlimit}` {#sec-rlimit}
396+
### 11.2.14. `{:resource_limit}` and `{:rlimit}` {#sec-rlimit}
397397

398-
`{:rlimit N}` limits the verifier resource usage to verify the method or function at `N * 1000`.
399-
This is the per-method equivalent of the command-line flag `/rlimit:N`.
398+
`{:resource_limit N}` limits the verifier resource usage to verify the method or function to `N`.
399+
400+
This is the per-method equivalent of the command-line flag `/rlimit:N` or `--resource-limit N`.
400401
If using [`{:vcs_split_on_every_assert}`](#sec-vcs_split_on_every_assert) as well, the limit will be set for each assertion.
401402

403+
The attribute `{:rlimit N}` is also available, and limits the verifier resource usage to verify the method or function to `N * 1000`. This version is deprecated, however.
404+
402405
To give orders of magnitude about resource usage, here is a list of examples indicating how many resources are used to verify each method:
403406

404407
* 8K resource usage
@@ -848,6 +851,10 @@ method Test()
848851

849852
The success message is optional but is recommended if errorMessage is set.
850853

854+
### 11.4.6. `{:contradiction}`
855+
856+
Silences warnings about this assertion being involved in a proof using contradictory assumptions when `--warn-contradictory-assumptions` is enabled. This allows clear identification of intentional proofs by contradiction.
857+
851858
## 11.5. Attributes on variable declarations
852859

853860
### 11.5.1. `{:assumption}` {#sec-assumption}
@@ -879,7 +886,7 @@ Here is an example:
879886
predicate P(i: int)
880887
predicate Q(i: int)
881888
882-
lemma PHoldEvenly()
889+
lemma {:axiom} PHoldEvenly()
883890
ensures forall i {:trigger Q(i)} :: P(i) ==> P(i + 2) && Q(i)
884891
885892
lemma PHoldsForTwo()

latest/DafnyRef/GrammarDetails.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,9 @@ MethodSignature_(isGhost, isExtreme) =
584584
KType = "[" ( "nat" | "ORDINAL" ) "]"
585585
586586
Formals(allowGhostKeyword, allowNewKeyword, allowOlderKeyword, allowDefault) =
587-
"(" [ GIdentType(allowGhostKeyword, allowNewKeyword, allowOlderKeyword,
587+
"(" [ { Attribute } GIdentType(allowGhostKeyword, allowNewKeyword, allowOlderKeyword,
588588
allowNameOnlyKeyword: true, allowDefault)
589-
{ "," GIdentType(allowGhostKeyword, allowNewKeyword, allowOlderKeyword,
589+
{ "," { Attribute } GIdentType(allowGhostKeyword, allowNewKeyword, allowOlderKeyword,
590590
allowNameOnlyKeyword: true, allowDefault) }
591591
]
592592
")"
@@ -1823,6 +1823,7 @@ LocalIdentTypeOptional = WildIdent [ ":" Type ]
18231823
IdentTypeOptional = WildIdent [ ":" Type ]
18241824
18251825
TypeIdentOptional =
1826+
{ Attribute }
18261827
{ "ghost" | "nameonly" } [ NoUSIdentOrDigits ":" ] Type
18271828
[ ":=" Expression(allowLemma: true, allowLambda: true) ]
18281829

latest/DafnyRef/Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
XELATEXF := /usr/local/texlive/2020/bin/x86_64-darwin/xelatex
2-
XELATEXB := /usr/local/texlive/2020basic/bin/x86_64-darwin/xelatex
3-
XELATEX := $(shell (test -x ${XELATEXF} && echo ${XELATEXF}) || (test -x ${XELATEXB} && echo ${XELATEXB}) || echo "xelatex")
4-
51
all: features numbers options
6-
./concat DafnyRef.md | sed -e '/numbered toc/d' -e '/:toc/d' -e '/PDFOMIT/d' -e 's/<!--PDF NEWPAGE-->/\\newpage/' -e 's/<!--.*-->//' | pandoc --citeproc --toc --syntax-definition="../KDESyntaxDefinition/dafny.xml" --syntax-definition="../KDESyntaxDefinition/grammar.xml" --highlight-style=../KDESyntaxDefinition/dafny.theme --pdf-engine=xelatex --bibliography=DafnyRef.bib --bibliography=krml250.bib --bibliography=poc.bib --bibliography=paper-full.bib --bibliography=references.bib -H head.tex -B header.tex -V colorlinks=true -t pdf -o DafnyRef.pdf
2+
./concat DafnyRef.md | sed -e '/numbered toc/d' -e '/:toc/d' -e '/PDFOMIT/d' -e 's/<!--PDF NEWPAGE-->/\\newpage/' -e 's/<!--.*-->//' | pandoc --citeproc --toc --syntax-definition="../KDESyntaxDefinition/dafny.xml" --syntax-definition="../KDESyntaxDefinition/grammar.xml" --highlight-style=../KDESyntaxDefinition/dafny.theme --pdf-engine=tectonic --bibliography=DafnyRef.bib --bibliography=krml250.bib --bibliography=poc.bib --bibliography=paper-full.bib --bibliography=references.bib -H head.tex -B header.tex -V colorlinks=true -t pdf -o DafnyRef.pdf
73

84
numbers:
95
javac Numbers.java && java Numbers -r DafnyRef.md

latest/DafnyRef/Options.txt

Lines changed: 34 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -33,36 +33,8 @@ Usage: dafny [ option ... ] [ filename ... ]
3333

3434
---- Plugins ---------------------------------------------------------------
3535

36-
/plugin:<path-to-one-assembly[,argument]*>
37-
38-
(experimental) One path to an assembly that contains at least one
39-
instantiatable class extending Microsoft.Dafny.Plugin.Rewriter. It
40-
can also extend Microsoft.Dafny.Plugins.PluginConfiguration to
41-
receive arguments. More information about what plugins do and how
42-
to define them:
43-
44-
https://github.com/dafny-lang/dafny/blob/master/Source/DafnyLanguageServer/README.md#about-plugins
45-
4636
---- Overall reporting and printing ----------------------------------------
4737

48-
/dprint:<file>
49-
Print Dafny program after parsing it.
50-
(Use - as <file> to print to console.)
51-
52-
/printMode:<Everything|DllEmbed|NoIncludes|NoGhost>
53-
Everything (default) - Print everything listed below.
54-
DllEmbed - print the source that will be included in a compiled dll.
55-
NoIncludes - disable printing of {:verify false} methods
56-
incorporated via the include mechanism, as well as datatypes and
57-
fields included from other files.
58-
NoGhost - disable printing of functions, ghost methods, and proof
59-
statements in implementation methods. It also disables anything
60-
NoIncludes disables.
61-
62-
/rprint:<file>
63-
Print Dafny program after resolving it.
64-
(use - as <file> to print to console.)
65-
6638
/showSnippets:<value>
6739
0 (default) - Don't show source code snippets for Dafny messages.
6840
1 - Show a source code snippet for each Dafny message.
@@ -105,15 +77,6 @@ Usage: dafny [ option ... ] [ filename ... ]
10577
`autoRevealDependencies` makes all functions not explicitly labelled as opaque to be opaque but reveals them automatically in scopes which do not have `{:autoRevealDependencies false}`.
10678
`opaque` means functions are always opaque so the opaque keyword is not needed, and functions must be revealed everywhere needed for a proof.
10779

108-
/generalTraits:<value>
109-
legacy (default) - Every trait implicitly extends 'object', and thus is a reference type. Only traits and reference types can extend traits.
110-
datatype - A trait is a reference type only if it or one of its ancestor traits is 'object'. Any non-'newtype' type with members can extend traits.
111-
full - (don't use; not yet completely supported) A trait is a reference type only if it or one of its ancestor traits is 'object'. Any type with members can extend traits.
112-
113-
/ntitrace:<value>
114-
0 (default) - Don't print debug information for the new type system.
115-
1 - Print debug information for the new type system.
116-
11780
/readsClausesOnMethods:<value>
11881
0 (default) - Reads clauses on methods are forbidden.
11982
1 - Reads clauses on methods are permitted (with a default of 'reads *').
@@ -124,14 +87,6 @@ Usage: dafny [ option ... ] [ filename ... ]
12487
See https://github.com/dafny-lang/dafny/blob/master/Source/DafnyStandardLibraries/README.md for more information.
12588
Not compatible with the /unicodeChar:0 option.
12689

127-
/titrace:<value>
128-
0 (default) - Don't print type-inference debug information.
129-
1 - Print type-inference debug information.
130-
131-
/typeSystemRefresh:<value>
132-
0 (default) - The type-inference engine and supported types are those of Dafny 4.0.
133-
1 - Use an updated type-inference engine. Warning: This mode is under construction and probably won't work at this time.
134-
13590
/unicodeChar:<value>
13691
0 - The char type represents any UTF-16 code unit.
13792
1 (default) - The char type represents any Unicode scalar value.
@@ -212,6 +167,16 @@ Usage: dafny [ option ... ] [ filename ... ]
212167

213168
---- Verification options -------------------------------------------------
214169

170+
/allowAxioms:<value>
171+
Prevents a warning from being generated for axioms, such as assume statements and functions or methods without a body, that don't have an {:axiom} attribute.
172+
173+
/verificationLogger:<configuration>
174+
Logs verification results using the given test result format. The currently supported formats are `trx`, `csv`, and `text`. These are: the XML-based format commonly used for test results for .NET languages, a custom CSV schema, and a textual format meant for human consumption. You can provide configuration using the same string format as when using the --logger option for dotnet test, such as: --format "trx;LogFileName=<...>");
175+
176+
The `trx` and `csv` formats automatically choose an output file name by default, and print the name of this file to the console. The `text` format prints its output to the console by default, but can send output to a file given the `LogFileName` option.
177+
178+
The `text` format also includes a more detailed breakdown of what assertions appear in each assertion batch. When combined with the isolate-assertions option, it will provide approximate time and resource use costs for each assertion, allowing identification of especially expensive assertions.
179+
215180
/dafnyVerify:<n>
216181
0 - Stop after resolution and typechecking.
217182
1 - Continue on to verification and compilation.
@@ -223,30 +188,6 @@ Usage: dafny [ option ... ] [ filename ... ]
223188
Output verification results for each module separately, rather than
224189
aggregating them after they are all finished.
225190

226-
/verificationLogger:<configuration string>
227-
Logs verification results to the given test result logger. The
228-
currently supported loggers are `trx`, `csv`, and `text`. These are
229-
the XML-based format commonly used for test results for .NET
230-
languages, a custom CSV schema, and a textual format meant for human
231-
consumption. You can provide configuration using the same string
232-
format as when using the --logger option for dotnet test, such as:
233-
234-
/verificationLogger:trx;LogFileName=<...>.
235-
236-
The exact mapping of verification concepts to these formats is
237-
experimental and subject to change!
238-
239-
The `trx` and `csv` loggers automatically choose an output file name
240-
by default, and print the name of this file to the console. The
241-
`text` logger prints its output to the console by default, but can
242-
send output to a file given the `LogFileName` option.
243-
244-
The `text` logger also includes a more detailed breakdown of what
245-
assertions appear in each assertion batch. When combined with the
246-
`/vcsSplitOnEveryAssert` option, it will provide approximate time
247-
and resource use costs for each assertion, allowing identification
248-
of especially expensive assertions.
249-
250191
/noCheating:<n>
251192
0 (default) - Allow assume statements and free invariants.
252193
1 - Treat all assumptions as asserts, and drop free.
@@ -338,16 +279,10 @@ Usage: dafny [ option ... ] [ filename ... ]
338279

339280
/extractCounterexample
340281
If verification fails, report a detailed counterexample for the
341-
first failing assertion. Requires specifying the /mv:<file> option as well
342-
as /proverOpt:O:model_compress=false (for z3 version < 4.8.7) or
343-
/proverOpt:O:model.compact=false (for z3 version >= 4.8.7), and
344-
/proverOpt:O:model.completion=true.
282+
first failing assertion (experimental).
345283

346284
---- Compilation options ---------------------------------------------------
347285

348-
/compileSuffix:<value>
349-
Add the suffix _Compile to module names without :extern
350-
351286
/compileTarget:<language>
352287
cs (default) - Compile to .NET via C#.
353288
go - Compile to Go.
@@ -380,6 +315,16 @@ Usage: dafny [ option ... ] [ filename ... ]
380315
/out:<file>
381316
Specify the filename and location for the generated target language files.
382317

318+
/runAllTests:<n>
319+
0 (default) - Annotates compiled methods with the {:test}
320+
attribute such that they can be tested using a testing framework
321+
in the target language (e.g. xUnit for C#).
322+
1 - Emits a main method in the target language that will execute
323+
every method in the program with the {:test} attribute. Cannot
324+
be used if the program already contains a main method. Note that
325+
/compile:3 or 4 must be provided as well to actually execute
326+
this main method!
327+
383328
/compile:<n>
384329
0 - Do not compile Dafny program.
385330
1 (default) - Upon successful verification of the Dafny program,
@@ -400,15 +345,6 @@ Usage: dafny [ option ... ] [ filename ... ]
400345
When running a Dafny file through /compile:3 or /compile:4, '--args' provides
401346
all arguments after it to the Main function, at index starting at 1.
402347
Index 0 is used to store the executable's name if it exists.
403-
/runAllTests:<n> (experimental)
404-
0 (default) - Annotates compiled methods with the {:test}
405-
attribute such that they can be tested using a testing framework
406-
in the target language (e.g. xUnit for C#).
407-
1 - Emits a main method in the target language that will execute
408-
every method in the program with the {:test} attribute. Cannot
409-
be used if the program already contains a main method. Note that
410-
/compile:3 or 4 must be provided as well to actually execute
411-
this main method!
412348

413349
/compileVerbose:<n>
414350
0 - Don't print status of compilation to the console.
@@ -669,12 +605,14 @@ Usage: dafny [ option ... ] [ filename ... ]
669605
the SMT theory of arrays. This option allows the use of axioms instead.
670606
/reflectAdd In the VC, generate an auxiliary symbol, elsewhere defined
671607
to be +, instead of +.
672-
/prune
673-
Turn on pruning. Pruning will remove any top-level Boogie declarations
674-
that are not accessible by the implementation that is about to be verified.
675-
Without pruning, due to the unstable nature of SMT solvers,
676-
a change to any part of a Boogie program has the potential
677-
to affect the verification of any other part of the program.
608+
/prune:<n>
609+
0 - Turn off pruning.
610+
1 - Turn on pruning (default). Pruning will remove any top-level
611+
Boogie declarations that are not accessible by the implementation
612+
that is about to be verified. Without pruning, due to the unstable
613+
nature of SMT solvers, a change to any part of a Boogie program
614+
has the potential to affect the verification of any other part of
615+
the program.
678616

679617
Only use this if your program contains uses clauses
680618
where required, otherwise pruning will break your program.
@@ -708,6 +646,11 @@ Usage: dafny [ option ... ] [ filename ... ]
708646
report. This generalizes and replaces the previous
709647
(undocumented) `/printNecessaryAssertions` option.
710648

649+
/keepQuantifier
650+
If pool-based quantifier instantiation creates instances of a quantifier
651+
then keep the quantifier along with the instances. By default, the quantifier
652+
is dropped if any instances are created.
653+
711654
---- Verification-condition splitting --------------------------------------
712655

713656
/vcsMaxCost:<f>

latest/DafnyRef/README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ subfolders. In order to render files locally you must
3030
* set the working directly (`cd`) to the `docs` folder (Windows or Ruby 3.0 users, see below for some tweaks)
3131
* run the jekyll server: `bundle exec jekyll server`
3232
* open a browser on the page http://localhost:4000 or directly to http://localhost:4000/DafnyRef/DafnyRef
33-
* the server rerenders when files are changed -- but not always quite completely. Sometimes one must kill the server process, delete all the files in the _saite folder, and restart the server.
33+
* the server rerenders when files are changed -- but not always quite completely. Sometimes one must kill the server process, delete all the files in the _site folder, and restart the server.
3434

3535
In order to convert markdown to pdf, you must be able to execute the Makefile, which requires installing pandoc and LaTeX, and being on a Linux-like platform.
3636

@@ -64,12 +64,11 @@ definition file.
6464
## On-line RM through github
6565
Github uses rouge, via Jekyll. The syntax definition is a ruby-based file
6666
maintained in the rouge github repo.
67-
To modify the definition, follow the directions in
68-
[https://rouge-ruby.github.io/docs/file.LexerDevelopment.html]
69-
(https://rouge-ruby.github.io/docs/file.LexerDevelopment.html)
70-
after setting up a development environment according to
71-
[https://rouge-ruby.github.io/docs/file.DevEnvironment.html]
72-
(https://rouge-ruby.github.io/docs/file.DevEnvironment.html).
67+
To modify the definition, follow
68+
[these](https://rouge-ruby.github.io/docs/file.LexerDevelopment.html)
69+
directions after [setting
70+
up](https://rouge-ruby.github.io/docs/file.DevEnvironment.html) a
71+
development environment.
7372
The file itself, `dafny.rb` is in Ruby. Details of the Ruby Regular
7473
Expression language can be found many places online, such as
7574
[here](https://www.princeton.edu/~mlovett/reference/Regular-Expressions.pdf).
@@ -113,4 +112,4 @@ file as well.
113112
## LSP
114113

115114
Many IDEs interact with Language Servers (via LSP). Possibly an LSP protocol
116-
will be generated in the future.
115+
will be generated in the future.

latest/DafnyRef/Refinement.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Method declarations can be refined as in the following example.
152152

153153
<!-- %check-verify -->
154154
```dafny
155-
module A {
155+
abstract module A {
156156
method ToImplement(x: int) returns (r: int)
157157
ensures r > x
158158
@@ -225,7 +225,7 @@ the following example.
225225

226226
<!-- %check-verify -->
227227
```dafny
228-
module A {
228+
abstract module A {
229229
function F(x: int): (r: int)
230230
ensures r > x
231231

latest/DafnyRef/Specifications.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ A requires clause can have [custom error and success messages](#sec-error-attrib
6767
Examples:
6868
<!-- %check-resolve -->
6969
```dafny
70-
method m(i: int) returns (r: int)
70+
method {:axiom} m(i: int) returns (r: int)
7171
ensures r > 0
7272
```
7373

@@ -914,7 +914,7 @@ method Test(a: array<int>) returns (j: int)
914914
Dafny will split the verification in two [assertion batches](#sec-assertion-batches)
915915
that will roughly look like the following lemmas:
916916

917-
<!-- %check-verify -->
917+
<!-- %check-verify %options --allow-axioms -->
918918
```dafny
919919
lemma Test_WellFormed(a: array?<int>)
920920
{

0 commit comments

Comments
 (0)