You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It might be helpful to use Nagini to specify pre- and post-conditions (as well as other useful annotations).
It enriches statically-typed Python3 subset (PEP-484, mypy) with constructs to specify pre-conditions (Requires) and post-conditions (Ensures), exceptional post-conditions (Exsures), as well as invariants, function purity (@Pure), assertions, predicates, etc.
It uses Boogie and Z3 as Dafny, though it's underlying logic is different. However, the idea is to use its extensions to annotate the py-spec with pre-/post-conditions and other useful annotations (like @Pure).
One option can be to design a contract library based on the ideas of the Nagini contract library (e.g. one can express Dafny annotations instead of Viper ones).
I'm worried that Nagini is not actively maintained. Since remerkleable has some complicated typing tricks, we may have some edge cases. (Sometimes, the issue is in mypy)
Issue
Pointed out by @franck44 and @protolambda, it would be more readable if we can more it clear of what are the preconditions of each function.
How to solve it
Add more detailed comments about the pre-conditions.
/cc @protolambda feel free to update this issue content. :)
The text was updated successfully, but these errors were encountered: