-
Notifications
You must be signed in to change notification settings - Fork 114
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 an experimental backend that uses Lean to discharge goals #850
Merged
Merged
Changes from 3 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
bf36ddf
Translator sufficient for Bubble.bpl to typecheck
atomb 8309d33
Now Bubble.bpl verifies after translation
atomb 4b2eb9e
Control Lean printing with an option
atomb 89b3595
Translator sufficient to verify all but one textbook example
atomb f6f8ff6
Reorganize unsupported overrides
atomb 637c415
Various improvements
atomb e4c34dc
Successfully process trivial Dafny program
atomb 2556b26
Cleanups
atomb 7049b6d
Update exception messages
atomb b2c5b14
Move prelude to external file
atomb d2193dd
Add configuration files to check Prelude.lean
atomb 7c096c0
Cleanup comments, strings, exceptions
atomb 7fea48d
Clean up error handling
atomb 05b616c
Reorder cases and improve error messages
atomb 005d80d
Add test suite for LeanAuto backend
atomb df6bb76
Add README for LeanAuto
atomb 6628fea
Add workflow to test the LeanAuto backend
atomb 300ed90
Fill in proofs and definitions in Lean prelude
atomb 359da35
Clean up lakefile
atomb 4fc941d
Fix Lean installation
atomb bf46f95
Change setup-lean action name
atomb 154fee4
Ensure Lean dependencies are actually built
atomb 9d58eb5
Pin the version of lean-auto for reproducibility
atomb 2896020
Merge remote-tracking branch 'upstream/master' into basic-lean-auto
atomb a2a40d6
Rename LeanGenerator -> LeanAutoGenerator
atomb 49e1eec
Rename some methods
atomb 2f8b3a9
Move use of passive program to a separate method
atomb fd7b4c9
Clarify comment
atomb dd8359f
Merge remote-tracking branch 'upstream/master' into basic-lean-auto
atomb dc6b667
Merge branch 'master' into basic-lean-auto
atomb 4cc7547
Generalized processing of passive programs
atomb 29979dc
Allow `goto` to have no targets
atomb fbafb12
Use `foreach` instead of `ForEach`
atomb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -553,6 +553,10 @@ public async Task<PipelineOutcome> InferAndVerify( | |
|
||
var processedProgram = PreProcessProgramVerification(program); | ||
|
||
if (Options.UseResolvedProgram.Any()) { | ||
Options.UseResolvedProgram.ForEach(action => action(Options, processedProgram)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would use a C# foreach construct here, but it's a bit of style thing. One advantage is that it's nicer to step through the iterations with a debugger. Another is that IDEs will be able to analyze it better. |
||
} | ||
|
||
if (!Options.Verify) | ||
{ | ||
return PipelineOutcome.Done; | ||
|
@@ -572,12 +576,6 @@ public async Task<PipelineOutcome> InferAndVerify( | |
|
||
var outcome = await VerifyEachImplementation(output, processedProgram, stats, programId, er, requestId, stablePrioritizedImpls); | ||
|
||
// We unfortunately have to do any processing of the passive program | ||
// after running VerifyEachImplementation, because it passifies the | ||
// program in place. We should eventually refactor the code to | ||
// passify the program as an independent step. | ||
UsePassiveProgram(processedProgram.Program); | ||
|
||
if (1 < Options.VerifySnapshots && programId != null) | ||
{ | ||
program.FreezeTopLevelDeclarations(); | ||
|
@@ -589,20 +587,6 @@ public async Task<PipelineOutcome> InferAndVerify( | |
return outcome; | ||
} | ||
|
||
private void UsePassiveProgram(Program passiveProgram) | ||
{ | ||
if (Options.PrintPassive) { | ||
Options.PrintUnstructured = 1; | ||
PrintBplFile(Options.PrintFile, passiveProgram, true, true, Options.PrettyPrint); | ||
} | ||
|
||
if (Options.LeanFile is not null) { | ||
var writer = new StreamWriter(Options.LeanFile); | ||
LeanAutoGenerator.EmitPassiveProgramAsLean(Options, passiveProgram, writer); | ||
writer.Close(); | ||
} | ||
} | ||
|
||
private ProcessedProgram PreProcessProgramVerification(Program program) | ||
{ | ||
// Doing lambda expansion before abstract interpretation means that the abstract interpreter | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could drop the
if
and always do the foreach.