Documentation

Complexity.Algorithms.WordRAM.PriorityQueue.BinaryHeap

Standalone Word-RAM Indexed Binary Min-Heap #

This file proves the full SubroutineDS and PQPackage specifications for the standalone word-RAM indexed binary min-heap (Cslib.Algorithms.WordRAM.PriorityQueue.BinaryHeap.pqCode) over Basis.exact, and projects it via Basis.Simulates.exactStandard to standalone .standard-basis DynamicProgram, DynamicCertificate, Stateful.Bound, and adaptive-client theorems.

The heap uses space n = 3 * n + 1 words at any base address base with Fits w (base + space n) and Fits w K_max:

Main definitions #

Main results #

References #

Concrete representation invariant of the standalone binary heap at base on n handles.

  • bounded : WordRAM.Data.Bounded w x

    All registers and memory cells fit in w-bit words.

  • reg_base : x.regs Reg.baseReg = base

    Persistent base-address register baseReg = base.

  • reg_n : x.regs Reg.nReg = n

    Persistent handle-count register nReg = n.

  • reg_hb : x.regs Reg.hb = base + n

    Persistent heap-array base hb = base + n.

  • reg_pb : x.regs Reg.pb = base + 2 * n + 1

    Persistent position-array base pb = base + 2 * n + 1.

  • heap : HeapInv n base (x.regs Reg.sz) x.mem

    Structural and lexicographic binary-heap invariant on x.mem.

  • state_eq : s = stateOfMem n base x.mem

    Abstract state s matches stateOfMem n base x.mem.

Instances For
    @[reducible, inline]

    Worst-case instruction bound for isEmpty.

    Instances For
      @[reducible, inline]

      Worst-case instruction bound for getKey.

      Instances For
        @[reducible, inline]

        Worst-case instruction bound for insert.

        Instances For
          @[reducible, inline]

          Worst-case instruction bound for decreaseKey.

          Instances For
            @[reducible, inline]

            Worst-case instruction bound for extractMin.

            Instances For

              Per-operation worst-case instruction charge (excluding standalone trailing halt).

              Instances For

                Exact-basis SubroutineDS certificate for the standalone binary min-heap.

                Instances For

                  Packaged PQPackage .exact rBin for plug-and-play subroutine callers (dijkstra_of_pq_spec).

                  Instances For

                    Standalone .standard-Basis Word-RAM Realization and Worst-Case Bounds #

                    Standalone .standard-basis DynamicProgram serving IndexedMinPQ.spec n K_max.

                    Instances For

                      Standalone .standard-basis DynamicCertificate for the binary min-heap.

                      Instances For

                        Standalone worst-case per-operation bound for the word-RAM binary min-heap over Basis.standard (charge n o + 1 instructions including the trailing halt).

                        Standalone adaptive-client bound for the word-RAM binary min-heap over Basis.standard.