Closed wrwg closed 2 months ago
Automatic type inference and conversion between bv and int type is not complete but we can express this property in an awkward way by using the builtin function bv2int
and int2bv
:
spec assert_with_spec {
aborts_if x > 815 with bv2int(int2bv(std::error::internal(0) as u64) | int2bv((0xCA26CBD9BE << 24) as u64));
}
Could there be a better error message which hints to use the conversion functions explicitly, then the errors on boogie level?
Could there be a better error message which hints to use the conversion functions explicitly, then the errors on boogie level?
Yes, it is possible but the fix would not be trivial because in some cases constants/variables/temporaries in an expression are automatically converted into a bv type so we need to know when and where we need to insert the conversion and then give hints to users. Will come back to this issue later.
Then I would still wonder whether in this case the automatic conversion just did not happen because the expression is part of an aborts-if. This is a rather obvious case where it should have triggered.
Drop the following into the prover functional test dir:
Boogie error: