Documentation

Complexity.Computability.Circuit.Boolean.Iteration.ForestCircuitRecords

Bit-vector records and fixed dictionaries for compressed-forest navigation #

This module encodes the subtree interval labels (low x, high x) and the edge-anchor records (a, low a, high a, depthWord f a) of a compressed checkpoint forest as fixed-width bit strings, wraps synthesis_lookupOr into synthesis_fixed_dictionary returning hit flags and value records, and packages the nonconstructive forest tables (ForestCircuitTables) needed by the reachability circuit.

Main definitions #

Main results #

References #

Two (n + 1)-bit words holding the lower and upper subtree ranks of a state.

Instances For

    Unpack the lower subtree rank word from a forest label record.

    Instances For

      Unpack the upper subtree rank word from a forest label record.

      Instances For
        @[simp]
        @[simp]
        theorem Cslib.Circuits.Boolean.Iteration.forest_label_interval {n : ℕ} (low high : BitString n → Fin (Nat.card (BitString n))) (a h : BitString n) :
        (!(forestLowWord (forestLabelWord low high h)).ult (forestLowWord (forestLabelWord low high a)) && !(forestHighWord (forestLabelWord low high a)).ult (forestLowWord (forestLabelWord low high h))) = true ↔ low a ≤ low h ∧ low h ≤ high a

        Word-level interval containment on unpacked (n + 1)-bit words matches rank containment.

        noncomputable def Cslib.Circuits.Boolean.Iteration.forestAnchorWord {n : ℕ} (f : BitString n → BitString n) (low high : BitString n → Fin (Nat.card (BitString n))) (x : BitString n) :
        BitString (n + (n + 1 + (n + 1)) + (n + 3))

        An anchor record packs a marked state, its two interval words, and its (n + 3)-bit depth.

        Instances For

          Unpack the marked state from an anchor record.

          Instances For
            def Cslib.Circuits.Boolean.Iteration.forestAnchorLabels {n : ℕ} (r : BitString (n + (n + 1 + (n + 1)) + (n + 3))) :
            BitString (n + 1 + (n + 1))

            Unpack the interval label pair from an anchor record.

            Instances For
              def Cslib.Circuits.Boolean.Iteration.forestAnchorDepth {n : ℕ} (r : BitString (n + (n + 1 + (n + 1)) + (n + 3))) :
              BitVec (n + 3)

              Unpack the (n + 3)-bit transient depth word from an anchor record.

              Instances For

                Gate bound for a shared fixed-dictionary lookup with M keys and Q queries of v-bit records.

                Instances For
                  theorem Cslib.Circuits.Boolean.Iteration.synthesis_fixed_dictionary {n a v M Q : ℕ} (s : Set (BooleanFunction a)) (keys : Fin M → BitString n) (hkeys : Function.Injective keys) (values : Fin M → BitString v) (queries : BitString a → Fin Q → BitString n) (hq : ∀ (j : Fin Q), (wires fun (z : BitString a) => queries z j) ⊆ s) :
                  ∃ (flags : BitString a → Fin Q → Bool) (records : BitString a → Fin Q → BitString v), (∀ (z : BitString a) (j : Fin Q), (flags z j = true ↔ ∃ (i : Fin M), keys i = queries z j) ∧ ∀ (i : Fin M), keys i = queries z j → records z j = values i) ∧ Synthesis interpretation s ((Set.range fun (j : Fin Q) (z : Fin a → Bool) => flags z j) ∪ ⋃ (j : Fin Q), wires fun (z : BitString a) => records z j) (dictionaryCost n v M Q)

                  Shared lookup for a fixed injective dictionary, returning hit flags and v-bit records.

                  Combined checkpoint-mark and compressed-edge tables for a functional graph on BitString n.

                  Instances For