Langlib

Langlib.Automata.LinearBounded.CertifiedRowSystem

Certified row systems and linearly bounded automata #

A CertifiedRowSystem describes a length-preserving relation on finite rows. A successor row is certified one cell at a time by a finite left-to-right verifier. This file compiles every such system to a nondeterministic LBA. The machine keeps two row tracks on the input-sized tape. It guesses and verifies the inactive track in one sweep, and changes the active track only after the whole certificate has been accepted.

The construction is useful for space-bound arguments whose configurations have already been packed into a fixed number of logical slots per input cell: the packed cell is the row alphabet A, while C contains the finite local annotation witnessing one simulated step.

structure CertifiedRowSystem (I : Type u_1) (A : Type u_2) (C : Type u_3) (Q : Type u_4) (F : Type u_5) :
Type (max (max (max (max u_1 u_2) u_3) u_4) u_5)

A finite-state, cellwise-certified, length-preserving row transition system.

stepCell q old new cert is the verifier state after checking one aligned pair of cells. A row step is valid when some certificate row makes the final verifier state satisfy stepDone. finalCell and finalDone similarly specify the regular set of target rows.

  • inputCell : IA
  • stepStart : Q
  • stepCell : QAACQ
  • stepDone : QBool
  • finalStart : F
  • finalCell : FAF
  • finalDone : FBool
Instances For
    def CertifiedRowSystem.evalStep {I : Type u_1} {A : Type u_2} {C : Type u_3} {Q : Type u_4} {F : Type u_5} (S : CertifiedRowSystem I A C Q F) :
    QList AList AList COption Q

    Run the step verifier on three aligned lists. A length mismatch rejects with none.

    Equations
    Instances For
      def CertifiedRowSystem.RowStep {I : Type u_1} {A : Type u_2} {C : Type u_3} {Q : Type u_4} {F : Type u_5} (S : CertifiedRowSystem I A C Q F) (old new : List A) :

      The length-preserving row relation certified by evalStep.

      Equations
      Instances For
        def CertifiedRowSystem.evalFinal {I : Type u_1} {A : Type u_2} {C : Type u_3} {Q : Type u_4} {F : Type u_5} (S : CertifiedRowSystem I A C Q F) (q : F) (row : List A) :
        F

        Run the finite-state target-row checker.

        Equations
        Instances For
          def CertifiedRowSystem.Final {I : Type u_1} {A : Type u_2} {C : Type u_3} {Q : Type u_4} {F : Type u_5} (S : CertifiedRowSystem I A C Q F) (row : List A) :

          The regular target predicate for rows.

          Equations
          Instances For
            def CertifiedRowSystem.rowReachLanguage {I : Type u_1} {A : Type u_2} {C : Type u_3} {Q : Type u_4} {F : Type u_5} (S : CertifiedRowSystem I A C Q F) :

            The nonempty input language obtained by row reachability from the cellwise input encoding.

            Equations
            Instances For
              @[simp]
              theorem CertifiedRowSystem.evalStep_nil_iff {I : Type u_1} {A : Type u_2} {C : Type u_3} {Q : Type u_4} {F : Type u_5} (S : CertifiedRowSystem I A C Q F) {q q' : Q} {as bs : List A} {cs : List C} :
              S.evalStep q as bs cs = some q'as.length = bs.length as.length = cs.length
              theorem CertifiedRowSystem.rowStep_length {I : Type u_1} {A : Type u_2} {C : Type u_3} {Q : Type u_4} {F : Type u_5} (S : CertifiedRowSystem I A C Q F) {old new : List A} (h : S.RowStep old new) :
              old.length = new.length

              The compiled machine #

              Canonical tapes and verifier prefixes #

              Initialization #

              Completeness of one certified sweep #

              Completeness of the target-row sweep #

              Completeness for semantic row paths #

              Soundness infrastructure #

              Correctness and the public compiler theorem #

              theorem CertifiedRowSystem.is_LBA_pos_rowReachLanguage {I₀ A₀ C₀ Q₀ F₀ : Type} (S₀ : CertifiedRowSystem I₀ A₀ C₀ Q₀ F₀) [Fintype I₀] [DecidableEq I₀] [Fintype A₀] [DecidableEq A₀] [Fintype C₀] [DecidableEq C₀] [Fintype Q₀] [DecidableEq Q₀] [Fintype F₀] [DecidableEq F₀] :

              Every finite certified row system is recognized by an input-sized nondeterministic LBA.