Complete this form and hit the "Save Changes" button!
5 ratings
Are you sure you want to delete this code? Please type DELETE in the box below to confirm.
Are you sure you want to verify this code?
Are you sure you want to publish this code?
Are you sure you want to unpublish this code?
Are you sure you want to autogenerate the summary + description for this code?
xxxxxxxxxx
// RUN: %dafny /compile:0 "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
type Id(==)
function F(s: set<Id>): int
lemma Test(x: Id)
{
var X := {x};
var a := map i | i <= X :: F(i);
var b := map[{} := F({}), X := F(X)];
assert a.Keys == b.Keys by { // spurious error reported here
forall i
ensures i in a.Keys <==> i in b.Keys
calc {
i in a.Keys;
==
i <= X;
== { assert i <= X <==> i == {} || i == X; }
i in b.Keys;
}