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

Possible inflation of ownerships by alias #1

Open
aigarashi opened this issue Sep 18, 2021 · 0 comments
Open

Possible inflation of ownerships by alias #1

aigarashi opened this issue Sep 18, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@aigarashi
Copy link
Contributor

Found a bug in Consort. Consider the following program:

{
  let pa = mkref 0 in
  let pb = pa in
  {
     alias(pa = pa);
     pa := 1;
     assert(*pb = 0)
  }
}

The program is unsafe, but Consort returns "VERIFIED" (at least in my environment).
The problem is in the treatment of alias(pa=pa) mentioned above.
Consort generates the following constraint:

(assert (= ovar-4 1.0))
(assert (= (+ ovar-1 ovar-1) (+ ovar-3 ovar-4)))
...

where over-1 represents the ownership of pa before the alias statement and ovar-4 is that of pa after the statement.
This allows us to inflate the ownership of pa:
if ovar-1 is 0.5, then ovar-4 can be 1.0.
In this way, we can assign
0.5 to pb; and
1.0 to pa
after the alias statement.
We should actually generate the constraint like:

ovar-1 >= ovar-10 + ovar-11
ovar-10+ovar-11 >= ovar_3 + ovar_4

instead of

ovar-1+ovar-1 = ovar-3+ovar-4.

@aigarashi aigarashi added the bug Something isn't working label Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant