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

[Test Generation] Deprecate support for old command line interface #4385

Merged
merged 5 commits into from
Aug 9, 2023

Conversation

Dargones
Copy link
Collaborator

@Dargones Dargones commented Aug 4, 2023

This PR deprecates support for old command line interface in test generation. Test generation hardcodes some non-standard command-line-options ("predicates" type encoding, enforced determinism, disabled axiom pruning), which is much more easier to enforce via the new command line interface. This also removes quite a bit of code and makes test generation easier to maintain.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

Copy link
Member

@atomb atomb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's nice to see so much code removed!

dafnyOptions.CompilerName = "cs";
dafnyOptions.Compile = true;
dafnyOptions.RunAfterCompile = false;
dafnyOptions.ForceCompile = false;
dafnyOptions.DeprecationNoise = 0;
dafnyOptions.ForbidNondeterminism = true;
dafnyOptions.DefiniteAssignmentLevel = 2;
dafnyOptions.TypeEncodingMethod = CoreOptions.TypeEncoding.Predicates;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope it's possible eventually to use the same encoding as verification does, but this seems fine for now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will hope to revert this change. The one test failing on Windows with the arguments encoding is still a mystery to me as I wasn't able to reproduce it with Boogie alone... But I will try to dig deeper into that.

public static readonly Option<bool> DisablePrune = new("--no-prune",
"Disable axiom pruning that Dafny uses to speed up verification.") {
public static readonly Option<bool> ForcePrune = new("--force-prune",
"Enable axiom pruning that Dafny uses to speed up verification. This may negatively affect the quality of tests.") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a summary of why pruning negatively affects tests?

Copy link
Collaborator Author

@Dargones Dargones Aug 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It used to be the case that Boogie would not print the {:uses} attributes when saving an AST to file causing pruning to be way to aggressive if you then run Boogie on the same file. But I just discovered a recent PR to Boogie that might have fixed it. I will look into it and remove the --ForcePrune flag once the newer Boogie is merged if this is the case .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I'm glad that fix might help!

@atomb atomb enabled auto-merge (squash) August 9, 2023 15:26
@atomb atomb merged commit 195bb6e into dafny-lang:master Aug 9, 2023
18 checks passed
keyboardDrummer pushed a commit to keyboardDrummer/dafny that referenced this pull request Sep 15, 2023
…afny-lang#4385)

This PR deprecates support for old command line interface in test
generation. Test generation hardcodes some non-standard
command-line-options ("predicates" type encoding, enforced determinism,
disabled axiom pruning), which is much more easier to enforce via the
new command line interface. This also removes quite a bit of code and
makes test generation easier to maintain.

By submitting this pull request, I confirm that my contribution
is made under the terms of the MIT license.

---------

Co-authored-by: Aleksandr Fedchin <[email protected]>
keyboardDrummer pushed a commit that referenced this pull request Sep 19, 2023
…4385)

This PR deprecates support for old command line interface in test
generation. Test generation hardcodes some non-standard
command-line-options ("predicates" type encoding, enforced determinism,
disabled axiom pruning), which is much more easier to enforce via the
new command line interface. This also removes quite a bit of code and
makes test generation easier to maintain.

By submitting this pull request, I confirm that my contribution
is made under the terms of the MIT license.

---------

Co-authored-by: Aleksandr Fedchin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants