Documentation

RegexCorrectness.VM.Path.EpsilonClosure

def Regex.NFA.εStep' (nfa : NFA) (it : String.Iterator) (i j : Fin nfa.nodes.size) (update : Option ( × String.Pos)) :
Equations
  • nfa.εStep' it i j update = nfa.Step 0 (↑i) it (↑j) it update
Instances For
    theorem Regex.NFA.εStep'.done {nfa : NFA} {it : String.Iterator} {i j : Fin nfa.nodes.size} {update : Option ( × String.Pos)} (hn : nfa[i] = Node.done) :
    nfa.εStep' it i j update False
    theorem Regex.NFA.εStep'.fail {nfa : NFA} {it : String.Iterator} {i j : Fin nfa.nodes.size} {update : Option ( × String.Pos)} (hn : nfa[i] = Node.fail) :
    nfa.εStep' it i j update False
    theorem Regex.NFA.εStep'.epsilon {nfa : NFA} {it : String.Iterator} {i j : Fin nfa.nodes.size} {update : Option ( × String.Pos)} {next : } (hn : nfa[i] = Node.epsilon next) :
    nfa.εStep' it i j update j = next update = none it.Valid
    theorem Regex.NFA.εStep'.anchor {nfa : NFA} {it : String.Iterator} {i j : Fin nfa.nodes.size} {update : Option ( × String.Pos)} {anchor : Data.Anchor} {next : } (hn : nfa[i] = Node.anchor anchor next) :
    nfa.εStep' it i j update j = next update = none it.Valid Data.Anchor.test it anchor = true
    theorem Regex.NFA.εStep'.split {nfa : NFA} {it : String.Iterator} {i j : Fin nfa.nodes.size} {update : Option ( × String.Pos)} {next₁ next₂ : } (hn : nfa[i] = Node.split next₁ next₂) :
    nfa.εStep' it i j update (j = next₁ j = next₂) update = none it.Valid
    theorem Regex.NFA.εStep'.save {nfa : NFA} {it : String.Iterator} {i j : Fin nfa.nodes.size} {update : Option ( × String.Pos)} {offset next : } (hn : nfa[i] = Node.save offset next) :
    nfa.εStep' it i j update j = next update = some (offset, it.pos) it.Valid
    theorem Regex.NFA.εStep'.char {nfa : NFA} {it : String.Iterator} {i j : Fin nfa.nodes.size} {update : Option ( × String.Pos)} {c : Char} {next : } (hn : nfa[i] = Node.char c next) :
    nfa.εStep' it i j update False
    theorem Regex.NFA.εStep'.sparse {nfa : NFA} {it : String.Iterator} {i j : Fin nfa.nodes.size} {update : Option ( × String.Pos)} {cs : Data.Classes} {next : } (hn : nfa[i] = Node.sparse cs next) :
    nfa.εStep' it i j update False
    theorem Regex.NFA.εStep'.valid {nfa : NFA} {it : String.Iterator} {i j : Fin nfa.nodes.size} {update : Option ( × String.Pos)} (step : nfa.εStep' it i j update) :
    inductive Regex.NFA.εClosure' (nfa : NFA) (it : String.Iterator) :
    Fin nfa.nodes.sizeFin nfa.nodes.sizeList ( × String.Pos)Prop
    Instances For
      theorem Regex.NFA.εClosure'.single {nfa : NFA} {it : String.Iterator} {i j : Fin nfa.nodes.size} {update : Option ( × String.Pos)} (step : nfa.εStep' it i j update) :
      nfa.εClosure' it i j (List.ofOption update)
      theorem Regex.NFA.εClosure'.trans {nfa : NFA} {it : String.Iterator} {i j k : Fin nfa.nodes.size} {update₁ update₂ : List ( × String.Pos)} (cls₁ : nfa.εClosure' it i j update₁) (cls₂ : nfa.εClosure' it j k update₂) :
      nfa.εClosure' it i k (update₁ ++ update₂)
      theorem Regex.NFA.εClosure'.snoc {nfa : NFA} {it : String.Iterator} {i j k : Fin nfa.nodes.size} {update₁ : List ( × String.Pos)} {update₂ : Option ( × String.Pos)} (cls : nfa.εClosure' it i j update₁) (step : nfa.εStep' it j k update₂) :
      nfa.εClosure' it i k (update₁ ++ List.ofOption update₂)
      theorem Regex.NFA.εClosure'_of_path {nfa : NFA} {i j : } {it it' : String.Iterator} {updates : List ( × String.Pos)} (wf : nfa.WellFormed) (hit : it = it') (path : nfa.Path 0 i it j it' updates) :
      nfa.εClosure' it i, j, updates
      theorem Regex.NFA.εClosure'_iff_path (nfa : NFA) (wf : nfa.WellFormed) (i j : Fin nfa.nodes.size) (it : String.Iterator) (updates : List ( × String.Pos)) :
      nfa.εClosure' it i j updates i = j updates = [] it.Valid nfa.Path 0 (↑i) it (↑j) it updates
      theorem Regex.NFA.εClosure'.valid {nfa : NFA} {it : String.Iterator} {i j : Fin nfa.nodes.size} {updates : List ( × String.Pos)} (cls : nfa.εClosure' it i j updates) :