- epsilon {s : String} {nfa : NFA} {lb i j : ℕ} {p : s.ValidPos} (ge : lb ≤ i) (lt : i < nfa.nodes.size) (eq : nfa[i] = Node.epsilon j) : nfa.Step lb i p j p none
- anchor {s : String} {nfa : NFA} {lb i j : ℕ} {p : s.ValidPos} {a : Data.Anchor} (ge : lb ≤ i) (lt : i < nfa.nodes.size) (eq : nfa[i] = Node.anchor a j) (h : Data.Anchor.test p a = true) : nfa.Step lb i p j p none
- splitLeft {s : String} {nfa : NFA} {lb i j₁ j₂ : ℕ} {p : s.ValidPos} (ge : lb ≤ i) (lt : i < nfa.nodes.size) (eq : nfa[i] = Node.split j₁ j₂) : nfa.Step lb i p j₁ p none
- splitRight {s : String} {nfa : NFA} {lb i j₁ j₂ : ℕ} {p : s.ValidPos} (ge : lb ≤ i) (lt : i < nfa.nodes.size) (eq : nfa[i] = Node.split j₁ j₂) : nfa.Step lb i p j₂ p none
- save {s : String} {nfa : NFA} {lb i j : ℕ} {p : s.ValidPos} {offset : ℕ} (ge : lb ≤ i) (lt : i < nfa.nodes.size) (eq : nfa[i] = Node.save offset j) : nfa.Step lb i p j p (some (offset, p))
- char {s : String} {nfa : NFA} {lb i j : ℕ} {p : s.ValidPos} {c : Char} (ge : lb ≤ i) (lt : i < nfa.nodes.size) (eq : nfa[i] = Node.char c j) (ne : p ≠ s.endValidPos) (eq' : p.get ne = c) : nfa.Step lb i p j (p.next ne) none
- sparse {s : String} {nfa : NFA} {lb i j : ℕ} {p : s.ValidPos} {cs : Data.Classes} (ge : lb ≤ i) (lt : i < nfa.nodes.size) (eq : nfa[i] = Node.sparse cs j) (ne : p ≠ s.endValidPos) (mem : p.get ne ∈ cs) : nfa.Step lb i p j (p.next ne) none
Instances For
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).
- last {s : String} {nfa : NFA} {lb i : ℕ} {p : s.ValidPos} {j : ℕ} {p' : s.ValidPos} {update : Option (ℕ × s.ValidPos)} (step : nfa.Step lb i p j p' update) : nfa.Path lb i p j p' (List.ofOption update)
- more {s : String} {nfa : NFA} {lb i : ℕ} {p : s.ValidPos} {j : ℕ} {p' : s.ValidPos} {k : ℕ} {p'' : s.ValidPos} {update : Option (ℕ × s.ValidPos)} {updates : List (ℕ × s.ValidPos)} (step : nfa.Step lb i p j p' update) (rest : nfa.Path lb j p' k p'' updates) : nfa.Path lb i p k p'' (update ::ₒ updates)
Instances For
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)}
(ge : lb' ≤ i)
(inv :
∀ {p p' : s.ValidPos} {i j : ℕ} {update : Option (ℕ × s.ValidPos)},
lb' ≤ i → lb ≤ j → nfa.Step lb i p j p' update → lb' ≤ j)
(path : nfa.Path lb i p j p' updates)
:
nfa.Path lb' i p j p' updates
theorem
Regex.NFA.Path.of_step_closure
{s : String}
{nfa : NFA}
{lb : ℕ}
(motive : ℕ → s.ValidPos → Prop)
(closure :
∀ (i : ℕ) (p : s.ValidPos) (j : ℕ) (p' : s.ValidPos) (update : Option (ℕ × s.ValidPos)),
motive i p → nfa.Step lb i p j p' update → motive 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.