Documentation

Miri.DataStructures.DedupRangeMap

A checked port of Miri's DedupRangeMap<T> range partition.

A half-open byte interval, matching ops::Range<u64>.

Instances For
    Equations
    Instances For
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        One range and its associated value.

        Instances For
          def Miri.DataStructures.instDecidableEqRangeMapSegment.decEq {α✝ : Type} [DecidableEq α✝] (x✝ x✝¹ : RangeMapSegment α✝) :
          Decidable (x✝ = x✝¹)
          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

              Explicit equivalents of the source's checked-size failures and panics.

              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
                    @[instance_reducible]
                    Equations
                    • One or more equations did not get rendered due to their size.

                    The source's ordered vector of half-open intervals.

                    Instances For
                      def Miri.DataStructures.instDecidableEqDedupRangeMap.decEq {α✝ : Type} [DecidableEq α✝] (x✝ x✝¹ : DedupRangeMap α✝) :
                      Decidable (x✝ = x✝¹)
                      Equations
                      Instances For
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For

                          Mutations carry state even on failure, preserving operations performed before the corresponding Rust panic.

                          Instances For

                            Result of preparing a source iter_mut call. The map already contains the source's start/end splits and opportunistic merges; positions identify exactly the entries borrowed by the returned Rust iterator.

                            Instances For
                              def Miri.DataStructures.DedupRangeMap.new {α : Type} (size : ABI.Size) (initial : α) :
                              Equations
                              Instances For

                                The source reports the last interval's end, or zero for an empty map.

                                Equations
                                Instances For
                                  Equations
                                  Instances For

                                    Read-only iteration returns complete stored segments intersecting the requested interval; edge segments are not split or clipped.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For

                                      Read a stored segment by vector position.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For

                                        Replace a stored segment's value, corresponding to mutation through a returned mutable iterator reference.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          def Miri.DataStructures.DedupRangeMap.iterMutWithClone {α : Type} (map : DedupRangeMap α) (offset len : ABI.Size) [DecidableEq α] (cloneData : α → α) :

                                          Perform source iter_mut's eager start split, bounded duplicate merge scan, and end split. The returned position list represents the mutable slice; callers can update those entries using setAtPos.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For

                                            Prepare a mutable range using value-preserving copies on splits. This is the usual instance for value-like Lean state and is exact when the Rust Clone implementation returns the same value. Use iterMutWithClone when a modeled clone operation produces a different value.

                                            Equations
                                            Instances For
                                              def Miri.DataStructures.DedupRangeMap.modifyRangeWithClone {α : Type} (map : DedupRangeMap α) (offset len : ABI.Size) [DecidableEq α] (cloneData : α → α) (modify : ByteRange → α → α) :

                                              Apply one pure update to every segment selected by iter_mut. Splitting and merging happen first, before the callback updates values, as in Rust.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                def Miri.DataStructures.DedupRangeMap.modifyRange {α : Type} (map : DedupRangeMap α) (offset len : ABI.Size) [DecidableEq α] (modify : ByteRange → α → α) :

                                                Apply a pure update after source iter_mut splitting and merging. The default split copy preserves the immutable Lean value.

                                                Equations
                                                Instances For
                                                  def Miri.DataStructures.DedupRangeMap.modifyAll {α : Type} (map : DedupRangeMap α) (modify : ByteRange → α → α) :

                                                  Apply an update to every element without splitting or merging, matching iter_mut_all.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For

                                                    Coalesce every adjacent equal run, with the same adjacency assertion as the source. On a failed assertion the vector contains only the already-built prefix.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For

                                                      Sorted, gapless, nonempty intervals beginning at zero.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        theorem Miri.DataStructures.DedupRangeMap.new_wellFormed {α : Type} (size : ABI.Size) (initial : α) :
                                                        (new size initial).WellFormed
                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          theorem Miri.DataStructures.DedupRangeMap.iterMut_new_full {A : Type} [DecidableEq A] (size : ABI.Size) (value : A) (positive : size.bytes ≠ 0) :
                                                          (new size value).iterMut ABI.Size.ZERO size = { state := new size value, positions := #[0], segments := #[{ range := { start := 0, stop := size.bytes }, data := value }], outcome := Except.ok () }