Locating keys and payloads in linked search trees #
Strict key ordering identifies a unique tree position for each key. A represented position also identifies its allocated heap record and complete scalar payload.
theorem Cslib.DataStructure.SearchTree.PointerMachine.key_mem_of_get {M : PointerMachine.Model} {extra : ℕ} [LinearOrder M.Value] {tree : BinaryTree (Label M extra)} {p : PosNum} {a : Label M extra} (h : BinaryTree.get p tree = some a) :
Every label found at a tree position contributes its key to the represented key set.
theorem Cslib.DataStructure.SearchTree.PointerMachine.get_key_injective {M : PointerMachine.Model} {extra : ℕ} [LinearOrder M.Value] {tree : BinaryTree (Label M extra)} (ordered : Ordered (keys tree)) {p q : PosNum} {a b : Label M extra} (hp : BinaryTree.get p tree = some a) (hq : BinaryTree.get q tree = some b) (eq : a.data 0 = b.data 0) :
p = q
In a strictly ordered linked tree, equal keys occupy the same position.
theorem Cslib.DataStructure.SearchTree.PointerMachine.Represents.get {M : PointerMachine.Model} {extra regs : ℕ} {heap : List (PointerMachine.Record M (layout extra regs))} {parent : PointerMachine.Pointer} {tree : BinaryTree (Label M extra)} (rep : Represents heap parent tree) {p : PosNum} {a : Label M extra} (get : BinaryTree.get p tree = some a) :
A represented position has an allocated record with exactly the ghost label's data.