The allocation-local state layout from Miri's tree_borrows/tree.rs:
tag-to-index map, indexed nodes, per-range location data, and ordered roots.
The first constructor is the exact Tree::new root state. Diagnostic-only
node history is intentionally omitted. Child insertion and access traversal
are separate operations.
Per-node information consumed by tree traversal and permission defaults.
The source's NodeDebugInfo name is retained because miri_pointer_name and
miri_print_borrow_state expose it. Access history is diagnostic-only and is
not needed to print the current tree.
- tag : Memory.BorTag
- defaultInitialPermission : Permission
- defaultInitialSifa : IdempotentForeignAccess
- isExposed : Bool
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- node.defaultLocationState = { permission := node.defaultInitialPermission, accessed := false, idempotentForeignAccess := node.defaultInitialSifa }
Instances For
Willard-cache counters for one node at one homogeneous byte range.
Counters keep the source's u16 width.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- LocalAccess : WildcardAccessRelatedness
- ForeignAccess : WildcardAccessRelatedness
- EitherAccess : WildcardAccessRelatedness
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- MissingNode (index : UniIndex) : ExposedCacheError
- InvalidIndex (index : Nat) : ExposedCacheError
- ParentCycle (index : UniIndex) : ExposedCacheError
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Miri.TreeBorrows.instDecidableEqExposedCacheError.decEq (Miri.TreeBorrows.ExposedCacheError.MissingNode index) (Miri.TreeBorrows.ExposedCacheError.InvalidIndex index_1) = isFalse ⋯
- Miri.TreeBorrows.instDecidableEqExposedCacheError.decEq (Miri.TreeBorrows.ExposedCacheError.MissingNode index) (Miri.TreeBorrows.ExposedCacheError.ParentCycle index_1) = isFalse ⋯
- Miri.TreeBorrows.instDecidableEqExposedCacheError.decEq (Miri.TreeBorrows.ExposedCacheError.InvalidIndex index) (Miri.TreeBorrows.ExposedCacheError.MissingNode index_1) = isFalse ⋯
- Miri.TreeBorrows.instDecidableEqExposedCacheError.decEq (Miri.TreeBorrows.ExposedCacheError.InvalidIndex index) (Miri.TreeBorrows.ExposedCacheError.ParentCycle index_1) = isFalse ⋯
- Miri.TreeBorrows.instDecidableEqExposedCacheError.decEq (Miri.TreeBorrows.ExposedCacheError.ParentCycle index) (Miri.TreeBorrows.ExposedCacheError.MissingNode index_1) = isFalse ⋯
- Miri.TreeBorrows.instDecidableEqExposedCacheError.decEq (Miri.TreeBorrows.ExposedCacheError.ParentCycle index) (Miri.TreeBorrows.ExposedCacheError.InvalidIndex index_1) = isFalse ⋯
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
- cache : ExposedCache
- outcome : Except ExposedCacheError Unit
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source ExposedCache::update_exposure: update the node's counters and
propagate the same exposure delta through each ancestor. On malformed node
indices/cycles, preserve all earlier counter mutations in the returned cache.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
The source's LocationTree: lazily stored permission state and one
exposed-node cache per homogeneous range.
- perms : UniValMap Tree.LocationState
- exposedCache : ExposedCache
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
Allocation-local tree state. roots begins with the allocation's unique
root and may later contain ordered wildcard roots.
- tagMapping : UniKeyMap Memory.BorTag
- locations : DataStructures.DedupRangeMap LocationTree
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
- missingTag (tag : Memory.BorTag) : DebugNameError
- missingNode (index : UniIndex) : DebugNameError
- missingParent (tag : Memory.BorTag) (distance : Nat) : DebugNameError
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Miri.TreeBorrows.instDecidableEqDebugNameError.decEq (Miri.TreeBorrows.DebugNameError.missingTag tag) (Miri.TreeBorrows.DebugNameError.missingNode index) = isFalse ⋯
- Miri.TreeBorrows.instDecidableEqDebugNameError.decEq (Miri.TreeBorrows.DebugNameError.missingTag tag) (Miri.TreeBorrows.DebugNameError.missingParent tag_1 distance) = isFalse ⋯
- Miri.TreeBorrows.instDecidableEqDebugNameError.decEq (Miri.TreeBorrows.DebugNameError.missingNode index) (Miri.TreeBorrows.DebugNameError.missingTag tag) = isFalse ⋯
- Miri.TreeBorrows.instDecidableEqDebugNameError.decEq (Miri.TreeBorrows.DebugNameError.missingNode index) (Miri.TreeBorrows.DebugNameError.missingParent tag distance) = isFalse ⋯
- Miri.TreeBorrows.instDecidableEqDebugNameError.decEq (Miri.TreeBorrows.DebugNameError.missingParent tag distance) (Miri.TreeBorrows.DebugNameError.missingTag tag_1) = isFalse ⋯
- Miri.TreeBorrows.instDecidableEqDebugNameError.decEq (Miri.TreeBorrows.DebugNameError.missingParent tag distance) (Miri.TreeBorrows.DebugNameError.missingNode index) = isFalse ⋯
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source Tree::nth_parent, with malformed/exhausted ancestry retained as a
checked machine error by diagnostic callers instead of an unchecked unwrap.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source NodeDebugInfo::add_name: several names for one tag are joined
with ", " in their insertion order.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source Tree::give_pointer_debug_name, including ancestor selection.
Equations
- tree.givePointerDebugName tag distance name = do let ancestor ← tree.nthParent tag distance tree.addDebugName ancestor name
Instances For
Source Tree::new: disabled default at out-of-bounds/uninitialized
locations, one non-exposed root, and an accessed Unique permission throughout
the allocation's in-bounds bytes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- tree.indexOfTag tag = tree.tagMapping.get tag
Instances For
Instances For
Current or lazily initialized per-location state for a node.
Equations
- tree.locationStateAt location idx = do let node ← tree.nodeAt idx pure ((location.perms.get idx).getD node.defaultLocationState)
Instances For
- location : LocationTree
- access : Tree.NormalAccessResult
- outcome : Except ExposedCacheError Unit
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- MissingTag (tag : Memory.BorTag) : TreeMutationError
- MissingNode (index : UniIndex) : TreeMutationError
- ExposedCache (error : ExposedCacheError) : TreeMutationError
- RangeMap (error : DataStructures.DedupRangeMapError) : TreeMutationError
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- tree : BorrowTree
- outcome : Except TreeMutationError Unit
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- DuplicateTag (tag : Memory.BorTag) : ChildInsertError
- TagIndexExhausted (active : Nat) : ChildInsertError
- MissingParentTag (tag : Memory.BorTag) : ChildInsertError
- OutsidePermissionNotInitial (permission : Permission) : ChildInsertError
- OutsideUniquePermission : ChildInsertError
- ProtectedReservedIM : ChildInsertError
- InsidePermissionNotInitial (permission : Permission) : ChildInsertError
- InsideSifaMismatch (permission : Permission) : ChildInsertError
- InsidePermissionInvariant (permission : Permission) : ChildInsertError
- SizeError (error : ABI.SizeError) : ChildInsertError
- RangeMapError (error : DataStructures.DedupRangeMapError) : ChildInsertError
- MissingNode (index : UniIndex) : ChildInsertError
- ParentCycle (index : UniIndex) : ChildInsertError
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- tree : BorrowTree
- outcome : Except ChildInsertError Unit
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- MissingNode (index : UniIndex) : TreeGcError
- MissingChildPosition (parent : UniIndex) (position : Nat) : TreeGcError
- MissingReplacementChild (index : UniIndex) : TreeGcError
- EmptyTraversalStack (root : UniIndex) : TreeGcError
- ParentCycle (root : UniIndex) : TreeGcError
- RangeMerge (error : DataStructures.DedupRangeMapError) : TreeGcError
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Miri.TreeBorrows.BorrowTree.instDecidableEqTreeGcError.decEq (Miri.TreeBorrows.BorrowTree.TreeGcError.MissingNode index) (Miri.TreeBorrows.BorrowTree.TreeGcError.ParentCycle root) = isFalse ⋯
- Miri.TreeBorrows.BorrowTree.instDecidableEqTreeGcError.decEq (Miri.TreeBorrows.BorrowTree.TreeGcError.MissingNode index) (Miri.TreeBorrows.BorrowTree.TreeGcError.RangeMerge error) = isFalse ⋯
- Miri.TreeBorrows.BorrowTree.instDecidableEqTreeGcError.decEq (Miri.TreeBorrows.BorrowTree.TreeGcError.ParentCycle root) (Miri.TreeBorrows.BorrowTree.TreeGcError.MissingNode index) = isFalse ⋯
- Miri.TreeBorrows.BorrowTree.instDecidableEqTreeGcError.decEq (Miri.TreeBorrows.BorrowTree.TreeGcError.ParentCycle root) (Miri.TreeBorrows.BorrowTree.TreeGcError.RangeMerge error) = isFalse ⋯
- Miri.TreeBorrows.BorrowTree.instDecidableEqTreeGcError.decEq (Miri.TreeBorrows.BorrowTree.TreeGcError.RangeMerge error) (Miri.TreeBorrows.BorrowTree.TreeGcError.MissingNode index) = isFalse ⋯
- Miri.TreeBorrows.BorrowTree.instDecidableEqTreeGcError.decEq (Miri.TreeBorrows.BorrowTree.TreeGcError.RangeMerge error) (Miri.TreeBorrows.BorrowTree.TreeGcError.ParentCycle root) = isFalse ⋯
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- tree : BorrowTree
- outcome : Except TreeGcError Unit
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- Completed : WildcardAccessStatus
- EmptyTraversalStack (root : UniIndex) : WildcardAccessStatus
- NoValidExposedReferences (root : UniIndex) (node : Option UniIndex) : WildcardAccessStatus
- MissingNode (index : UniIndex) : WildcardAccessStatus
- RecordDebugAssertion (index : UniIndex) : WildcardAccessStatus
- TransitionError (index : UniIndex) (error : Diagnostics.TransitionError) : WildcardAccessStatus
- CacheFailure (error : ExposedCacheError) : WildcardAccessStatus
- PermissionInvariantFailure (index : UniIndex) : WildcardAccessStatus
- TransitionApplicationInvariantFailure (index : UniIndex) : WildcardAccessStatus
- PossibleInvariantFailure (index : UniIndex) : WildcardAccessStatus
- ParentCycle (root : UniIndex) : WildcardAccessStatus
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- location : LocationTree
- status : WildcardAccessStatus
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source LocationTree::perform_wildcard_access. The stack implements the
source visitor's child-first, postorder traversal. Relatedness and SIFA skip
decisions are recomputed against the cache as child transitions change it.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Perform the source normal-tree component at one actual tree location.
Permission transitions are delegated to NormalTreeState; this operation
projects the source UniValMap topology and lazy defaults, writes state back
to the real maps, and applies exposed-cache deltas in visit order. Additional
wildcard roots are handled by the separate wildcard-access component.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source Tree::expose_tag, including the per-range Willard-cache update.
The global protected-tag table determines which local accesses remain valid
through this exposed tag.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source update_exposure_for_protector_release: exposed nodes retain their
exposure, while the cache counters change from protected to unprotected local
permission strength.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source Tree::new_child: allocate the tag index, attach a concrete child
or ordered wildcard root, store lazy defaults, materialize inside-range
permissions, and weaken ancestor SIFAs until the retag invariant is restored.
Mutation and invariant failures retain earlier source-ordered state changes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Tags reported by source VisitProvenance for Tree: all roots and every
exposed node whose provenance may still permit an access.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source Tree::remove_unreachable_tags: process each ordered root with
postorder leaf removal and safe single-child collapse, then thoroughly merge
adjacent equal location ranges.
Equations
- One or more equations did not get rendered due to their size.
Instances For
- range : DataStructures.ByteRange
- normalAccess : Option Tree.NormalAccessResult
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- Completed : BorrowTreeAccessStatus
- MissingTag (tag : Memory.BorTag) : BorrowTreeAccessStatus
- MultipleRoots (count : Nat) : BorrowTreeAccessStatus
- RangeMapFailure (error : DataStructures.DedupRangeMapError) : BorrowTreeAccessStatus
- LocationMapFailure (range : DataStructures.ByteRange) (error : DataStructures.DedupRangeMapError) : BorrowTreeAccessStatus
- CacheFailure (range : DataStructures.ByteRange) (error : ExposedCacheError) : BorrowTreeAccessStatus
- AccessFailure (range : DataStructures.ByteRange) (status : Tree.NormalAccessStatus) : BorrowTreeAccessStatus
- WildcardFailure (range : DataStructures.ByteRange) (status : WildcardAccessStatus) : BorrowTreeAccessStatus
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- tree : BorrowTree
- locations : Array BorrowTreeLocationResult
- status : BorrowTreeAccessStatus
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- Deallocated : BorrowTreeDeallocStatus
- AccessFailure (status : BorrowTreeAccessStatus) : BorrowTreeDeallocStatus
- MultipleRoots (count : Nat) : BorrowTreeDeallocStatus
- MissingTag (tag : Memory.BorTag) : BorrowTreeDeallocStatus
- RangeMapFailure (error : DataStructures.DedupRangeMapError) : BorrowTreeDeallocStatus
- ProtectedDealloc (range : DataStructures.ByteRange) (node : UniIndex) : BorrowTreeDeallocStatus
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- tree : BorrowTree
- status : BorrowTreeDeallocStatus
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Ranged access for concrete or wildcard provenance. Tree state and Willard-cache updates are threaded across homogeneous range segments and all ordered roots.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Concrete-tag convenience wrapper over the full source-root access path.
Equations
- tree.performNormalAccessRange tag offset length kind protectedTags mode = tree.performBorrowAccessRange (Miri.Memory.ProvenanceExtra.concrete tag) offset length kind protectedTags mode
Instances For
- Released : ProtectorReleaseStatus
- MissingTag (tag : Memory.BorTag) : ProtectorReleaseStatus
- RangeMapFailure (error : DataStructures.DedupRangeMapError) : ProtectorReleaseStatus
- LocationMapFailure (error : DataStructures.DedupRangeMapError) : ProtectorReleaseStatus
- AccessFailure (range : DataStructures.ByteRange) (status : BorrowTreeAccessStatus) : ProtectorReleaseStatus
- ExposureUpdateFailure (error : TreeMutationError) : ProtectorReleaseStatus
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- tree : BorrowTree
- status : ProtectorReleaseStatus
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source Tree::perform_protector_end_access followed by update_exposure_for_protector_release. The tag remains protected during its implicit accessed-location read/write, and the caller removes the global protector only after this operation succeeds.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source Tree::dealloc for a single concrete root: first perform the write
through the supplied tag, then inspect visited nodes in source tree-visitor
order for accessed strong protectors. Cell permissions are exempt. Weak
protectors are handled by the initial write transition itself.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Concrete-tag convenience wrapper for source Tree::dealloc.
Equations
- tree.deallocateRange tag offset length protectedTags = tree.deallocateBorrowRange (Miri.Memory.ProvenanceExtra.concrete tag) offset length protectedTags
Instances For
Zero-byte protected child construction from finite graph and allocator invariants. These proof-only declarations do not change the interpreter. The rank and loop lemmas are adapted from PR35/38 generic Tree Borrows proofs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A source while-loop invariant with a well-founded data measure.
Instances For
Changing non-parent node metadata preserves the real exposed-cache ancestor certificate and its depth function.
Equations
- Miri.TreeBorrows.BorrowTree.ZeroProtection.update_depth nodes depth index old next present sameParent = { depth := depth.depth, bounded := ⋯, parent := ⋯ }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
The append-index branch of the actual newChild node insertion. Existing node data and parent depth are arbitrary; free-index reuse is a separate case.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The second source-ordered node insertion in newChild attaches the new index to its parent's children, without changing either node's parent link.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
The real ancestor-SIFA stage invoked by newChild succeeds after its two actual node insertions. The new index and original parent's presence are data conditions; no successful child insertion or SIFA update is a premise.
Extending a sparse location map with absent entries preserves every lookup, including queries beyond both its old and new extents.
Inserting the new child state preserves every other node's state even when the per-location sparse array has a different length from the node table.
Insertion at a bounded sparse slot retains the table length. Vacancy is a separate caller condition: this operation itself also permits overwriting.
A bounded vacant slot can hold a fresh child. The explicit rank slack ensures the child's parent-rank-plus-one fits without enlarging the table. Every old parent edge remains valid; none can point to the vacant slot.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Both source node insertions preserve the depth certificate on a reusable slot. No absence of per-location permissions is inferred from node vacancy.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Both concrete allocation branches of a zero-byte protected child complete from raw parent, allocator and acyclic-graph facts.
Equations
Instances For
Equations
Instances For
Equations
- Miri.TreeBorrows.BorrowTree.ZeroProtection.View.stateShape state = (state.permission, state.accessed)
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Even an error result changes no tag/topology/permission/accessed data in this SIFA-only stage. This metadata fact is not an assertion of safe execution.
Sparse lookup commutes with the observable metadata projection.
An index absent from every location remains absent after SIFA weakening; we do not assume that physical node vacancy alone implies permission vacancy.
An in-range raw range-map index always supplies its actual stored segment.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Releasing an unexposed zero-sized reservation with no materialized states really scans all allocation locations, skips each absent permission, and returns Released. Existing roots, ranges and exposure caches are preserved.
The ancestor SIFA stage preserves the exact facts needed to release a fresh, lazy, unexposed child, including on every existing byte partition.
Implementation-facing source equation for a concrete zero child. The insertion equation is discharged from raw freshness/pool data by clients.
The freshly inserted concrete zero child can be released without changing its post-constructor tree. Initial node vacancy and permission vacancy are separate facts; no release or byte-access success is assumed.
Exact lazy-root result for the wildcard zero-size source constructor.
Ending the fresh wildcard-root protector leaves its zero-size constructor result unchanged. Node vacancy and permission vacancy are kept independent.
The actual first full-range write on fresh allocation-owned provenance. The existing global protector map is arbitrary.