Changeset 1988 for src/Clight/test
- Timestamp:
- May 24, 2012, 11:39:27 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Clight/test/memorymodel.ma
r1875 r1988 20 20 access, preventing you reading back more information than the memory can 21 21 store. *) 22 definition store0 := empty becontentT.23 definition store1block : mem × Σb:block.? ≝ alloc ?store0 0 4 Any.22 definition store0 := empty. 23 definition store1block : mem × Σb:block.? ≝ alloc store0 0 4 Any. 24 24 definition store1 : mem ≝ fst ?? store1block. 25 25 definition block :block := pi1 … (snd ?? store1block). … … 51 51 (* NB: Double frees are allowed by the memory model (although not necessarily 52 52 by the language). *) 53 definition store4 := free ?store3 block.54 definition store5 : mem. letin r ≝ (free ?store3 block); whd in r; @r qed.53 definition store4 := free store3 block. 54 definition store5 : mem. letin r ≝ (free store3 block); whd in r; @r qed. 55 55 56 56 (* No ordering is imposed on deallocation (even though alloc and free are only used for 57 57 stack memory in the semantics. *) 58 definition storeA := empty becontentT.59 definition storeBblkB := alloc ?storeA 0 4 Any.60 definition storeCblkC := alloc ?(fst ?? storeBblkB) 0 8 Any.61 definition storeD := free ?(fst ?? storeCblkC) (snd ?? storeBblkB).62 definition storeE : mem. letin r ≝ (free ?storeD (snd ?? storeCblkC)).58 definition storeA := empty. 59 definition storeBblkB := alloc storeA 0 4 Any. 60 definition storeCblkC := alloc (fst ?? storeBblkB) 0 8 Any. 61 definition storeD := free (fst ?? storeCblkC) (snd ?? storeBblkB). 62 definition storeE : mem. letin r ≝ (free storeD (snd ?? storeCblkC)). 63 63 whd in r; @r qed. 64 64 … … 66 66 but can now split up integer values into bytes. The front-end interface 67 67 doesn't currently expose parts of pointers. *) 68 definition storeI := empty becontentT.69 definition storeIIblk := alloc ? storeA0 4 Any.68 definition storeI := empty. 69 definition storeIIblk := alloc storeI 0 4 Any. 70 70 definition storeIII : mem. 71 71 letin r ≝ (store (ASTint I32 Unsigned) (fst ?? storeIIblk) (mk_pointer Any (snd ?? storeIIblk) (same_compat …) zero_offset) (Vint I32 (repr ? 1)));
Note: See TracChangeset
for help on using the changeset viewer.