-
Notifications
You must be signed in to change notification settings - Fork 237
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
Decidable equality for ImmutableArray type? #2769
Comments
This does look like a reasonable property to assume. ImmutableArray is implemented as an OCaml array and comparing them in F* with If you did not want to use this as an axiom, you can use something like what's below to prove the correctness of your own structural comparison of immutable arrays.
That said, since FStar.ImmutableArray is a primitive F* type, adding your assumed lemmas as an axiom about this type is likely to be broadly useful and more convenient to use than the |
That would be great! I have two other issues related to ImmutableArray: 1. Positivity checking doesn't work the way I'd expect. noeq type test =
| Test : test
| Array : FStar.ImmutableArray.t test -> test This doesn't work. Until recently I was able to work around this with a mutually inductive type but apparently that was a bug. It used to work inconsistently in other cases as well. Is there a reason this doesn't pass the positivity checker? 2. Array members don't precede the array. I ended up making some additional assumptions about precedence. For example, if something precedes a list, Maybe it is possible to prove these properties without assumptions? Maybe the assumptions are incorrect? I can open separate issues for these if that would be better. |
Is there any reason why the new ImmutableArray type can't have decidable equality?
As a workaround, for now I am just making an assumption:
Is this safe and is there a better way of doing this?
I am using F* 2022.11.19~dev
The text was updated successfully, but these errors were encountered: