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

Broadcast not in scope during loop #1166

Open
jaylorch opened this issue Jun 18, 2024 · 1 comment
Open

Broadcast not in scope during loop #1166

jaylorch opened this issue Jun 18, 2024 · 1 comment
Assignees

Comments

@jaylorch
Copy link
Collaborator

The following code fails verification because the broadcast use is somehow not in scope during the loop.

pub spec fn map_contains_key_opaque<Key, Value>(m: Map<Key, Value>, k: Key) -> bool;

pub broadcast proof fn axiom_map_contains_key_opaque<Key, Value>(m: Map<Key, Value>, k: Key)
    ensures
        #[trigger] map_contains_key_opaque::<Key, Value>(m, k) <==> m.contains_key(k)
{
    admit();
}

fn test_axiom(m: Map<u64, u32>, k: u64)
    requires
        map_contains_key_opaque(m, k)
{
    broadcast use axiom_map_contains_key_opaque;
    for i in 0..10
        invariant
            map_contains_key_opaque(m, k)
    {
        assert(m.contains_key(k)) by {
//            broadcast use axiom_map_contains_key_opaque; // <== needs this to verify
        }
    }
}
@utaal
Copy link
Collaborator

utaal commented Jun 18, 2024

@Chris-Hawblitzel I can also take a look at this if you'd like.

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

3 participants