Allow successful verification with unimplemented code path #3746
-
Hi, We are working on integrating Kani in a project where we want to prove the equivalence between our implementation and a reference specification. We are interested in proving correctness, but not necessarily completeness. To provide more context, the project in question is a RISC-V firmware that exposes a virtual M-mode. We translated the official RISC-V specification from Sail to Rust so we have two RISC-V emulators: one from our project, and one extracted from the official spec. We use Kani to show that executing an instruction with both emulators result in the same state and thus that our RISC-V emulation is correct. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Hi @CharlyCst. Would it be possible to constrain the inputs to avoid the panic condition? Example: let input1 = kani::any();
let input2 = kani::any();
...
kani::assume(satisfies_implemented_subset(input1, input2, ...));
spec_function(input1, input2, ...);
impl_function(input1, input2, ...); where |
Beta Was this translation helpful? Give feedback.
A branch/execution path can be blocked using
kani::assume(false)
. So you can update the macro to be:One needs to be careful with
assume(false)
though because it may lead to vacuous proofs.