Language
- A subset type or newtype now supports the following witness clauses:
witness Esays thatEis a compiled expression that is a value of the type- the absence of a witness defaults to
--witness 0for types based on integers or bitvectors,
--witness 0.0for real-based types,
--witness {}for set-based types,
-- etc. ghost witness Esays thatEis a ghost expression that is a value of the typewitness *opts out of witness checking; instead, the type is treated as being possibly empty
Type checking
- Improve type inference for imported modules.
Resolution
- Enforce give type-characteristics for type synonyms and opaque types.
Verification
- Add
/induction:4option and make it the default. This new mode applies automatic
induction to lemmas, but not to quantifiers. Use the{:induction}attribute to apply
automatic induction to individual quantifiers.
Compilation
-
Mature the support for
Mainmethods. Check that the main method is unique, allow{:main}
attribute, introduce/Maincommand-line switch. -
Make
/compileand/spillTargetCodecommand-line options work consistently for the
5 compilers: C#, JavaScript, Go, Java, C++. The/compileoption controls whether or not an
executable target is generated, and also controls whether or not to run the program upon
successful compilation.- Option
/compile:0generates no executable target. - Option
/compile:1generates an executable target that can be run. - Option
/compile:3compiles and runs the program, but doesn't generate an executable target unless necessary for running.
The
/spillTargetCodeoption controls whether or not textual target code is generated.
This can be useful if the Dafny program is to be manually compiled with handwritten code in the
target language.The test file
Test/comp/compile1quiet/CompileRunQuietly.dfyshows how to run the executable target
generated by Dafny.The test file
Test/comp/manualcompile/ManualCompile.dfyshows manual compiler calls that can be applied
to the textual target code generated. - Option
Documentation
- Improve Dafny Language Reference Manual.
Tool
- Retire
/ironDafnyand/dafnycccommand-line options.
Implementation
- Use .NET 5.0 version of Coco/R.