Documentation

Auto.Parser.NDFA

instance Auto.instBEqSumUnit_auto (σ : Type) [BEq σ] :
BEq (Unit σ)
Equations
  • One or more equations did not get rendered due to their size.
Equations
structure Auto.NFA (σ : Type) [BEq σ] [Hashable σ] :

The state of a n : NFA is a natual number The number of states is n.tr.size The set of all possible states is {0,1,...,n.tr.size}, where 0 is the initial state and n.size is the accept state n.tr represents the transition function of the NFA, where Unit is the ε transition. We assume that the accept state does not have any outward transitions, so it's not recorded in n. So, by definition, the accept state has no outcoming edges. However, the initial state might have incoming edges

Instances For
    instance Auto.instInhabitedNFA {a✝ : Type} {a✝¹ : BEq a✝} {a✝² : Hashable a✝} :
    Inhabited (NFA a✝)
    Equations
    def Auto.NFA.toString {σ : Type} [BEq σ] [Hashable σ] [ToString σ] (n : NFA σ) :
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      instance Auto.instToStringNFA {σ : Type} [BEq σ] [Hashable σ] [ToString σ] :
      Equations
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def Auto.NFA.move {σ : Type} [BEq σ] [Hashable σ] [ToString σ] (r : NFA σ) (ss : Std.HashSet Nat) (c : σ) :
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def Auto.NFA.moves {σ : Type} [BEq σ] [Hashable σ] [ToString σ] (r : NFA σ) (ss : Std.HashSet Nat) :
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def Auto.NFA.moveε {σ : Type} [BEq σ] [Hashable σ] [ToString σ] (r : NFA σ) (ss : Std.HashSet Nat) (c : σ) :
            Equations
            Instances For
              def Auto.NFA.moveεMany {σ : Type} [BEq σ] [Hashable σ] [ToString σ] (r : NFA σ) (ss : Std.HashSet Nat) (cs : Array σ) :
              Equations
              Instances For
                def Auto.NFA.run {σ : Type} [BEq σ] [Hashable σ] [ToString σ] (r : NFA σ) (cs : Array σ) :
                Equations
                Instances For
                  def Auto.NFA.wf {σ : Type} [BEq σ] [Hashable σ] (n : NFA σ) :

                  Criterion : The destination of all transitions should be ≤ n.size

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    def Auto.NFA.normalize {σ : Type} [BEq σ] [Hashable σ] (n : NFA σ) :
                    NFA σ

                    Delete invalid transitions and turn the NFA into a well-formed one

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      def Auto.NFA.hasEdgeToInit {σ : Type} [BEq σ] [Hashable σ] (n : NFA σ) :

                      Whether the NFA's initial state has incoming edges

                      Equations
                      Instances For
                        def Auto.NFA.addAttrToState {σ : Type} [BEq σ] [Hashable σ] (n : NFA σ) (s : Nat) (attr : String) :
                        NFA σ

                        Add attribute to a specific state

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          def Auto.NFA.addAttr {σ : Type} [BEq σ] [Hashable σ] (n : NFA σ) (attr : String) :
                          NFA σ

                          Add attribute to accept state

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            def Auto.NFA.zero {σ : Type} [BEq σ] [Hashable σ] :
                            NFA σ

                            Does not accept any string

                            Equations
                            Instances For
                              def Auto.NFA.plus {σ : Type} [BEq σ] [Hashable σ] (m n : NFA σ) :
                              NFA σ

                              Produce an NFA whose language is the union of m's and n's

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                def Auto.NFA.multiPlus {σ : Type} [BEq σ] [Hashable σ] (as : Array (NFA σ)) :
                                NFA σ
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  def Auto.NFA.comp {σ : Type} [BEq σ] [Hashable σ] (m n : NFA σ) :
                                  NFA σ
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    def Auto.NFA.star {σ : Type} [BEq σ] [Hashable σ] (m : NFA σ) :
                                    NFA σ
                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      def Auto.NFA.multiComp {σ : Type} [BEq σ] [Hashable σ] (a : Array (NFA σ)) :
                                      NFA σ
                                      Equations
                                      Instances For
                                        def Auto.NFA.repeatN {σ : Type} [BEq σ] [Hashable σ] (r : NFA σ) (n : Nat) :
                                        NFA σ
                                        Equations
                                        Instances For
                                          def Auto.NFA.repeatAtLeast {σ : Type} [BEq σ] [Hashable σ] (r : NFA σ) (n : Nat) :
                                          NFA σ
                                          Equations
                                          Instances For
                                            def Auto.NFA.repeatAtMost {σ : Type} [BEq σ] [Hashable σ] (r : NFA σ) (n : Nat) :
                                            NFA σ
                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              def Auto.NFA.repeatBounded {σ : Type} [BEq σ] [Hashable σ] (r : NFA σ) (n m : Nat) :
                                              NFA σ
                                              Equations
                                              Instances For
                                                def Auto.NFA.ofSymbPlus {σ : Type} [BEq σ] [Hashable σ] (cs : Array σ) :
                                                NFA σ

                                                Accepts all characters in an array of characters

                                                Equations
                                                Instances For
                                                  def Auto.NFA.ofSymbComp {σ : Type} [BEq σ] [Hashable σ] (s : Array σ) :
                                                  NFA σ

                                                  An NFA UInt32 that accepts exactly a string

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    structure Auto.DFA (σ : Type) [BEq σ] [Hashable σ] :
                                                    Instances For
                                                      instance Auto.instInhabitedDFA {a✝ : Type} {a✝¹ : BEq a✝} {a✝² : Hashable a✝} :
                                                      Inhabited (DFA a✝)
                                                      Equations
                                                      def Auto.DFA.toString {σ : Type} [BEq σ] [Hashable σ] [ToString σ] (d : DFA σ) :
                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        instance Auto.instToStringDFA {σ : Type} [BEq σ] [Hashable σ] [ToString σ] :
                                                        Equations
                                                        def Auto.DFA.move {σ : Type} [BEq σ] [Hashable σ] [ToString σ] (d : DFA σ) (s : Nat) (c : σ) :
                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          def Auto.DFA.ofNFA {σ : Type} [BEq σ] [Hashable σ] [ToString σ] (n : NFA σ) :
                                                          DFA σ
                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For