-
Notifications
You must be signed in to change notification settings - Fork 19
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
Allow writing function contracts in webassembly code #407
Conversation
(module
(@contract $plus_three
(ensures (= result (+ (param 0) 3)))
)
(func $plus_three
(param $x i32) (result i32)
(i32.add (i32.const 3) (local.get $x)))
(func $f1)
(func $f2)
(func $start
(call $plus_three (i32.const 42))
drop)
(start $start)
) I'm expecting Upd: I mistook the use of |
Thanks! I think you can add something in |
Perfect! Could you add a small test with a |
One more thing I am thinking of, instead of requiring an assert function from the host in the concrete case, we could simply compile the code to |
Yes, but that depends on how we want our assert? Passing some meta-information of assertion (such as to which clause and contract it corresponds) may be useful, in E-ACSL they register 1. whether a failure of this assertion block the execution 2. the specification clause 3. the file name 4. the line number. For me I think showing the failing specification may be of help |
@Laplace-Demon, I wanted to merge this but it seems there's an issue with some tests from the custom-annotation proposal (see the logs in the CI). Do you want to have a look before I merge or do you prefer to fix it later? |
Yes, I think we've already discussed that during my internship and all the failed tests are due to error messages different from that of the reference interpreter. Since there are no false positives (and false negatives), I think it's okay to merge it for now. Though a fix does not amount to simply changing our error messages, but would probably require some structural change of our parser and lexer. |
Oh, OK sorry, I forget about that. But I remember now. I'm merging, thanks! :) |
No description provided.