-
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 32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: LeanAuto CI | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
job0: | ||
name: LeanAuto CI | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '6.0.x' | ||
- name: Setup Z3 | ||
uses: cda-tum/setup-z3@v1 | ||
with: | ||
version: 4.12.5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Checkout Boogie | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install tools, build Boogie | ||
run: | | ||
dotnet tool restore | ||
dotnet build -warnaserror Source/Boogie.sln | ||
- name: Setup Lean | ||
uses: Julian/setup-lean@v1 | ||
with: | ||
# Lean version will be chosen based on Test/lean-auto/lean-toolchain | ||
default-toolchain-file: Test/lean-auto/lean-toolchain | ||
- name: Test Lean generator on textbook examples | ||
working-directory: Test/lean-auto | ||
run: | | ||
lake build | ||
./testall.sh |
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
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 |
---|---|---|
|
@@ -7,14 +7,13 @@ | |
using System.Threading; | ||
using System.Threading.Tasks; | ||
using VC; | ||
using BoogiePL = Microsoft.Boogie; | ||
using System.Runtime.Caching; | ||
using System.Diagnostics; | ||
using System.Reactive.Linq; | ||
using System.Reactive.Subjects; | ||
using System.Reactive.Threading.Tasks; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices.ComTypes; | ||
using Microsoft.Boogie.LeanAuto; | ||
using Microsoft.Boogie.VCExprAST; | ||
using VCGeneration; | ||
|
||
namespace Microsoft.Boogie | ||
|
@@ -554,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,10 +575,6 @@ public async Task<PipelineOutcome> InferAndVerify( | |
} | ||
|
||
var outcome = await VerifyEachImplementation(output, processedProgram, stats, programId, er, requestId, stablePrioritizedImpls); | ||
if (Options.PrintPassive) { | ||
Options.PrintUnstructured = 1; | ||
PrintBplFile(Options.PrintFile, processedProgram.Program, true, true, Options.PrettyPrint); | ||
} | ||
|
||
if (1 < Options.VerifySnapshots && programId != null) | ||
{ | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.lake | ||
lake-manifest.json |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Library</OutputType> | ||
<AssemblyName>Boogie.Provers.LeanAuto</AssemblyName> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\BaseTypes\BaseTypes.csproj" /> | ||
<ProjectReference Include="..\..\CodeContractsExtender\CodeContractsExtender.csproj" /> | ||
<ProjectReference Include="..\..\Core\Core.csproj" /> | ||
<ProjectReference Include="..\..\VCGeneration\VCGeneration.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="System.Linq.Async" Version="6.0.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedResource Include="Prelude.lean"> | ||
<LogicalName>Prelude.lean</LogicalName> | ||
</EmbeddedResource> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.
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.