Ignore:
Timestamp:
May 24, 2012, 11:39:27 AM (6 years ago)
Author:
campbell
Message:

Abstraction of the memory contents in the memory models is no longer
necessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Clight/test/memorymodel.ma

    r1875 r1988  
    2020   access, preventing you reading back more information than the memory can
    2121   store. *)
    22 definition store0 := empty becontentT.
    23 definition store1block : mem × Σb:block.? ≝ alloc ? store0 0 4 Any.
     22definition store0 := empty.
     23definition store1block : mem × Σb:block.? ≝ alloc store0 0 4 Any.
    2424definition store1 : mem ≝ fst ?? store1block.
    2525definition block :block := pi1 … (snd ?? store1block).
     
    5151(* NB: Double frees are allowed by the memory model (although not necessarily
    5252       by the language). *)
    53 definition store4 := free ? store3 block.
    54 definition store5 : mem. letin r ≝ (free ? store3 block); whd in r; @r qed.
     53definition store4 := free store3 block.
     54definition store5 : mem. letin r ≝ (free store3 block); whd in r; @r qed.
    5555
    5656(* No ordering is imposed on deallocation (even though alloc and free are only used for
    5757   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)).
     58definition storeA := empty.
     59definition storeBblkB := alloc storeA 0 4 Any.
     60definition storeCblkC := alloc (fst ?? storeBblkB) 0 8 Any.
     61definition storeD := free (fst ?? storeCblkC) (snd ?? storeBblkB).
     62definition storeE : mem. letin r ≝ (free storeD (snd ?? storeCblkC)).
    6363whd in r; @r qed.
    6464
     
    6666   but can now split up integer values into bytes.  The front-end interface
    6767   doesn't currently expose parts of pointers. *)
    68 definition storeI := empty becontentT.
    69 definition storeIIblk := alloc ? storeA 0 4 Any.
     68definition storeI := empty.
     69definition storeIIblk := alloc storeI 0 4 Any.
    7070definition storeIII : mem.
    7171 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.