Is it safe to use reads this
to say "depends on unspecified external state"?
#322
Labels
area: ffi
The {:extern} attribute and otherwise interfacing with code in other languages
kind: enhancement
Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny
In this example, Dafny fails to prove that
before == after
(and I think that's good).However, in the future, someone might come and suggest the following reasoning:
They will implement this by doing something like "if class has no fields, then remove all
reads this
clauses from its functions", make a PR, which passes all existing tests, it will get merged, and everyone will be happy about this Dafny improvement.However, in our project we're currently using extern classes which look very similar to the above pattern:
Assuming the person didn't think too hard about externs, the patch I described above will have the same effect as commenting out the
reads this
clause:But that's bad, because now we can prove false:
So my question is: Is it safe and future proof to specify extern classes like I did above?
The text was updated successfully, but these errors were encountered: