Enhanced Location Tracking #
This file defines a structured collection of memory locations for package validity tracking. Locations are tracked as a finite set with type information.
Main definitions #
Locations- A finite collection of typed memory locationsLocations.empty- Empty location setLocations.Separate- Two location sets with disjoint idsLocations.mem- Location membership
References #
Locations: a finite set of location ids with their type information. We track locations by their ids since type information is bundled in Location.
The set of location identifiers
- toLocation (id : ℕ) : id ∈ self.ids → Core.Location
Function mapping ids to their locations (partial)
Locations have consistent ids
Instances For
Empty location set
Equations
- CatCrypt.Package.Locations.empty = { ids := ∅, toLocation := fun (x : ℕ) (h : x ∈ ∅) => ⋯.elim, id_consistent := CatCrypt.Package.Locations.empty._proof_1 }
Instances For
@[implicit_reducible]
Equations
- CatCrypt.Package.Locations.instEmptyCollection = { emptyCollection := CatCrypt.Package.Locations.empty }
@[implicit_reducible]
A location is in the set if its id is in the id set
Equations
- CatCrypt.Package.Locations.instMembershipLocation = { mem := fun (L : CatCrypt.Package.Locations) (l : CatCrypt.Core.Location) => l.id ∈ L.ids }
@[implicit_reducible]
Equations
theorem
CatCrypt.Package.Locations.separate_symm
{L₁ L₂ : Locations}
(h : L₁.Separate L₂)
:
L₂.Separate L₁
Union of location sets (partial - should only be used with disjoint locations for well-definedness of the location mapping)
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
CatCrypt.Package.Locations.mem_union_left
{L₁ L₂ : Locations}
(h : L₁.Separate L₂)
(l : Core.Location)
:
theorem
CatCrypt.Package.Locations.mem_union_right
{L₁ L₂ : Locations}
(h : L₁.Separate L₂)
(l : Core.Location)
:
@[implicit_reducible]