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

Pre-test of Dafny 4 #3466

Closed
wants to merge 281 commits into from
Closed

Conversation

davidcok
Copy link
Collaborator

@davidcok davidcok commented Feb 6, 2023

Fixes #3459

Changed the defaults for
--function-syntax to 4
--quantifier-syntax to 4
--unicode-char to true

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

davidcok added 30 commits August 23, 2022 20:57
Copy link
Member

@robin-aws robin-aws left a comment

Choose a reason for hiding this comment

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

Just got through Source for now, will tackle the rest separately.

Note that there will be other options changing defaults for 4.0, but those can be made after we fork the 4.x branch (which is where this PR will need to land once it's ready).

Source/DafnyCore/AST/Function.cs Outdated Show resolved Hide resolved
@@ -151,6 +151,7 @@ public class LitTests {
[FileTheory]
[FileData(Includes = new[] { "**/*.dfy", "**/*.transcript" },
Excludes = new[] { "**/Inputs/**/*", "**/Output/**/*",
"**/libraries/**",
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't be necessary now that dafny-lang/libraries#97 is merged if we update the submodule pointer, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, it seemed odd that the CI tests should run lit on the library when there is a library nightly that runs anyway. So it seems they ought to be excluded here.

Copy link
Member

Choose a reason for hiding this comment

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

The original intention of adding the submodule was to ensure Dafny changes didn't break that code, so it's not the same as relying on that code testing itself as it evolves. I'm not 100% sure that makes sense and we could consider dropping it (i.e. we're moving towards testing against nightly Dafny releases to catch such breakages instead), but not as part of the scope of this PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK - I'll push a commit that omits that exclusion.

Copy link
Member

@robin-aws robin-aws left a comment

Choose a reason for hiding this comment

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

Did at least a good spot check of all the test files and with the fixes I pushed to master already, they LGTM. Several nits but I think this is basically ready to merge with main-4.x once I create that.

Are there no other pieces of documentation that need to change for 4.0 as well, or were those already merged to master? We may need to relocate some so that we can still release 3.Last at the same time as 4.0.

Comment on lines +50 to +51
A _Named Type_ is used to specify a user-defined type by a (possibly module- or class-qualified) name.
Named types are introduced by
Copy link
Member

Choose a reason for hiding this comment

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

This isn't a Dafny 4.0 difference is it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No - just a clarification.

Source/DafnyCore/AST/Function.cs Outdated Show resolved Hide resolved
// RUN: ! %baredafny test %args --no-verify --target:go "%s" >> "%t"
// RUN: ! %baredafny test %args --no-verify --target:js "%s" >> "%t"
// RUN: ! %baredafny test %args --no-verify --target:py "%s" >> "%t"
// RUN: ! %baredafny test %args --unicode-char:false --no-verify --target:cs "%s" >> "%t"
Copy link
Member

Choose a reason for hiding this comment

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

Good change since #3608 adds a copy of this test that uses --unicode-char.

Comment on lines 1 to 4
This test is failing at the moment.
- It works locally
- It fails in CI
- I suspect it has something to do with dotnet test
Copy link
Member

Choose a reason for hiding this comment

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

Shoot, I should have deleted this file in my PR, will address separately

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll take it out in these changes.

Copy link
Member

Choose a reason for hiding this comment

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

Feel free, but it should be taken out in 3.X anyway

public FunctionSyntaxOptions FunctionSyntax = FunctionSyntaxOptions.Version3;
public QuantifierSyntaxOptions QuantifierSyntax = QuantifierSyntaxOptions.Version3;
public FunctionSyntaxOptions FunctionSyntax = FunctionSyntaxOptions.Version4;
public QuantifierSyntaxOptions QuantifierSyntax = QuantifierSyntaxOptions.Version4;
Copy link
Member

Choose a reason for hiding this comment

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

The new CLI option documentation still says "[default: Version3]" for me for some reason.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll investigate

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When I compile in this branch I get [default: 4]. But found some places in help text to change -- pushed those commits also.

@@ -0,0 +1,859 @@
*** MODEL
Copy link
Member

Choose a reason for hiding this comment

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

Accidental checkin?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't where this keeps coming from. I'll commit the removal.

Comment on lines 123 to 125
# Unlimited errors (instead of just 5)
#'errorLimit:0',

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Unlimited errors (instead of just 5)
#'errorLimit:0',
# Unlimited errors (instead of just 5)
#'errorLimit:0',

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Github won't take this suggestion. I'll add the newline manually. Actually there already is a blank line after.

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Unlimited errors (instead of just 5)
#'errorLimit:0',

Oops, I was actually trying to suggest removing commented out configuration. Or do you think it's helpful to leave this here for debugging?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK. I removed it. It was not there before.

@@ -153,7 +156,7 @@ def buildCmd(args):

dafny = addParams(buildCmd(dafnyArgs))

standardArguments = addParams(' '.join(newDafnyArgs))
standardArguments = addParams(' '.join([]))
Copy link
Member

Choose a reason for hiding this comment

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

Should these edits be in master as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll investigate (for a different PR)

@@ -103,8 +103,8 @@ Usage: dafny [ option ... ] [ filename ... ]
---- Language feature selection --------------------------------------------
Copy link
Member

Choose a reason for hiding this comment

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

We should end up with two other corresponding changes somehow too. We might want to more explicitly document what the default is for /functionSyntax and /quantifierSyntax in the legacy hooks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK. Options.txt is a generated file (that is then committed) -- only used in generating the pdf of the RefMan.

Copy link
Member

Choose a reason for hiding this comment

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

Yup I know, I was pointing out the fact that CI should have forced us to update it with changes for the other two options, which suggests that we didn't in fact update the /help output for them yet.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

And when I did I had a failure for not having updated the documentation sources...

Copy link
Member

@robin-aws robin-aws left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks so much for slogging through this. I pointed out a couple of things to clean up before merging but the actual content is good to go.

Only requesting changes because this needs to target the main-4.x branch you're cutting instead, ping me once that's changed and I'll actually approve.

Comment on lines 12 to 14
push:
branches:
[ cok-3459-dafny4test ]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
push:
branches:
[ cok-3459-dafny4test ]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed.

.github/workflows/msbuild.yml Outdated Show resolved Hide resolved
`predicate method`. Ghost functions are written `function` and
`predicate`.
4 - Compiled functions are written `function` and `predicate`. Ghost
4 (default) - Compiled functions are written `function` and `predicate`. Ghost
Copy link
Member

Choose a reason for hiding this comment

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

FYI I pushed a commit that does the same for /quantifierSyntax below as well

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK

@@ -186,19 +186,26 @@ To aid in explaining the grammar we have added some additional productions
that are not present in the original grammar. We name these with a trailing
underscore. Inlining these where they are referenced will reconstruct the original grammar.

### 17.2.1. Programs ([discussion](#sec-program)) {#g-program}
<!-- A note on formatting the sections below: LaTex renders the 'discussion' link in line with the heading for level-4 and higher headings.
Copy link
Member

Choose a reason for hiding this comment

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

Just flagging all these edits as relevant for master as well, but I can live with them only in main-4.x if too much of a pain to separate out.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll port them over to master separately

@robin-aws
Copy link
Member

One other thing, we need to update the various pull_request triggers in the GitHub Actions workflows to also trigger on main-* branches. It's probably simplest to do that here, and we might even back-port that change to master to further minimize differences.

@davidcok davidcok closed this Mar 8, 2023
@davidcok davidcok deleted the cok-3459-dafny4test branch March 8, 2023 21:32
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.

Check all tests with --function-syntax:4 as the default well before Dafny 4 release
6 participants