I am trying to prove a simple statement using the frama-c WP plugin. C code was created from the Targetlink lookup table. My goal is to provide a sufficient number of function annotations so that I can use the resulting contract to prove the properties of the calling program. As a first step, I wrote a statement near the beginning of a function that compares a constant with a value obtained from dereferenced pointers, see the following example.
typedef struct MAP_Tab1DS0I2T3_b_tag { int Nx; const int * x_table; const int * z_table; } MAP_Tab1DS0I2T3_b; int LARA_GearEnaCndn_X[9] = { -1, 0, 1, 2, 3, 4, 5, 6, 8 }; int LARA_GearEnaCndn_Z[9] = { 1, 0, 1, 1, 0, 0, 0, 0, 0 }; MAP_Tab1DS0I2T3_b Sb218_LARA_GearEnaCndn_CUR_map = { 9, (const int *) &(LARA_GearEnaCndn_X[0]), (const int *) &(LARA_GearEnaCndn_Z[0]) }; int Tab1DS0I2T3_b(const MAP_Tab1DS0I2T3_b * map, int x) { int Aux_U8; int Aux_U8_a; int Aux_U8_b; int Aux_U8_c; const int * x_table ; const int * z_table ; x_table = map->x_table; z_table = map->z_table;
Can someone give me a hint what annotations do I need in order to succeed? From the look at the Coq proof commitment, I see that there are no axioms for operations like addr_of_data or access that I need to rewrite terms. There is also no information about the global variables referenced in the statement.
1 subgoals ______________________________________(1/1) forall x_0 map_0 : Z, is_sint32 x_0 -> forall m_0 : array data, x_0 = 2 -> forall x_table_0 : Z, x_table_0 = addr_of_data (access m_0 (addr_shift map_0 1)) -> 2 < sint32_of_data (access m_0 (addr_shift x_table_0 (as_sint32 (sint32_of_data (access m_0 (addr_shift map_0 0)) - 1))))
BR, Harald
source share