-
Notifications
You must be signed in to change notification settings - Fork 17
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
base: main
Are you sure you want to change the base?
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 |
No description provided.