Formal verification allows to find bugs in a program by systematically
exploring all its feasible executions.
I have used several formal verification tools during my PhD; since I feel there
is a lack of technical blog posts about this topic on the Web, I’ll try and
write some :)
This post deals with bounded model checking, specifically the CBMC tool and how
to combine it with the Glucose solver.
I believe this leads to a measurable increase in performance, at least when
checking unsafe programs.
Continue »Lately we needed to put a pair of small integers into a single int
variable.
(Let us gloss over the intricacies of what an int
actually is and just
assume it is 32-bit, shall we?)
Nothing crazy hard but still, it took some trial and error before we got it
right.
So, if anybody needs it or is just curious, here’s the code:
The code will test all possible tuples and quit if some unpacking gives an
unexpected result.
Continue »