Langlib

Langlib.Grammars.Indexed.NormalForm.Aho.Machine.PaddedRows

Padded Aho machine rows #

The fixed-width row encoding and semantic padded transition relation used by the LBA compiler.

Twenty-one-slot padded rows #

@[irreducible]

The fixed number of logical work squares per input position used by the scheduler bound. Aho proves the sharper constant six; the persistent scheduler invariant currently uses twenty-one.

Equations
Instances For
    @[reducible, inline]

    One packed work block. none is a blank logical work square.

    Equations
    Instances For

      The completely unused packed work block.

      Equations
      Instances For

        Once a packed-cell offset lies beyond the logical word, that whole block is blank.

        A running row cell retains its immutable input letter, whether that input position has already been compared, and twenty-one logical work squares.

        Instances For

          Row cells are raw input cells before initialization or packed running cells afterwards.

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

            Read the packed block of a running row cell.

            Equations
            Instances For

              Read the consumed-input bit of a running row cell.

              Equations
              Instances For

                Recover the immutable input letter from either presentation of a row cell.

                Equations
                Instances For
                  @[simp]

                  The row presented to the certified-row system by an input word.

                  Equations
                  Instances For
                    def IndexedGrammar.Aho.encodeRunRowFrom {T : Type} (g : IndexedGrammar T) (work : List (WorkSlot g)) (inputPos cell : ) :
                    List TList (RowCell g)

                    Encode a running configuration, starting at physical input-cell offset cell.

                    Equations
                    Instances For

                      Pack a composite configuration into one width-twenty-one row cell per input letter.

                      Equations
                      Instances For
                        theorem IndexedGrammar.Aho.encodeRunRow_initial_cons {T : Type} (g : IndexedGrammar T) (a : T) (w : List T) :
                        encodeRunRow g (a :: w) (initialConfig g) = RowCell.run { input := a, consumed := false, block := initialBlock g } :: List.map (fun (b : T) => RowCell.run { input := b, consumed := false, block := blankBlock g }) w

                        Canonical cellwise shape of a nonempty initialization row.

                        theorem IndexedGrammar.Aho.encodeRunRow_final_cons {T : Type} (g : IndexedGrammar T) (a : T) (w : List T) :
                        encodeRunRow g (a :: w) (finalConfig g (a :: w).length) = RowCell.run { input := a, consumed := true, block := finalBlock g } :: List.map (fun (b : T) => RowCell.run { input := b, consumed := true, block := blankBlock g }) w

                        Canonical cellwise shape of a nonempty final row.

                        theorem IndexedGrammar.Aho.encodeRunRowFrom_length {T : Type} (g : IndexedGrammar T) (work : List (WorkSlot g)) (inputPos cell : ) (w : List T) :
                        (encodeRunRowFrom g work inputPos cell w).length = w.length
                        @[simp]
                        theorem IndexedGrammar.Aho.encodeRunRowFrom_map_inputLetter {T : Type} (g : IndexedGrammar T) (work : List (WorkSlot g)) (inputPos cell : ) (w : List T) :
                        List.map RowCell.inputLetter (encodeRunRowFrom g work inputPos cell w) = w
                        theorem IndexedGrammar.Aho.encodeRunRowFrom_getElem?_block {T : Type} (g : IndexedGrammar T) (work : List (WorkSlot g)) (inputPos cell : ) (w : List T) (k : ) (hk : k < w.length) :
                        (encodeRunRowFrom g work inputPos cell w)[k]?.bind RowCell.block? = some (packedCell workWidth work (cell + k))
                        theorem IndexedGrammar.Aho.encodeRunRowFrom_getElem?_consumed {T : Type} (g : IndexedGrammar T) (work : List (WorkSlot g)) (inputPos cell : ) (w : List T) (k : ) (hk : k < w.length) :
                        (encodeRunRowFrom g work inputPos cell w)[k]?.bind RowCell.consumed? = some (decide (cell + k < inputPos))
                        @[simp]
                        theorem IndexedGrammar.Aho.encodeRunRow_input_eq {T : Type} {g : IndexedGrammar T} {w w' : List T} {c d : Config g} (h : encodeRunRow g w c = encodeRunRow g w' d) :
                        w = w'

                        Equal running rows necessarily carry the same immutable input word.

                        theorem IndexedGrammar.Aho.encodeRunRow_injective_of_bounds {T : Type} (g : IndexedGrammar T) (w : List T) (c d : Config g) (hcpos : c.inputPos w.length) (hdpos : d.inputPos w.length) (hcwork : c.work.word.length w.length * workWidth) (hdwork : d.work.word.length w.length * workWidth) (hrow : encodeRunRow g w c = encodeRunRow g w d) :
                        c = d

                        On a fixed input row, bounded marked encodings are injective in the full configuration, including both the input position and the active work-head position.

                        theorem IndexedGrammar.Aho.encodeRunRow_pair_injective_of_bounds {T : Type} (g : IndexedGrammar T) (w w' : List T) (c d : Config g) (hcpos : c.inputPos w.length) (hdpos : d.inputPos w'.length) (hcwork : c.work.word.length w.length * workWidth) (hdwork : d.work.word.length w'.length * workWidth) (hrow : encodeRunRow g w c = encodeRunRow g w' d) :
                        w = w' c = d

                        Bounded marked rows recover both the immutable input word and the complete configuration.

                        A bounded packed-row image of one Aho composite move.

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

                          Semantic padded-row relation: initialize once, then perform a bounded composite move.

                          Equations
                          Instances For

                            A final row has consumed the whole frozen input and contains Aho's final $ # work word.

                            Equations
                            Instances For