Skip to content

Commit

Permalink
Add fix, test and release note for 6024
Browse files Browse the repository at this point in the history
  • Loading branch information
keyboardDrummer committed Jan 8, 2025
1 parent 4ecc4bf commit 029236f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
9 changes: 3 additions & 6 deletions Source/DafnyCore/Dafny.atg
Original file line number Diff line number Diff line change
Expand Up @@ -2391,19 +2391,16 @@ AssignStatement<out Statement/*!*/ s>
s = new AssignSuchThatStmt(rangeToken, lhss, suchThat, suchThatAssume, null);
} else if (exceptionRhs != null) {
s = new AssignOrReturnStmt(rangeToken, lhss, exceptionRhs, keywordToken, rhss);
if (proof != null) {
s = new BlockByProofStmt(rangeToken, proof, s);
}
} else {
if (lhss.Count == 0 && rhss.Count == 0) {
s = new BlockStmt(rangeToken, new List<Statement>()); // error, give empty statement
} else {
s = new AssignStatement(rangeToken, lhss, rhss);
if (proof != null) {
s = new BlockByProofStmt(rangeToken, proof, s);
}
}
}
if (proof != null) {
s = new BlockByProofStmt(rangeToken, proof, s);
}
.)
.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,12 @@ method ByClause(b: bool) {
var r: int :| false by {
assume {:axiom} false;
}
}

function F(x: int): int
method ByClauseSeparateAssignment() {
var a;
a :| F(a) == 2 by {
assume {:axiom} F(10) == 2;
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

Dafny program verifier finished with 1 verified, 0 errors
Dafny program verifier finished with 2 verified, 0 errors
1 change: 1 addition & 0 deletions docs/dev/news/6024.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
By clauses for assign-such-that statements (:|), are now never ignored.

0 comments on commit 029236f

Please sign in to comment.