-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --filter
option to dafny verify
#4816
Comments
I think that another alternative is |
I suggest not letting |
+1 |
Would also live a command-line option equivalent to "only" (suggestion: "--only" or --verify-only") |
Contrary to what I said before, I'll add a filter option that allows specifying both a file and line number, so when using
@seanmcl does that work for you as well? |
--filter
option to dafny verify
Fixes #4816 ### Description Add an option `--filter-position` to the `dafny verify` command, that allows verifying a single function or method, based on a file path and a line number. For example, `dafny verify dfyconfig.toml --filter-position=source1.dfy:5` will only verify something if it ranges over line 5 in the file `source1.dfy`. ### How has this been tested? Add a littish test `filter.dfy` <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
Summary
There should be an easy command
--filter
to which I can pass which files/lemmas I want to Dafny to verify.Background and Motivation
Before project files, people could run
dafny verify onefile.dfy
to only verify a subset of the project. With a project file, this is no longer possible if people have removedinclude
s from their files. Instead they have to use--boogie-filter
, which is less ergonomic and less documented. Related discussion in #4624.Proposed Feature
Add a command line option
dafny verify --filter
to restrict the set of files/lemmas that Dafny verifies. It might use--boogie-filter
under the hood, but provides a more ergonomic interface to the user and has good documentation.Alternatives
One alternative for users is not to use project files. But it would be a shame if the lack of such a feature deterred people from using project files.
For restricting verification to just one function, users can use the
{:only}
attribute (thanks @seebees for pointing this out!). But I'm not aware of an equivalent for restricting verification to just one file.The text was updated successfully, but these errors were encountered: