Replies: 1 comment
Inlining is the right default for Kani. Making stubbing the default would be unsound for the way this repo uses proofs. Kani is a bounded model checker. A
If stubbing were the default, a missing or weak contract on A split that works here:
Contract-first tools flip this default because their unit of proof is the contract, not a bounded unrolling of the body. I maintain Assura, which treats |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
We were wondering about Kani's default behaviour with respect to pre and postconditions.
In modular verification, when we encounter a function call, we would normally want to guarantee (assert) its precondition and assume its postcondition (e.g., if a function
f1()that we're verifying calls another functionf2()that has a contract, we would want to guaranteef2()'s preconditions just prior to the call, and assume its postconditions right after the call). This is currently possible in Kani via stubbing (#[kani::stub_verified(f2)]).What we were wondering in particular is whether, in the situation where we are calling
f2()fromf1()(wheref1()would be a#[kani::proof]for instance), it would be better for Kani to assert the preconditions and assume the postconditions off2(), as it currently would if we were stubbingf2(). It seems that the current default behaviour in the absence of a#[kani::stub_verified]is to symbolically executef2()(via inlining). We suspect that stubbing could be a better default behaviour (to leverage assume/guarantee reasoning and to support recursion), but are wondering what the thought process here is.Thanks!
All reactions