Documentation

RegexCorrectness.NFA.Semantics.Path

inductive Regex.NFA.Step {s : String} (nfa : NFA) (lb : ) :
s.ValidPoss.ValidPosOption ( × s.ValidPos)Prop
Instances For
    theorem Regex.NFA.Step.ge {s : String} {nfa : NFA} {lb : } {p p' : s.ValidPos} {i j : } {update : Option ( × s.ValidPos)} (step : nfa.Step lb i p j p' update) :
    lb i
    theorem Regex.NFA.Step.lt {s : String} {nfa : NFA} {lb : } {p p' : s.ValidPos} {i j : } {update : Option ( × s.ValidPos)} (step : nfa.Step lb i p j p' update) :
    i < nfa.nodes.size
    theorem Regex.NFA.Step.lt_right {s : String} {nfa : NFA} {lb : } {p p' : s.ValidPos} {i j : } {update : Option ( × s.ValidPos)} (wf : nfa.WellFormed) (step : nfa.Step lb i p j p' update) :
    j < nfa.nodes.size
    theorem Regex.NFA.Step.eq_or_next {s : String} {nfa : NFA} {lb : } {p p' : s.ValidPos} {i j : } {update : Option ( × s.ValidPos)} (step : nfa.Step lb i p j p' update) :
    p' = p ∃ (ne : p s.endValidPos), p' = p.next ne
    theorem Regex.NFA.Step.le {s : String} {nfa : NFA} {lb : } {p p' : s.ValidPos} {i j : } {update : Option ( × s.ValidPos)} (step : nfa.Step lb i p j p' update) :
    p p'
    theorem Regex.NFA.Step.cast {s : String} {nfa nfa' : NFA} {lb : } {p p' : s.ValidPos} {i j : } {update : Option ( × s.ValidPos)} (step : nfa.Step lb i p j p' update) {lt : i < nfa'.nodes.size} (h : nfa[i] = nfa'[i]) :
    nfa'.Step lb i p j p' update
    theorem Regex.NFA.Step.liftBound' {s : String} {nfa : NFA} {lb lb' : } {p p' : s.ValidPos} {i j : } {update : Option ( × s.ValidPos)} (ge : lb' i) (step : nfa.Step lb i p j p' update) :
    nfa.Step lb' i p j p' update
    theorem Regex.NFA.Step.liftBound {s : String} {nfa : NFA} {lb lb' : } {p p' : s.ValidPos} {i j : } {update : Option ( × s.ValidPos)} (le : lb' lb) (step : nfa.Step lb i p j p' update) :
    nfa.Step lb' i p j p' update
    theorem Regex.NFA.Step.iff_done {s : String} {nfa : NFA} {lb : } {p p' : s.ValidPos} {i j : } {update : Option ( × s.ValidPos)} {lt : i < nfa.nodes.size} (eq : nfa[i] = Node.done) :
    nfa.Step lb i p j p' update False
    theorem Regex.NFA.Step.iff_fail {s : String} {nfa : NFA} {lb : } {p p' : s.ValidPos} {i j : } {update : Option ( × s.ValidPos)} {lt : i < nfa.nodes.size} (eq : nfa[i] = Node.fail) :
    nfa.Step lb i p j p' update False
    theorem Regex.NFA.Step.iff_epsilon {s : String} {nfa : NFA} {lb : } {p p' : s.ValidPos} {i j : } {update : Option ( × s.ValidPos)} {next : } {lt : i < nfa.nodes.size} (eq : nfa[i] = Node.epsilon next) :
    nfa.Step lb i p j p' update lb i j = next p' = p update = none
    theorem Regex.NFA.Step.iff_anchor {s : String} {nfa : NFA} {lb : } {p p' : s.ValidPos} {i j : } {update : Option ( × s.ValidPos)} {anchor : Data.Anchor} {next : } {lt : i < nfa.nodes.size} (eq : nfa[i] = Node.anchor anchor next) :
    nfa.Step lb i p j p' update lb i j = next p' = p update = none Data.Anchor.test p anchor = true
    theorem Regex.NFA.Step.iff_split {s : String} {nfa : NFA} {lb : } {p p' : s.ValidPos} {i j : } {update : Option ( × s.ValidPos)} {next₁ next₂ : } {lt : i < nfa.nodes.size} (eq : nfa[i] = Node.split next₁ next₂) :
    nfa.Step lb i p j p' update lb i (j = next₁ j = next₂) p' = p update = none
    theorem Regex.NFA.Step.iff_save {s : String} {nfa : NFA} {lb : } {p p' : s.ValidPos} {i j : } {update : Option ( × s.ValidPos)} {offset next : } {lt : i < nfa.nodes.size} (eq : nfa[i] = Node.save offset next) :
    nfa.Step lb i p j p' update lb i j = next p' = p update = some (offset, p)
    theorem Regex.NFA.Step.iff_char {s : String} {nfa : NFA} {lb : } {p p' : s.ValidPos} {i j : } {update : Option ( × s.ValidPos)} {c : Char} {next : } {lt : i < nfa.nodes.size} (eq : nfa[i] = Node.char c next) :
    nfa.Step lb i p j p' update ∃ (ne : p s.endValidPos), lb i j = next p' = p.next ne update = none p.get ne = c
    theorem Regex.NFA.Step.iff_sparse {s : String} {nfa : NFA} {lb : } {p p' : s.ValidPos} {i j : } {update : Option ( × s.ValidPos)} {cs : Data.Classes} {next : } {lt : i < nfa.nodes.size} (eq : nfa[i] = Node.sparse cs next) :
    nfa.Step lb i p j p' update ∃ (ne : p s.endValidPos), lb i j = next p' = p.next ne update = none p.get ne cs
    theorem Regex.NFA.Step.compile_liftBound {s : String} {p p' : s.ValidPos} {i j : } {update : Option ( × s.ValidPos)} {e : Data.Expr} {nfa : NFA} (eq : compile e = nfa) (step : nfa.Step 0 i p j p' update) :
    nfa.Step 1 i p j p' update
    inductive Regex.NFA.Path {s : String} (nfa : NFA) (lb : ) :
    s.ValidPoss.ValidPosList ( × s.ValidPos)Prop

    A collection of steps in an NFA forms a path. The path must contain at least one step (which implies that the first state is greater than or equal to the lower bound).

    Instances For
      theorem Regex.NFA.Path.ge {s : String} {nfa : NFA} {lb : } {p p' : s.ValidPos} {i j : } {updates : List ( × s.ValidPos)} (path : nfa.Path lb i p j p' updates) :
      lb i
      theorem Regex.NFA.Path.lt {s : String} {nfa : NFA} {lb : } {p p' : s.ValidPos} {i j : } {updates : List ( × s.ValidPos)} (path : nfa.Path lb i p j p' updates) :
      i < nfa.nodes.size
      theorem Regex.NFA.Path.lt_right {s : String} {nfa : NFA} {lb : } {p p' : s.ValidPos} {i j : } {updates : List ( × s.ValidPos)} (wf : nfa.WellFormed) (path : nfa.Path lb i p j p' updates) :
      j < nfa.nodes.size
      theorem Regex.NFA.Path.le {s : String} {nfa : NFA} {lb : } {p p' : s.ValidPos} {i j : } {updates : List ( × s.ValidPos)} (path : nfa.Path lb i p j p' updates) :
      p p'
      theorem Regex.NFA.Path.cast {s : String} {nfa nfa' : NFA} {lb : } {p p' : s.ValidPos} {i j : } {updates : List ( × s.ValidPos)} (eq : ∀ (i : ), lb i∀ (x : i < nfa.nodes.size), ∃ (x_1 : i < nfa'.nodes.size), nfa[i] = nfa'[i]) (path : nfa.Path lb i p j p' updates) :
      nfa'.Path lb i p j p' updates

      A simpler casting procedure where the equality can be proven easily, e.g., when casting to a larger NFA.

      theorem Regex.NFA.Path.cast' {s : String} {nfa nfa' : NFA} {lb : } {p p' : s.ValidPos} {i j : } {updates : List ( × s.ValidPos)} (lt : i < nfa.nodes.size) (size_le : nfa.nodes.size nfa'.nodes.size) (wf : nfa.WellFormed) (eq : ∀ (i : ), lb i∀ (lt : i < nfa.nodes.size), nfa'[i] = nfa[i]) (path : nfa'.Path lb i p j p' updates) :
      nfa.Path lb i p j p' updates

      A casting procedure that transports a path from a larger NFA to a smaller NFA.

      theorem Regex.NFA.Path.liftBound {s : String} {nfa : NFA} {lb lb' : } {p p' : s.ValidPos} {i j : } {updates : List ( × s.ValidPos)} (le : lb' lb) (path : nfa.Path lb i p j p' updates) :
      nfa.Path lb' i p j p' updates
      theorem Regex.NFA.Path.liftBound' {s : String} {nfa : NFA} {lb lb' : } {p p' : s.ValidPos} {i j : } {updates : List ( × s.ValidPos)} (ge : lb' i) (inv : ∀ {p p' : s.ValidPos} {i j : } {update : Option ( × s.ValidPos)}, lb' ilb jnfa.Step lb i p j p' updatelb' j) (path : nfa.Path lb i p j p' updates) :
      nfa.Path lb' i p j p' updates
      theorem Regex.NFA.Path.trans {s : String} {nfa : NFA} {lb : } {p p' p'' : s.ValidPos} {i j k : } {updates₁ updates₂ : List ( × s.ValidPos)} (path₁ : nfa.Path lb i p j p' updates₁) (path₂ : nfa.Path lb j p' k p'' updates₂) :
      nfa.Path lb i p k p'' (updates₁ ++ updates₂)
      theorem Regex.NFA.Path.compile_liftBound {s : String} {p p' : s.ValidPos} {i j : } {updates : List ( × s.ValidPos)} {e : Data.Expr} {nfa : NFA} (eq : compile e = nfa) (path : nfa.Path 0 i p j p' updates) :
      nfa.Path 1 i p j p' updates
      theorem Regex.NFA.Path.of_step_closure {s : String} {nfa : NFA} {lb : } (motive : s.ValidPosProp) (closure : ∀ (i : ) (p : s.ValidPos) (j : ) (p' : s.ValidPos) (update : Option ( × s.ValidPos)), motive i pnfa.Step lb i p j p' updatemotive j p') {i : } {p : s.ValidPos} {j : } {p' : s.ValidPos} {update : List ( × s.ValidPos)} (base : motive i p) (path : nfa.Path lb i p j p' update) :
      motive j p'

      If a property is closed under a single step, then it is closed under a path.