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

Map extensional equality sensitive to order #1387

Open
jaylorch opened this issue Jan 13, 2025 · 0 comments
Open

Map extensional equality sensitive to order #1387

jaylorch opened this issue Jan 13, 2025 · 0 comments
Assignees

Comments

@jaylorch
Copy link
Collaborator

jaylorch commented Jan 13, 2025

Map extensional equality is sensitive to the order of the arguments to =~=. For instance, this code doesn't work unless you put the arguments in a particular order:

proof fn test_map_extensional_equality_fails(m1: Map<int, int>, m2: Map<int, int>)
    requires
        forall|i: int| #![trigger m2.contains_key(i)]
            if m2.contains_key(i) { m1.contains_key(i) && m1[i] == m2[i] } else { !m1.contains_key(i) },
    ensures
        m1 == m2,
{
    assert(m1 =~= m2); // doesn't work
//    assert(m2 =~= m1); // they need to be in this order
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants