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

feat: Implement frame-related asserted exprs and TraitDecreases #5542

Merged
merged 10 commits into from
Jun 7, 2024
Prev Previous commit
Next Next commit
fix MakeDafnyMultiFrameCheck with empty subsetFrames
  • Loading branch information
alex-chew committed Jun 7, 2024
commit 8e44ac9871ed5e4c1b31582da27e5950d118fcfa
3 changes: 3 additions & 0 deletions Source/DafnyCore/Verifier/ProofObligationDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1890,6 +1890,9 @@ internal class Utils {
/// permit read/modification access to all objects, arrays, and/or sets of objects/arrays in the `subsetFrames`.
/// </summary>
public static Expression MakeDafnyMultiFrameCheck(List<FrameExpression> supersetFrames, List<FrameExpression> subsetFrames) {
Copy link
Member

Choose a reason for hiding this comment

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

The detail required in methods like these make me very much want to share this code with the Boogie translation eventually (i.e., have the Boogie generator work by constructing this expression and then translating it). But that's a task for another day.

if (subsetFrames.Count == 0) {
return null;
}
return subsetFrames
.Select(target => MakeDafnyFrameCheck(supersetFrames, target.E, target.Field))
.Aggregate((e0, e1) => new BinaryExpr(Token.NoToken, BinaryExpr.Opcode.And, e0, e1));
Expand Down
Loading