Documentation

DescriptiveComplexity.Problems.Wide.DrawIncrKit

The increment kit: a round trip around the block-indexed mirror increment #

The kit wrapping DescriptiveComplexity.Draw.Prog.reaches_fileIncrBlk in its round trip: scan up to the file top, bounce, run the binary increment down the file – clearing set digits until the first clear one, setting it – and return to the marker in the phase of the block that carried. The inner VAL loop of the EXPSPACE program folds its accumulators against exactly that block, which is why the landing phase is indexed.

The carry block is read off the mark of the register cell that carried: the kit takes one slot per block (bs), set exactly at the registers of that block, and its set rule comes in one copy per block. The one-hot clause in that rule's guard is what makes two copies separable – at an arbitrary symbol two block slots could both be set, and the third hardening of the layer (DescriptiveComplexity.Draw.Prog.reaches_fileIncrBlk's one-hot hypothesis) made the demand and the guard match.

Rules are owned by their source phase: entry (at the scan phase) and exit (at the marker, in a landing phase, guarded wk = one ∧ rg ≠ one) belong to the caller.

The increment trip's shapes #

The phases of an increment trip: the up-scan, the bounce, the carry phase, and one landing phase per block.

  • up {B : Type} : IncrPh B

    Scanning up to the file top.

  • b2 {B : Type} : IncrPh B

    Bounced off the top, about to re-enter rightwards.

  • pc {B : Type} : IncrPh B

    Clearing set digits, looking for the first clear one.

  • pd {B : Type} : B → IncrPh B

    The digit of this block was set: walking home.

Instances For
    Dependency graph
    @[instance_reducible]
    Equations
    Dependency graph
    Dependency graph

    The rule families of an increment trip, the acting ones per block.

    • up {B : Type} : IncrRule B

      Scan right while the file-top mark is clear.

    • b1 {B : Type} : IncrRule B

      At the file top: step left into the bounce phase.

    • b2go {B : Type} : IncrRule B

      Bounce: step back right into the carry phase.

    • clear {B : Type} : IncrRule B

      At a register with a set digit: clear it, carry on.

    • set {B : Type} : B → IncrRule B

      At a register of this block with a clear digit: set it, land.

    • walk {B : Type} : IncrRule B

      Walk left over unmarked cells in the carry phase.

    • stay {B : Type} : B → IncrRule B

      Hold at registers, walk and return, in this block's landing phase.

    Instances For
      Dependency graph
      Dependency graph

      An increment kit: the walked track, the service slots, the per-block mark slots, and the phases.

      • t : W

        The walked track being incremented.

      • rg : W

        The register mark.

      • rl : W

        The file-top mark.

      • wk : W

        The working-cell marker slot.

      • bs : B → W

        The block mark: set exactly at the registers of that block.

      • emb : IncrPh B → P

        The kit's phases in the program.

      Instances For
        Dependency graph
        def DescriptiveComplexity.Draw.IncrKit.rule {A Q W P B : Type} [DecidableEq W] (κ : IncrKit A Q W P B) (zero one : A) :
        IncrRule B → Rule A Q W P

        The kit's rules.

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

          The discharge #

          theorem DescriptiveComplexity.Draw.IncrKit.wkOff {A R P Q W K B : Type} {dd : ℕ} [Fintype Q] [Fintype W] [DecidableEq W] [FirstOrder.Language.wide.Structure (Univ A R P K dd)] [Finite A] [Finite R] [Finite P] [Finite K] {PR : Prog A R P Q W K dd} {κ : IncrKit A Q W P B} {I : Type} {ile : I → I → Prop} (F : IxFile (Univ A R P K dd) I ile) (hlin : IsLinOrd WMLe) (hix : IsLinOrd ile) (hnewk : κ.wk ≠ κ.t) {gbot : I} (hbot : ∀ (y : I), ile gbot y) {rest : (Univ A R P K dd → Prop) → W → A} {wkAddr : Univ A R P K dd → Prop} (hwkLt : WMSetLt WMLe wkAddr (F.cell gbot)) (hwkS : ∀ (r : Univ A R P K dd → Prop), rest r κ.wk = bitVal PR.zero PR.one (r = wkAddr)) (k : I → Prop) (r : Univ A R P K dd → Prop) (hbnd : ∃ (x : I), WMSetLe WMLe (F.cell x) r) :
          PR.passTracksAt F.cell κ.t rest k r κ.wk ≠ PR.one
          Dependency graph
          theorem DescriptiveComplexity.Draw.IncrKit.rgOff {A R P Q W K B : Type} {dd : ℕ} [Fintype Q] [Fintype W] [DecidableEq W] [FirstOrder.Language.wide.Structure (Univ A R P K dd)] {PR : Prog A R P Q W K dd} {κ : IncrKit A Q W P B} {I : Type} {ile : I → I → Prop} (F : IxFile (Univ A R P K dd) I ile) (hnerg : κ.t ≠ κ.rg) {rest : (Univ A R P K dd → Prop) → W → A} (hrg : ∀ (r : Univ A R P K dd → Prop), rest r κ.rg = bitVal PR.zero PR.one (∃ (u : I), r = F.cell u)) (k : I → Prop) (r : Univ A R P K dd → Prop) (hno : ∀ (x : I), r ≠ F.cell x) :
          PR.passTracksAt F.cell κ.t rest k r κ.rg ≠ PR.one
          Dependency graph