--- layout: fc_discuss_archives title: Message 27 from Frama-C-discuss on February 2010 ---
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] possible bug in bitwise operators and jessie



Hello,

> I can't get any of the provers to prove the following:
>
> void function(){
> ? ?/*@ assert (3&1) == 1*/
> }
>
> Can anyone shed some light or is this a bug?

The automatic provers you have tried consider integers as abstract
entities on which one adds, substracts, multiplies (and perhaps only
sometimes divides, but that's really tricky). A prover that considered
integers as sequences of booleans would have no problem with your
assertion, but the slightest addition in the analyzed program would
become an equations system involving 96 variables instead of three.

If you intend to analyze a program that does only bitwise operations
on integers, consider solutions based on "bit blasting", for instance
the techniques and limitations described in
http://research.microsoft.com/pubs/80722/z3prefix.pdf (for what it's
worth, this link does not work in Safari).

Pascal