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

hyperGobra: incorrect encoding of forall with --hyperMode=on #890

Open
henriman opened this issue Mar 14, 2025 · 0 comments
Open

hyperGobra: incorrect encoding of forall with --hyperMode=on #890

henriman opened this issue Mar 14, 2025 · 0 comments
Labels

Comments

@henriman
Copy link

henriman commented Mar 14, 2025

I am working on verifying SIF for the VerifiedSCION router (using hyperGobra) with @jcp19.

requires low(b)
func test1(b [2]int) {
    assert low(b[0])
    assert low(b[1])
    // Fails:
    assert forall i int :: { b[i] } 0 <= i && i < 2 ==> low(b[i])
}

Trying to verify the above code using --hyperMode=on fails in asserting the last assertion.

The problem: During the product-program construction, i is also duplicated (or: the duplicated i are not related to each other):

assert (forall i_V10: Int, i_V11: Int ::
    { unbox_Emb_2_Intint$$$$_E_$$$_Seq_Int(b_V0_CN00)[i_V10], unbox_Emb_2_Intint$$$$_E_$$$_Seq_Int(b_V0_CN01)[i_V11] }
    0 <= i_V10 && i_V10 < 2 && (0 <= i_V11 && i_V11 < 2) ==>
    unbox_Emb_2_Intint$$$$_E_$$$_Seq_Int(b_V0_CN00)[i_V10] ==
    unbox_Emb_2_Intint$$$$_E_$$$_Seq_Int(b_V0_CN01)[i_V11])

This could be fixed either by inserting i_V10 == i_V11 ==> after ==>, or by not duplicating i (which is not necessary to do, from my understanding).

Using --hyperMode=extended, the code verifies successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants