- stage₁ : Bool
- map₁ : Lean.HashMap α β
- map₂ : Lean.PHashMap α β
Staged map for implementing the Environment. The idea is to store imported entries into a hashtable and local entries into a persistent hashtable.
Hypotheses:
- The number of entries (i.e., declarations) coming from imported files is much bigger than the number of entries in the current file.
- HashMap is faster than PersistentHashMap.
- When we are reading imported files, we have exclusive access to the map, and efficient destructive updates are performed.
Remarks:
- We never remove declarations from the Environment. In principle, we could support
deletion by using
(PHashMap α (Option β))
where the valuenone
would indicate that an entry was "removed" from the hashtable. - We do not need additional bookkeeping for extracting the local entries.