forked from dafny-lang/dafny
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Add missing triggers to Map#Card axioms in Boogie prelude (dafny…
…-lang#2417) Closes dafny-lang#2380. @atomb , can you show me how to run a performance regression run on this? I'm not sure how it will impact our customers. Co-authored-by: Mikaël Mayer <[email protected]>
- Loading branch information
1 parent
f7b9143
commit 72410e1
Showing
3 changed files
with
37 additions
and
3 deletions.
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// RUN: %dafny /compile:0 "%s" > "%t" | ||
// RUN: %diff "%s.expect" "%t" | ||
|
||
method M0(t: map<int, int>, k: int) | ||
requires k in t | ||
{ | ||
if * { | ||
assert |t| == |t - {k}| + 1; | ||
} else if * { | ||
assume t.Items == {(1, 2), (3, 4)}; | ||
assert |t| == 2; | ||
} else { | ||
assume t.Values == {2, 3, 4}; | ||
assert |t| >= 2; | ||
} | ||
} | ||
|
||
method M0'(t: map<int, int>, k: int) | ||
requires k in t | ||
{ | ||
if * { | ||
var _ := |(t - {k}).Keys|; | ||
assert |t| == |t - {k}| + 1; | ||
} else if * { | ||
assume t.Items == {(1, 2), (3, 4)}; | ||
var _ := |t.Items|; | ||
assert |t| == 2; | ||
} else { | ||
assume t.Values == {2, 3, 4}; | ||
assert |t.Values| >= 2; | ||
} | ||
} |
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 @@ | ||
|
||
Dafny program verifier finished with 2 verified, 0 errors |