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

Penetrating by blocks #5779

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
d6f3951
Add proof by statement
keyboardDrummer Sep 16, 2024
84c7073
Merge remote-tracking branch 'origin/master' into penetratingByBlocks
keyboardDrummer Sep 16, 2024
a2f6b5c
Pass AssertMode to all Assert calls
keyboardDrummer Sep 16, 2024
313ad7e
Use free calls inside by blocks
keyboardDrummer Sep 20, 2024
174abf8
Move code from BoogieGenerator.TrStatement into separate files
keyboardDrummer Sep 20, 2024
5a2f37c
Use namespace directive
keyboardDrummer Sep 20, 2024
ae6f060
Start with removing pre and post call stuff
keyboardDrummer Sep 20, 2024
3cdae72
Finish pre/post call cleanup
keyboardDrummer Sep 20, 2024
9e7a558
Remove the proof field everywhere but in BlockByProof
keyboardDrummer Sep 20, 2024
2b17edc
Update parser
keyboardDrummer Sep 20, 2024
0774dc4
Fix a few bugs
keyboardDrummer Sep 20, 2024
1049866
More use of BodyTranslationContext.AssertMode
keyboardDrummer Sep 20, 2024
a8b2312
Improve printing
keyboardDrummer Sep 20, 2024
0391450
Rename of UpdateStmt
keyboardDrummer Sep 20, 2024
6b985cf
Add comments
keyboardDrummer Sep 20, 2024
fe456d3
Definite assignment tracking issue
keyboardDrummer Sep 21, 2024
5af6b22
Definite assignment tracker changed so it's never cleaned up
keyboardDrummer Sep 21, 2024
6e6d73d
Add substituter implementation
keyboardDrummer Sep 21, 2024
212cfbe
Prepare for using ordered dictionary for locals
keyboardDrummer Sep 23, 2024
da8787e
Introduce Variables class to track Boogie variables using an ordered …
keyboardDrummer Sep 23, 2024
185834a
CallBy.dfy works now
keyboardDrummer Sep 23, 2024
6f2dbf3
CallByHide.dfy passes
keyboardDrummer Sep 23, 2024
16f8ef7
Convert giant if to switch statement
keyboardDrummer Sep 23, 2024
5415a97
Fix
keyboardDrummer Sep 23, 2024
00e11e8
Merge remote-tracking branch 'origin/master' into penetratingByBlocks
keyboardDrummer Sep 23, 2024
10ee669
Ran formatter and def assignment improvement
keyboardDrummer Sep 23, 2024
2eea9e3
Move to symbols for mapping to tracking variables
keyboardDrummer Sep 24, 2024
6560fc2
Fixes
keyboardDrummer Sep 24, 2024
e9db4b9
More fixes
keyboardDrummer Sep 24, 2024
0830162
Fix formatter
keyboardDrummer Sep 24, 2024
35442d9
Merge commit 'ef13a72f3a9d3f' into penetratingByBlocks
keyboardDrummer Sep 24, 2024
d4ca466
Fix
keyboardDrummer Sep 24, 2024
4dfbd8b
Fix expect file
keyboardDrummer Sep 24, 2024
e8c409f
Undo Def as tracking changes
keyboardDrummer Sep 24, 2024
a078831
Fixes
keyboardDrummer Sep 24, 2024
e86fed8
Update expect file
keyboardDrummer Sep 24, 2024
67cdf7b
Update tests
keyboardDrummer Sep 24, 2024
054140b
Update tests
keyboardDrummer Sep 24, 2024
ae8d333
Use an immediately dictionary instead of adding and removing
keyboardDrummer Sep 24, 2024
a4796d2
Fix test generation
keyboardDrummer Sep 24, 2024
8ab5cb7
Refactoring
keyboardDrummer Sep 24, 2024
bdb02ae
Update test
keyboardDrummer Sep 24, 2024
2f189bb
Add test-case for assign such that
keyboardDrummer Sep 24, 2024
880fa30
Add tests
keyboardDrummer Sep 24, 2024
95a09a2
Add another test
keyboardDrummer Sep 24, 2024
13a25b3
Updates
keyboardDrummer Sep 25, 2024
46dc302
Fix SubsetTypes
keyboardDrummer Sep 25, 2024
946bdd6
Merge branch 'master' into penetratingByBlocks
keyboardDrummer Sep 25, 2024
f45a1a3
Remove todos
keyboardDrummer Oct 6, 2024
7cce358
Regenerated makefiles
keyboardDrummer Oct 6, 2024
d132f87
Merge remote-tracking branch 'origin/master' into penetratingByBlocks
keyboardDrummer Oct 6, 2024
f9c2fa3
Update doos
keyboardDrummer Oct 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Source/DafnyCore/AST/Grammar/Printer/Printer.Statement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public partial class Printer {
/// If the statement requires several lines, subsequent lines are indented at "indent".
/// No newline is printed after the statement.
/// </summary>
public void PrintStatement(Statement stmt, int indent) {
public void PrintStatement(Statement stmt, int indent, bool includeSemicolon = true) {
Contract.Requires(stmt != null);

if (stmt.IsGhost && printMode == PrintModes.NoGhostOrIncludes) {
Expand All @@ -50,7 +50,7 @@ public void PrintStatement(Statement stmt, int indent) {
}

if (stmt is PredicateStmt) {
PrintPredicateStmt(stmt);
PrintPredicateStmt(stmt, includeSemicolon);
} else if (stmt is PrintStmt) {
PrintStmt s = (PrintStmt)stmt;
wr.Write("print");
Expand Down Expand Up @@ -330,7 +330,7 @@ public void PrintStatement(Statement stmt, int indent) {
}

} else if (stmt is ConcreteAssignStatement) {
PrintConcreteUpdateStatement(stmt, indent);
PrintConcreteUpdateStatement(stmt, indent, includeSemicolon);
} else if (stmt is CallStmt) {
// Most calls are printed from their concrete syntax given in the input. However, recursive calls to
// prefix lemmas end up as CallStmt's by the end of resolution and they may need to be printed here.
Expand Down Expand Up @@ -361,7 +361,10 @@ public void PrintStatement(Statement stmt, int indent) {
wr.Write(" ");
PrintUpdateRHS(s.Assign, indent);
}
wr.Write(";");

if (includeSemicolon) {
wr.Write(";");
}
} else if (stmt is VarDeclPattern) {
var s = (VarDeclPattern)stmt;
if (s.tok is AutoGeneratedToken) {
Expand Down
10 changes: 1 addition & 9 deletions Source/DafnyCore/AST/Statements/BlockByProofStmt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,7 @@ internal static void ResolveByProof(INewOrOldResolver resolver, BlockStmt proof,
}

public void Render(TextWriter wr, Printer printer, int indent) {
if (Body is AssertStmt assertStmt) {
printer.PrintPredicateStmt(assertStmt, false);
} else if (Body is ConcreteAssignStatement updateStmt) {
printer.PrintConcreteUpdateStatement(updateStmt, indent, false);
} else if (Body is BlockStmt blockStmt) {
printer.PrintBlockStmt(blockStmt, indent);
} else {
throw new NotImplementedException();
}
printer.PrintStatement(Body, indent, false);
wr.Write(" by ");
printer.PrintBlockStmt(Proof, indent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static void EmitBoogie(BoogieGenerator generator, BlockByProofStmt block,
generator.CurrentIdGenerator.Pop();

generator.TrStmt(block.Body, proofBuilder, locals, etran);
//generator.RemoveDefiniteAssignmentTrackers(new [] { block.Body }, prevDefiniteAssignmentTrackerCount);
keyboardDrummer marked this conversation as resolved.
Show resolved Hide resolved
generator.PathAsideBlock(block.Tok, proofBuilder, builder);
generator.TrStmt(block.Body, builder.WithContext(builder.Context with {
AssertMode = AssertMode.Assume
Expand Down