Skip to content
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

Are verify and measure-complexity different? #5424

Closed
hmijail opened this issue May 12, 2024 · 6 comments
Closed

Are verify and measure-complexity different? #5424

hmijail opened this issue May 12, 2024 · 6 comments
Labels
kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny part: documentation Dafny's reference manual, tutorial, and other materials priority: not yet Will reconsider working on this when we're looking for work

Comments

@hmijail
Copy link

hmijail commented May 12, 2024

What change in documentation do you suggest?

Is there any fundamental difference between measure-complexity and verify?

Verify doesn't allow to set a random seed, which I guess means forces seed 0. Is there a reason?

Verify also doesn't have an --iterations argument. Both options can be brought to the verify command with --boogie options. Is that equivalent to measure-complexity?

I could just use measure-complexity with 1 iteration instead of verify, but then I can't use verify's new filter-symbol argument. But why is it not there to begin with?

It would be great to understand why the separation exists, to ensure I'm not doing something silly/risky by using them interchangeably.

@hmijail hmijail added the part: documentation Dafny's reference manual, tutorial, and other materials label May 12, 2024
@hmijail
Copy link
Author

hmijail commented May 13, 2024

Well, actually I see that dafny 4.6 seems to neuter the --boogie options, so using them to create my own faux-measure-complexity on top of verify as I did on 4.4 is no longer possible.

So maybe that's (part of?) the answer: until recently measure-complexity and verify were very similar but the plan is to diverge?

@stefan-aws
Copy link
Collaborator

@atomb

@stefan-aws stefan-aws added kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny priority: not yet Will reconsider working on this when we're looking for work labels May 13, 2024
@keyboardDrummer
Copy link
Member

There's different ways of preventing proof complexity. A simple one is to limit the maximum resources used by a proof. This option is available in dafny verify, using --resource-limit <resource-limit>.

A more complicated way of preventing proof complexity is to run multiple iterations and to compare the resources used by each iteration. I did not want to increase the scope of dafny verify by adding options related to this statistical technique, so I added a separate command, measure-complexity, for doing that. The scope of measure-complexity is not entirely clear. In the future it might even be implemented in a separate repository as a plugin for the Dafny CLI.

Also I think the default behavior of measure-complexity should be quite different from verify. For example,dafny verify returns a success exit code if everything verified in a single iteration. measure-complexity currently returns a success code if everything verified in each iteration, but I intend to change that so that it only returns a success exit code if the relative standard deviation of the resource count used is within a a certain bound.

@hmijail
Copy link
Author

hmijail commented May 13, 2024

Thank you for the explanation.

I mentioned --filter-symbol being available in verify but not in measure-complexity. It would be very useful in there too, to accelerate iterating. Will it be made available there too?
(Should I open a new issue?)

@keyboardDrummer
Copy link
Member

Thank you for the explanation.

I mentioned --filter-symbol being available in verify but not in measure-complexity. It would be very useful in there too, to accelerate iterating. Will it be made available there too? (Should I open a new issue?)

In nightly, these options are already available for measure-complexity

@hmijail
Copy link
Author

hmijail commented May 15, 2024

Thank you!

@hmijail hmijail closed this as completed May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny part: documentation Dafny's reference manual, tutorial, and other materials priority: not yet Will reconsider working on this when we're looking for work
Projects
None yet
Development

No branches or pull requests

3 participants