< extern /*@unused@*/ void bool_initMod (void) /*@modifies internalState@*/ ; --- > extern /*@unused@*/ void bool_initMod (void) > /*@globals internalState@*/ /*@modifies internalState@*/ ;
< # define bool_initMod() --- > # define bool_initMod() do { ; } while (FALSE)
< /*@globals initDone, undef db@*/ < /*@modifies initDone, db@*/ --- > /*@globals initDone, undef db, internalState@*/ > /*@modifies initDone, db, internalState@*/
< static eref db_ercKeyGet(erc c, int key) --- > static eref db_ercKeyGet(erc c, int key) /*@*/
< if (eref_get(er).ssNum == key) return (er); --- > if (eref_get(er).ssNum == key) > { > return (er); > }
< static eref db_keyGet (int key) --- > static eref db_keyGet (int key) /*@globals db@*/
< /*@modifies s@*/ --- > /*@globals internalState@*/ > /*@modifies s, internalState@*/
< db_status db_hire (employee e) --- > db_status db_hire (employee e) /*@globals db@*/
> {
> }
> {
> }
> {
> }
> {
> }
< /*@globals db@*/ --- > /*@globals db@*/ /*@modifies db@*/
> {
> {
> }
> {
> } > }
> {
> {
> }
> {
> } > }
< /*@globals db@*/ --- > /*@globals db@*/ /*@modifies db@*/
< /*@globals db@*/ --- > /*@globals db@*/ /*@modifies db@*/
>
> {
> } >
< db_status db_setSalary (int ssNum, int sal) --- > db_status db_setSalary (int ssNum, int sal) /*@globals db@*/
< bool db_fire (int ssNum) db d; --- > bool db_fire (int ssNum) db d; internalState;
< modifies d; --- > modifies d, internalState;
< int db_query (db_q q, empset s) db d; --- > int db_query (db_q q, empset s) db d; internalState;
< modifies s; --- > modifies s, internalState;
< void db_initMod(void) db d; --- > void db_initMod(void) db d; internalState;
< modifies d; --- > modifies d, internalState;
> /*@globals internalState@*/ /*@modifies internalState@*/
< if (i < 10) e.gen = MALE; else e.gen = FEMALE; < if (i < 15) e.j = NONMGR; else e.j = MGR; --- > > if (i < 10) > { > e.gen = MALE; > } > else > { > e.gen = FEMALE; > } > > if (i < 15) > { > e.j = NONMGR; > } > else > { > e.j = MGR; > } >
< if (i == maxEmployeeName) return FALSE; --- > if (i == maxEmployeeName) > { > return FALSE; > }
< void employee_initMod(void) --- > void employee_initMod(void) internalState;
< static eref empset_get (employee e, erc s) --- > static eref empset_get (employee e, erc s) /*@*/
>
> {
> }
> /*@globals internalState@*/ > /*@modifies internalState@*/
> {
> }
> {
> }
< if (!empset_member(emp, s2)) return FALSE; --- > if (!empset_member(emp, s2)) > { > return FALSE; > }
< | bool : void | empset_insert(empset s, employee e) --- > | bool : void | empset_insert (empset s, employee e) internalState;
< modifies s; --- > modifies s, internalState;
< void empset_insertUnique(empset s, employee e) --- > void empset_insertUnique (empset s, employee e) internalState;
< only empset empset_union(empset s1, empset s2) --- > only empset empset_union(empset s1, empset s2) internalState;
> modifies internalState;
< only empset empset_disjointUnion(empset s1, empset s2) --- > only empset empset_disjointUnion (empset s1, empset s2) internalState;
< void empset_intersect(empset s1, empset s2) --- > void empset_intersect (empset s1, empset s2) internalState;
< modifies s1; --- > modifies s1, internalState;
< void empset_initMod(void) --- > void empset_initMod (void) internalState;
>
< static size_t int_toSize (int x) --- > static size_t int_toSize (int x) /*@*/
< c = (erc) malloc (sizeof (ercInfo)); --- > c = (erc) malloc (sizeof (*c));
< if (eref_equal (tmpc->val, er)) return TRUE; --- > { > if (eref_equal (tmpc->val, er)) > { > return TRUE; > } > }
< newElem = (ercElem *) malloc (sizeof (ercElem)); --- > newElem = (ercElem *) malloc (sizeof (*newElem));
> {
> }
> /*@-exporttype@*/ /* These types should not be exported, but are used in macros. */
> /*@=exporttype@*/ >
< void erc_initMod(void) --- > void erc_initMod (void) internalState;
> typedef enum { ST_USED, ST_AVAIL } erefStatus; > typedef struct { > /*@reldef@*/ /*@only@*/ employee *conts; > /*@only@*/ erefStatus *status; > int size; > } erefTable; >
< for (i=0; (eref_Pool.status[i] == ST_USED) && (i < eref_Pool.size); i++); --- > for (i=0; (eref_Pool.status[i] == ST_USED) && (i < eref_Pool.size); i++) > { > ; > }
< 2 * eref_Pool.size * sizeof (employee)); --- > 2 * eref_Pool.size * sizeof (*eref_Pool.conts));
< 2 * eref_Pool.size * sizeof (erefStatus)); --- > 2 * eref_Pool.size * sizeof (*eref_Pool.status));
> {
> }
< /*@globals undef eref_Pool, needsInit@*/ < /*@modifies eref_Pool, needsInit@*/ --- > /*@globals undef eref_Pool, needsInit, internalState@*/ > /*@modifies eref_Pool, needsInit, internalState@*/
< eref_Pool.conts = (employee *) malloc (size * sizeof (employee)); --- > eref_Pool.conts = (employee *) malloc (size * sizeof (*eref_Pool.conts));
< eref_Pool.status = (erefStatus *) malloc (size * sizeof (erefStatus)); --- > eref_Pool.status = (erefStatus *) malloc (size * sizeof (*eref_Pool.status));
< /* Private typedefs used in macros */ < typedef enum { ST_USED, ST_AVAIL } erefStatus; < typedef struct { < /*@reldef@*/ /*@only@*/ employee *conts; < /*@only@*/ erefStatus *status; < int size; < } erefTable; <
< void eref_initMod(void) map m; --- > void eref_initMod(void) map m; internalState;
< modifies m; --- > modifies m, internalState;
< if (employee_equal(&e, &e1)) return er; --- > > if (employee_equal(&e, &e1)) > { > return er; > }
< void ereftab_initMod(void) --- > void ereftab_initMod (void) internalState;