Dafny is a verification-aware programming language
Add a check to dafny run
that notifies the user when a value that was parsed as a user program argument, and which occurs before a --
token, starts with --
, since this indicates they probably mistyped a Dafny option name. (https://github.com/dafny-lang/dafny/pull/5097)
Add an option --progress that can be used to track the progress of verification. (https://github.com/dafny-lang/dafny/pull/5150)
Add the attribute {:isolate_assertions}
, which does the same as {:vcs_split_on_every_assert}
. Deprecated {:vcs_split_on_every_assert}
(https://github.com/dafny-lang/dafny/pull/5247)
(soundness issue) Twostate predicate now check if their not new arguments are allocated in the previous heap (https://github.com/dafny-lang/dafny/pull/4844)
Add uniform checking of type characteristics in refinement modules (https://github.com/dafny-lang/dafny/pull/5146)
Fixed links associated with the standard libraries. (https://github.com/dafny-lang/dafny/pull/5176)
fix: Disable the "erase datatype wrappers" optimization if the datatype implements any traits. feat: Allow the "erase datatype wrappers" optimization if the only fields in the datatype are ghost fields. (https://github.com/dafny-lang/dafny/pull/5234)
Fix the default string value emitted for JavaScript (https://github.com/dafny-lang/dafny/pull/5239)
Add the option --include-test-runner
to dafny translate
, to enable getting the same result as dafny test
when doing manual compilation. (https://github.com/dafny-lang/dafny/pull/3818)
--filter-position
to the dafny verify
command. The option filters what gets verified based on a source location. The location is specified as a file path suffix, optionally followed by a colon and a line number. For example, dafny verify dfyconfig.toml --filter-position=source1.dfy:5
will only verify things that range over line 5 in the file source1.dfy
. In combination with ``--isolate-assertions, individual assertions can be verified by filtering on the line that contains them. When processing a single file, the filename can be skipped, for example:
dafny verify MyFile.dfy --filter-position=:23`--filter-symbol
to the dafny verify
command, that only verifies symbols whose fully qualified name contains the given argument. For example, dafny verify dfyconfig.toml --filter-symbol=MyModule
will verify everything inside MyModule
.--boogie-filter
has been removed in favor of --filter-symbol
(https://github.com/dafny-lang/dafny/pull/4816)Add a json
format to those supported by --log-format
and /verificationLogger
, for producing thorough, machine readable logs of verification results. (https://github.com/dafny-lang/dafny/pull/4951)
--warn-deprecation
and change the name to --allow-deprecation
, so the default is now false, which is standard for boolean options.--allow-deprecation
, deprecated code is shown using tooltips in the IDE, and on the CLI when using --show-tooltips
.--warn-as-error
with the option --allow-warnings
. The new option, when false, the default value, causes Dafny to stop generating executable output and return a failure exit code, when warnings occur in the program. Contrary to the previous --warn-as-error
option, warnings are always reported as warnings.
dafny run --allow-warnings
if they want to run their Dafny code when it contains warnings.--allow-warnings
to allow them to still pass.--allow-warnings
, and do not want to migrate off of deprecated features, they will have to use --allow-deprecation
.--allow-warnings
causes a warning if used by a consumer that does not use it.
(https://github.com/dafny-lang/dafny/pull/4971)The new {:contradiction}
attribute can be placed on an assert
statement to indicate that it forms part of an intentional proof by contradiction and therefore shouldn't be warned about when --warn-contradictory-assumptions
is turned on. (https://github.com/dafny-lang/dafny/pull/5001)
Function and method parameters and return types, and datatype constructor arguments, can now have attributes. By default, there are no attributes that Dafny recognizes in these positions, but custom back-ends can use this feature to get extra information from the source files. (https://github.com/dafny-lang/dafny/pull/5032)
Under the CLI option --general-newtypes
, the base type of a newtype
declaration can now be (int
or real
, as before, or) bool
, char
, or a bitvector type.
as
and is
expressions now support more types than before. In addition, run-time type tests are supported for is
expressions, provided type parameters are injective (as was already required) and provided the constraints of any subset type or newtype is compilable. Note, although both as
and is
allow many more useful cases than before, using --general-newtypes
will also forbid some unusual cases that were previously allowed. Any such case that is now forbidden can still be done by doing the as
/is
via int
.
(https://github.com/dafny-lang/dafny/pull/5061)
Allow newtype declarations to be based on set/iset/multiset/seq. (https://github.com/dafny-lang/dafny/pull/5133)
Fixed crash caused by cycle in type declaration (https://github.com/dafny-lang/dafny/pull/4471)
Fix resolution of unary minus in new resolver (https://github.com/dafny-lang/dafny/pull/4737)
The command line and the language server now use the same counterexample-related Z3 options. (https://github.com/dafny-lang/dafny/pull/4792)
Dafny no longer crashes when required parameters occur after optional ones. (https://github.com/dafny-lang/dafny/pull/4809)
Use defensive coding to prevent a crash in the IDE that could occur in the context of code actions. (https://github.com/dafny-lang/dafny/pull/4818)
Fix null-pointer problem in new resolver (https://github.com/dafny-lang/dafny/pull/4875)
Fixed a crash that could occur when a case body of a match that was inside a loop, had a continue or break statement. (https://github.com/dafny-lang/dafny/pull/4894)
Compile run-time constraint checks for newtypes in comprehensions (https://github.com/dafny-lang/dafny/pull/4919)
Fix null dereference in constant-folding invalid string-indexing expressions (https://github.com/dafny-lang/dafny/pull/4921)
Check for correct usage of type characteristics in specifications and other places where they were missing.
This fix will cause build breaks for programs with missing type characteristics (like (!new)
and (0)
). Any such error message is accompanied with a hint about what type characterics need to be added where.
(https://github.com/dafny-lang/dafny/pull/4928)
Initialize additional fields in the AST (https://github.com/dafny-lang/dafny/pull/4930)
Fix crash when a function/method with a specification is overridden in an abstract type. (https://github.com/dafny-lang/dafny/pull/4954)
Fix crash for lookup of non-existing member in new resolver (https://github.com/dafny-lang/dafny/pull/4955)
Fix: check that subset-type variable's type is determined (resolver refresh).
Fix crash in verifier when there was a previous error in determining subset-type/newtype base type.
Fix crash in verifier when a subset type has no explicit witness
clause and has a non-reference trait as its base type.
(https://github.com/dafny-lang/dafny/pull/4956)
The {:rlimit N}
attribute, which multiplied N
by 1000 before sending it to Z3, is deprecated in favor of the {:resource_limit N}
attribute, which can accept string arguments with exponential notation for brevity. The --resource-limit
and /rlimit
flags also now omit the multiplication, and the former allows exponential notation. (https://github.com/dafny-lang/dafny/pull/4975)
Allow a datatype to depend on traits without being told "datatype has no instances" (https://github.com/dafny-lang/dafny/pull/4997)
Don't consider := *
to be a definite assignment for non-ghost variables of a (00)
type (https://github.com/dafny-lang/dafny/pull/5024)
Detect the same ghost usage in initializing assignments as in other expressions. The effect of this fix is to allow more iset/imap comprehensions to be compiled.
Also, report errors if the LHS of :=
in compiled map
/imap
comprehensions contains ghosts.
(https://github.com/dafny-lang/dafny/pull/5041)
Escape names of nested modules in C# and Java (https://github.com/dafny-lang/dafny/pull/5049)
A parent trait that is a reference type can now be named via import opened
.
Implicit conversions between a datatype and its parent traits no longer crashes the verifier.
(Dis)equality expressions of a (co)datatype and its parent traits no longer crashes the verifier. (https://github.com/dafny-lang/dafny/pull/5058)
Fixed support for newtypes as sequence comprehension lengths in Java (https://github.com/dafny-lang/dafny/pull/5065)
Don't emit an error message for a function-by-method
with unused type parameters. (https://github.com/dafny-lang/dafny/pull/5068)
The syntax of a predicate definition must always include parentheses. (https://github.com/dafny-lang/dafny/pull/5069)
Termination override check for certain non-reference trait implementations (https://github.com/dafny-lang/dafny/pull/5087)
Malformed Python code for some functions involving lambdas (https://github.com/dafny-lang/dafny/pull/5093)
Let verifier understand opaque function overrides, supporting both when the overridden function is opaque and non-opaque. Revealing such a function for one overriding type has the effect of revealing it for all overriding types.
Also, forbid the case where a function is opaque in a parent trait and the function override is not opaque. (Previously, this had caused a crash.) (https://github.com/dafny-lang/dafny/pull/5111)
Reads clauses on method declarations are now supported when the --reads-clauses-on-methods
option is provided.
The {:concurrent}
attribute now verifies that the reads
and modifies
clauses are empty instead of generating an auditor warning.
(https://github.com/dafny-lang/dafny/pull/4440)
Added two new options, --warn-contradictory-assumptions
and --warn-redundant-assumptions
, to detect potential problems with specifications that indicate that successful verification may be misleading. These options are currently hidden because they may occasionally produce false positives in cases where proofs are so trivial that the solver never does work on them. (https://github.com/dafny-lang/dafny/pull/4542)
Verification of the {:concurrent}
attribute on methods now allows non-empty reads
and modifies
clauses with the {:assume_concurrent}
attribute. (https://github.com/dafny-lang/dafny/pull/4563)
Implemented support for workspace/symbol request to allow IDE navigation by symbol. (https://github.com/dafny-lang/dafny/pull/4619)
The new --verification-coverage-report
flag to dafny verify
creates an HTML report highlighting which portions of the program were and were not necessary for verification. The format is the same as for dafny generate-tests --coverage-report
and files from the two commands can be merged. (https://github.com/dafny-lang/dafny/pull/4625)
Built-in types such as the nat
subset type, tuples, arrows, and arrays are now pre-compiled into each backend's runtime library,
instead of emitted on every call to dafny translate
, to avoid potential duplicate definitions when translating components separately.
(https://github.com/dafny-lang/dafny/pull/4658)
The new --only-label
option to merge-coverage-reports
includes only one category of highlighting in the output. For example, merging coverage reports from test generation and verification using the option --only-label NotCovered
will highlight only the regions not covered by either testing or verification. (https://github.com/dafny-lang/dafny/pull/4673)
The Dafny distribution now includes standard libraries, available with the --standard-libraries
option.
See https://github.com/dafny-lang/dafny/blob/master/Source/DafnyStandardLibraries/README.md for details.
(https://github.com/dafny-lang/dafny/pull/4678)
Introduce replaceable modules, which can be used to help define Dafny applications that translate to multiple target languages. (https://github.com/dafny-lang/dafny/pull/4681)
The new --coverage-report
flag to dafny run
and dafny test
creates an HTML report highlighting which portions of the program were executed at runtime. (https://github.com/dafny-lang/dafny/pull/4755)
Enable turning nonlinear arithmetic on or off on a per-module basis, using the attribute {:disable-nonlinear-arithmetic}
,
which optionally takes the value false to enable nonlinear arithmetic.
(https://github.com/dafny-lang/dafny/pull/4773)
Let the IDE provide code navigation in situations where the program parses but has resolution errors. Note that this only works for modules whose dependency tree does not have errors, or modules who contain errors themselves, but not for modules whose dependencies contain errors. (https://github.com/dafny-lang/dafny/pull/4855)
Ensures that computing the set of values or items of map can only be done if the type of the range supports equality. (https://github.com/dafny-lang/dafny/pull/1373)
Subset type decl's witness correctly taken into account (https://github.com/dafny-lang/dafny/pull/3792)
Added a comprehensive test for test generation and fixed a bug that prevented test generation to process function-by-method declarations (https://github.com/dafny-lang/dafny/pull/4406)
Optimized memory consumption of test generation by reusing the Boogie AST of the target Dafny program. (https://github.com/dafny-lang/dafny/pull/4530)
Fix a bug that prevented certain types of lemma to be verified in the IDE (https://github.com/dafny-lang/dafny/pull/4607)
Dot completion now works on values the type of which is a type synonym. (https://github.com/dafny-lang/dafny/pull/4635)
Fix a case where the document symbol API would return incorrect data when working on a file with parse errors (https://github.com/dafny-lang/dafny/pull/4675)
Emit less nested target code in match-case expressions (nice for readability, and necessary for Java) (https://github.com/dafny-lang/dafny/pull/4683)
Ghost diagnostics are now correctly updated when they become empty (https://github.com/dafny-lang/dafny/pull/4693)
Enable verification options that are configured in a Dafny project file, to be picked up by the Dafny language server (https://github.com/dafny-lang/dafny/pull/4703)
Prevent double-counting of covered/uncovered lines in test coverage reports (https://github.com/dafny-lang/dafny/pull/4710)
fix: correction of type inference for default expressions (https://github.com/dafny-lang/dafny/pull/4724)
The new type checker now also supports static reveals for instance functions (https://github.com/dafny-lang/dafny/pull/4733)
Resolve :- expressions with void outcomes in new resolver (https://github.com/dafny-lang/dafny/pull/4734)
Crash in the resolver on type parameters of opaque functions in refined modules (https://github.com/dafny-lang/dafny/pull/4768)
Fix error messages being printed after their context snippets (https://github.com/dafny-lang/dafny/pull/4787)
Override checks no longer crashing when substituting type parameters and equality (https://github.com/dafny-lang/dafny/pull/4812)
Removed one cause of need for restarting the IDE. (https://github.com/dafny-lang/dafny/pull/4833)
The Python compiler emits reserved names for datatypes (https://github.com/dafny-lang/dafny/pull/4843)
Add support for the Find References LSP request
Improve scalability of inlining for test generation and generate coverage information with respect to the original Dafny source (https://github.com/dafny-lang/dafny/pull/4255)
Support generating of tests targeting path-coverage of the entire program and tests targeting call-graph-sensitive block coverage (referred to as Branch coverage) (https://github.com/dafny-lang/dafny/pull/4326)
Add support for Rename LSP request
Make verification in the IDE more responsive by starting verification after translating the required module to Boogie, instead of first translating all modules that could be verified. (https://github.com/dafny-lang/dafny/pull/4378)
The Dafny IDE now has improved behavior when working with a Dafny file that's part of a Dafny project. A Dafny file is part of a project if a dfyconfig.toml
can be found somewhere in the file's path hierarchy, such as in the same folder or in the parent folder. A dfyconfig.toml
can specify which Dafny options to use for that project, and can specify which Dafny files are part of the project. By default, the project will include all .dfy files reachable from the folder in which the dfyconfig.toml
resides. Project related features of the IDE are:
Try out the IDE's project support now by creating an empty dfyconfig.toml
file in the root of your project repository.
(https://github.com/dafny-lang/dafny/pull/4435)
Prior to generating tests, Dafny now checks the targeted program for any features that test generation does not support or any misuse of test generation specific attributes. Any such issues are reported to the user. (https://github.com/dafny-lang/dafny/pull/4444)
Added documentation of the generate-tests command to the reference manual (https://github.com/dafny-lang/dafny/pull/4445)
When two modules in the same scope have the same name, Dafny now reports an error that contains the location of both modules. (https://github.com/dafny-lang/dafny/pull/4499)
Triggers warnings correclty converted into errors with --warn-as-errors (https://github.com/dafny-lang/dafny/pull/3358)
Allow JavaScript keywords as names of Dafny modules (https://github.com/dafny-lang/dafny/pull/4243)
Support odd characters in pathnames for Go (https://github.com/dafny-lang/dafny/pull/4257)
Allow Dafny filenames compiled to Java to start with a digit (https://github.com/dafny-lang/dafny/pull/4258)
Parser now supports files with a lot of consecutive single-line comments (https://github.com/dafny-lang/dafny/pull/4261)
Gutter icons more robust (https://github.com/dafny-lang/dafny/pull/4287)
Unresolved abstract imports no longer crash the resolver (https://github.com/dafny-lang/dafny/pull/4298)
Make capitalization of target Go code consistent (https://github.com/dafny-lang/dafny/pull/4310)
Refining an abstract module with a class with an opaque function no longer crashes (https://github.com/dafny-lang/dafny/pull/4315)
Dafny can now produce coverage reports indicating which parts of the program are expected to be covered by automatically generated tests. The same functionality can be used to report other forms of coverage. (https://github.com/dafny-lang/dafny/pull/4325)
Fix issue that would prevent the IDE from correctly handling default export sets (https://github.com/dafny-lang/dafny/pull/4328)
Allow function-syntax and other options with a custom default to be overridden in dfyconfig.toml
(https://github.com/dafny-lang/dafny/pull/4357)
There were two differences between verification in the IDE and the CLI, one small and one tiny, which would only become apparent for proofs that Z3 had trouble verifying. The small difference has been resolved, while the tiny one still persists, so the IDE and CLI should behave almost equivalently now, including resource counts, on most code. (https://github.com/dafny-lang/dafny/pull/4374)
Old command line interface for test generation is no longer supported, all calls should use dafny generate-tests (https://github.com/dafny-lang/dafny/pull/4385)
Fixed a bug leading to stack overflow during counterexample extraction on some programs. (https://github.com/dafny-lang/dafny/pull/4392)
Ability to use .Key as a constant name in datatypes and classes (https://github.com/dafny-lang/dafny/pull/4394)
Existential assertions are now printed correctly (https://github.com/dafny-lang/dafny/pull/4401)
When a symbol such as a method is not given a name, the error given by Dafny now shows where this problem occurs. (https://github.com/dafny-lang/dafny/pull/4411)
Fix flickering and incorrect results in the verification status bar, and improve responsiveness of verification diagnostics (https://github.com/dafny-lang/dafny/pull/4413)
Significantly improve IDE responsiveness for large projects, preventing it from appearing unresponsive or incorrect. Previously, for projects of a certain size, the IDE would not be able to keep up with incoming changes made by the user, possibly causing it to never catch up and appearing frozen or showing outdated results. (https://github.com/dafny-lang/dafny/pull/4419)
Declarations with {:only} ensure that other declarations aren't displayed as verified in the gutter icons (https://github.com/dafny-lang/dafny/pull/4432)
Fix issues that could cause the IDE status bar to show incorrect information (https://github.com/dafny-lang/dafny/pull/4454)
When verification times out, only show a red underline on the name of the verifiable for which verification timed out, instead of under its whole definition. (https://github.com/dafny-lang/dafny/pull/4477)
Prevent the IDE from becoming completely unresponsive after certain kinds of parse errors would occur. (https://github.com/dafny-lang/dafny/pull/4495)
Support all types of options in the Dafny project file (dfyconfig.toml) (https://github.com/dafny-lang/dafny/pull/4506)
Fix an issue that would cause some types of errors and other diagnostics not to appear in the IDE, if they appeared in files other than the active one. (https://github.com/dafny-lang/dafny/pull/4513)
Fix an IDE issue that would lead to exceptions when using module export declarations and making edits in imported modules that were re-exported (https://github.com/dafny-lang/dafny/pull/4556)
Fix a leak in the IDE that would cause it to become less responsive over time. (https://github.com/dafny-lang/dafny/pull/4570)
The --show-snippets options is implemented for errors printed to the console (https://github.com/dafny-lang/dafny/pull/3304)
Unicode representations of mathematical symbols (such as logical implies, and, and or) are no longer recognized by the parser. (https://github.com/dafny-lang/dafny/pull/3755)
Allow the Dafny IDE to publish 'Parsing' and 'Preparing Verification' messages to let the user better understand what they're waiting for. (https://github.com/dafny-lang/dafny/pull/4031)
Removed obsolete options /mimicVerificationOf, /allowGlobals (https://github.com/dafny-lang/dafny/pull/4062)
Allow the {:only}
attribute to be used on members in addition to assert
statements (https://github.com/dafny-lang/dafny/pull/4074)
The obsolete and unsound option /allocated is removed; the behavior of dafny is locked to the case of /allocated:4. (https://github.com/dafny-lang/dafny/pull/4076)
When using the Dafny CLI, error messages of the form "the included file
When using the Dafny IDE, parsing is now cached in order to improve performance when making changes in multi-file projects. (https://github.com/dafny-lang/dafny/pull/4085)
Errors issued in command-line mode now show source code context by default; this behavior can be disabled using the option --show-snippets:false. (https://github.com/dafny-lang/dafny/pull/4087)
Reduced resolution time by up to 50%. Measurements on large codebases show a 35% average reduction in resolution time.
After generating Python code we run the byte-code compiler to surface possible issues earlier, if it's not subsequently run. (https://github.com/dafny-lang/dafny/pull/4155)
Improve the responsiveness of the Dafny language server when making changes while it is in the 'Resolving...' state. (https://github.com/dafny-lang/dafny/pull/4175)
It is now possible to reveal an instance function of a class by a static reveal, without the need of an object of that class. (https://github.com/dafny-lang/dafny/pull/4176)
Support for the --bprint
option for language server arguments (https://github.com/dafny-lang/dafny/pull/4206)
Improve printing of real numbers to use decimal notation more often (https://github.com/dafny-lang/dafny/pull/4235)
When translated to other languages, Dafny module names no longer have the suffix _Compile
appended to them. This may cause issues with existing code from non-Dafny languages in your codebase, if that code was previously referencing modules with _Compile
in the name. You can migrate either by removing the _Compile
part of references in your codebase, or by using the backwards compatibility option --compile-suffix
when using translate
, build
, or run
. (https://github.com/dafny-lang/dafny/pull/4265)
Counterexample parsing now supports both the 'Arguments' and 'Predicates' polymorphism encoding in Boogie. (https://github.com/dafny-lang/dafny/pull/4299)
Removed wrong "related position" precision when dealing with regrouped quantifiers (https://github.com/dafny-lang/dafny/pull/2211)
Fixed crash on an empty filename (https://github.com/dafny-lang/dafny/pull/3549)
Fixes crash if solver-path is not found (https://github.com/dafny-lang/dafny/pull/3572)
Avoid infinite recursion when trying to construct a potentially self-referential object during test generation (https://github.com/dafny-lang/dafny/pull/3727)
Better error message when incorrect number of out parameters (https://github.com/dafny-lang/dafny/pull/3835)
Compilation of continue labels no longer crashing in Go (https://github.com/dafny-lang/dafny/pull/3978)
The terminology 'opaque type' is changed to 'abstract type (for uninterpreted type declarations), to avoid ambiguity with used of the 'opaque' keyword and revealing declarations (https://github.com/dafny-lang/dafny/pull/3990)
Ensures override checks have access to fuel constant equivalences (https://github.com/dafny-lang/dafny/pull/3995)
No more crash when using constant in pattern (https://github.com/dafny-lang/dafny/pull/4000)
Remove multiset cardinality cap in Python (https://github.com/dafny-lang/dafny/pull/4014)
Wrong statement order in generated code for certain for-loops (https://github.com/dafny-lang/dafny/pull/4015)
Making assertion explicit work for nested statements (https://github.com/dafny-lang/dafny/pull/4016)
Use type antecedent in Type/Allocation axioms for const fields Don't generate injectivity axioms for export-provided types (https://github.com/dafny-lang/dafny/pull/4020)
Added a new CLI option --warn-deprecation, which is on by default Extraneous semicolons are now warned about by default; the warning can be disabled using --warn-deprecation:false (https://github.com/dafny-lang/dafny/pull/4041)
Regression in the subset check of the function override check (https://github.com/dafny-lang/dafny/pull/4056)
Fix function to function-by-method transformation pass in test generation that could previously lead to parsing errors (https://github.com/dafny-lang/dafny/pull/4067)
Modules verified in the correct order to prevent Boogie Crash (https://github.com/dafny-lang/dafny/pull/4139)
In VSCode, resource units are now always displayed with 3 digit precision. Moreover, they can now display values greater than MAX_INT without displaying a negative result. (https://github.com/dafny-lang/dafny/pull/4143)
Remove redundant code in the test generation project (https://github.com/dafny-lang/dafny/pull/4146)
Generate type axioms in the absence of explicit constraints for newtype
s (https://github.com/dafny-lang/dafny/pull/4190)
Support for opaque function handles (https://github.com/dafny-lang/dafny/pull/4202)
Traits with opaque functions can now be extended without errors (https://github.com/dafny-lang/dafny/pull/4205)
Disabled --show-snippets CLI option, which is otherwise on by default, during test generation Test generation modifies Boogie AST resulting from Dafny, and is, therefore, incompatible with --show-snippets (https://github.com/dafny-lang/dafny/pull/4216)
Select proper division for real-based newtypes (https://github.com/dafny-lang/dafny/pull/4234)
Formatting in the IDE consistent again with the CLI (https://github.com/dafny-lang/dafny/pull/4269)
Fixes invalid declaration errors when verifying directly from Dafny using /typeEncoding:m. (https://github.com/dafny-lang/dafny/pull/4275)
Make gutter icons more robust to document changes (https://github.com/dafny-lang/dafny/pull/4308)
Added support for .toml
based Dafny project files. For now the project file only allows specifying which Dafny files to include and exclude, and what options to use.
The CLI commands that take Dafny files as input, such as build, run, translate, will now also accept Dafny project files.
When using an IDE based on dafny server
, such as the Dafny VSCode extension, the IDE will look for a Dafny project file by traversing up the file tree from the currently opened file, until it finds it dfyconfig.toml
. The project file will override options specified in the IDE.
(https://github.com/dafny-lang/dafny/pull/2907)
Recognize the {:only}
attribute on assert
statements to temporarily transform other assertions into assumptions (https://github.com/dafny-lang/dafny/pull/3095)
Exposes the --output and --spill-translation options for the dafny test command (https://github.com/dafny-lang/dafny/pull/3612)
The dafny audit
command now reports instances of the {:concurrent}
attribute, intended to flag code that is intended, but can't be proven, to be safe for use in a concurrent setting. (https://github.com/dafny-lang/dafny/pull/3660)
Added option --no-verify for language server (https://github.com/dafny-lang/dafny/pull/3732)
Documenting Dafny Entities
.GetDocstring(DafnyOptions)
to every AST node--javadoclike-docstring-plugin
Documentation of the syntax for docstrings added to the reference manual (https://github.com/dafny-lang/dafny/pull/3773)
Labelled assertions and requires in functions (https://github.com/dafny-lang/dafny/pull/3804)
API support for obtaining the Dafny expression that is being checked by each assertion (https://github.com/dafny-lang/dafny/pull/3888)
Added a "Dafny Library" backend, which produces self-contained, pre-verified .doo
files ideal for distributing shared libraries.
.doo
files are produced with commands of the form dafny build -t:lib ...
.
(https://github.com/dafny-lang/dafny/pull/3913)
Semantic interpretation of dots in names for {:extern}
modules when compiling to Python (https://github.com/dafny-lang/dafny/pull/3919)
Code actions in editor to explicit failing assertions. In VSCode, place the cursor on a failing assertion that support being made explicit and either
Here is a initial list of assertions that can now be made explicit:
var x :| ...
statementvar x :| ...
statement
(https://github.com/dafny-lang/dafny/pull/3940)dafny test accepts a --methods-to-test option whose value is a regular expression selecting which tests to include in the test run (https://github.com/dafny-lang/dafny/pull/3221)
The deprecated attributes :dllimport, :handle, and :heapQuantifier are no longer recognized. (https://github.com/dafny-lang/dafny/pull/3398)
While using dafny translate --target=java
, the --include-runtime
option works as intended, while before it had no affect. (https://github.com/dafny-lang/dafny/pull/3611)
Tested support for paths with spaces in them (https://github.com/dafny-lang/dafny/pull/3683)
Crash related to the override check for generic functions (https://github.com/dafny-lang/dafny/pull/3692)
Opaque functions guaranteed to be opaque until revealed (https://github.com/dafny-lang/dafny/pull/3719)
Support for Corretto tests (https://github.com/dafny-lang/dafny/pull/3731)
Right shift on native byte has the same consistent semantics even in Java (https://github.com/dafny-lang/dafny/pull/3734)
Main and {:test} methods may now be in the same program (https://github.com/dafny-lang/dafny/pull/3744)
The formatter now produces the same output whether invoked on the command-line or from VSCode (https://github.com/dafny-lang/dafny/pull/3790)
The --solver-log option is now hidden from help unless --help-internal is used. (https://github.com/dafny-lang/dafny/pull/3798)
Highlight "inconclusive" as errors in the gutter icons (https://github.com/dafny-lang/dafny/pull/3821)
Docstring for functions with ensures (https://github.com/dafny-lang/dafny/pull/3840)
Prevent a compiler crash that could occur when a datatype constructor was defined that has multiple parameters with the same name. (https://github.com/dafny-lang/dafny/pull/3860)
Improved rules for nameonly parameters and parameter default-value expressions (https://github.com/dafny-lang/dafny/pull/3864)
Fixes several compilation issues, mostly related to subset types defined by one of its type parameter (https://github.com/dafny-lang/dafny/pull/3893)
Explicitly define inequality of multiset
s in Python for better backwards compatibility (https://github.com/dafny-lang/dafny/pull/3904)
Format for comprehension expressions (https://github.com/dafny-lang/dafny/pull/3912)
Formatting for parameter default values (https://github.com/dafny-lang/dafny/pull/3944)
Formatting issue in forall statement range (https://github.com/dafny-lang/dafny/pull/3960)
Select alternative default calc operator only if it doesn't clash with given step operators (https://github.com/dafny-lang/dafny/pull/3963)
Breaking changes Remove deprecated countVerificationErrors option (https://github.com/dafny-lang/dafny/issues/3165)
The default version of Z3 Dafny uses for verification is now 4.12.1. (https://github.com/dafny-lang/dafny/pull/3400)
The default values of several options has changed in Dafny 4.0. See --help for details.
--function-syntax changed from 3 to 4 --quantifier-syntax changed from 3 to 4 --unicode-char changed from false to true (https://github.com/dafny-lang/dafny/pull/3623) The default value of the /allocated option is now 4, and the option itself is deprecated. (https://github.com/dafny-lang/dafny/pull/3637)
Compilation to Go no longer attempts to use the Dafny string type and the Go string type interchangably when calling external methods (which was buggy and unsound). (https://github.com/dafny-lang/dafny/pull/3647)
/definiteAssignment:4
) in legacy CLI (https://github.com/dafny-lang/dafny/pull/3641)Fix translation of Dafny FunctionHandles to Boogie (https://github.com/dafny-lang/dafny/pull/2266)
To ensure that a class
correctly implements a trait
, we perform an override check. This check was previously faulty across module
s, but works unconditionally now. (https://github.com/dafny-lang/dafny/pull/3479)
Fixes to definite assignment and determinism options:
--enforce-determinism
now forbids constructor-less classesImplements error detail information and quick fixes:
opaque
is now a modifier, though still allowed, but deprecated as an identifier; it replaces the {:opaque}
attribute (https://github.com/dafny-lang/dafny/pull/3462)
The value of the --library option is allowed to be a comma-separated list of files or folders (https://github.com/dafny-lang/dafny/pull/3540)
Exclude verifier's type information for “new object” allocations (https://github.com/dafny-lang/dafny/pull/3450)
The Dafny scanner no longer treats lines beginning with # (even those in strings) as pragmas. (https://github.com/dafny-lang/dafny/pull/3452)
The attribute :heapQUantifier
is deprecated and will be removed in the future. (https://github.com/dafny-lang/dafny/pull/3456)
Fixed race conditions in the language server that made gutter icons behave abnormally (https://github.com/dafny-lang/dafny/pull/3502)
No more crash when hovering assertions that reference code written in other smaller files (https://github.com/dafny-lang/dafny/pull/3585)