Frama-C-discuss mailing list archives

This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] Arithmetics in finite fields



Hello Boris,

Le lun. 01 f?vr. 2010 13:29:59 CET,
"Hollas Boris (CR/AEY1)" <Boris.Hollas at de.bosch.com> a ?crit :

> We have applications where we do arithmetics in GF(2^32). This is easily done with unsigned integers and the standard operations +, *. However, Jessie isn't able to verify arithmetic safety because it doesn't know that we want to compute in GF(2^32). For example, nothing bad can happen in this code
> 

You can tell Jessie to use modulo arithmetic (2^n where n depends on
the C type of the result) with a pragma:
#pragma JessieIntegerModel(modulo)

See section 7.4 of user manual for more information about the various
representations of C ints that can be used by Jessie.

In modulo mode, C int operations are treated as modulo operations, so
that you don't have proofs obligations related to overflows. Note
however that automated theorem provers are usually quite bad at dealing
with modulo arithmetic, so that you might experience some difficulties
proving your specifications.

Hope this helps,
-- 
E tutto per oggi, a la prossima volta.
Virgile