Using frama-c I was working on code which uses a bit-field to represent a set. Say something like
typedef uint32_t myset_t;
#define EMPTY_SET UINT32_C(0)
#define FULL_SET UINT32_C(0x0ffffff)
so I'm using the n lowest bits of a 32-bit unsigned integer only. Then I wanted to implement a predicate for checking if a bit is set in the "myset_t". This did not work as expected (frama-c with alt-ergo capable of proving stuff about such sets) and I could produce the a simple lemma which already shows my problem. On my installation (frama-c 21.1 Scandium), it is not capable to automatically prove the following simple lemma:
lemma test:
\forall integer i;
(0U <= i < 16U) ==> (0xFFFFU & (1U << (unsigned int)i)) != 0U;
Is anyone able to explain to me what I'm doing wrong and where the problem is? Or are the theorem-provers not capable of getting these trivial arithmetic things right automatically (I mean it's just 16-cases, one could just enumerate them).
