Module Senv.
Record t: Type := mksenv {
(** Operations *)
find_symbol: ident -> option block;
public_symbol: ident -> bool;
invert_symbol: block -> option ident;
block_is_volatile: block -> bool;
nextblock: block;
(** Properties *)
find_symbol_injective:
forall id1 id2 b, find_symbol id1 = Some b -> find_symbol id2 = Some b -> id1 = id2;
invert_find_symbol:
forall id b, invert_symbol b = Some id -> find_symbol id = Some b;
find_invert_symbol:
forall id b, find_symbol id = Some b -> invert_symbol b = Some id;
public_symbol_exists:
forall id, public_symbol id = true -> exists b, find_symbol id = Some b;
find_symbol_below:
forall id b, find_symbol id = Some b -> Plt b nextblock;
block_is_volatile_below:
forall b, block_is_volatile b = true -> Plt b nextblock
}.
Definition symbol_address (ge: t) (id: ident) (ofs: ptrofs) : val :=
match find_symbol ge id with
| Some b => Vptr b ofs
| None => Vundef
end.

Theorem shift_symbol_address:
forall ge id ofs delta,
symbol_address ge id (Ptrofs.add ofs delta) = Val.offset_ptr (symbol_address ge id ofs) delta.