Documentation

RegexCorrectness.VM.CharStep.Basic

theorem Regex.VM.eachStepChar.go.induct' {s : String} (σ : Strategy s) (nfa : NFA) (wf : nfa.WellFormed) (pos : s.ValidPos) (ne : pos s.endValidPos) (current : SearchState σ nfa) (motive : (i : ) → i current.states.countSearchState σ nfaProp) (base : ∀ (next : SearchState σ nfa), motive current.states.count next) (done : ∀ (i : ) (hlt : i < current.states.count) (next : SearchState σ nfa), nfa[current.states[i]] = NFA.Node.donemotive i next) (found : ∀ (i : ) (hlt : i < current.states.count) (next : SearchState σ nfa), nfa[current.states[i]] NFA.Node.done∀ (matched : Option σ.Update) (next' : SearchState σ nfa), stepChar σ nfa wf pos ne current.updates next current.states[i] = (matched, next')matched.isSome = truemotive i next) (not_found : ∀ (i : ) (hlt : i < current.states.count) (next : SearchState σ nfa), nfa[current.states[i]] NFA.Node.done∀ (matched : Option σ.Update) (next' : SearchState σ nfa), stepChar σ nfa wf pos ne current.updates next current.states[i] = (matched, next')¬matched.isSome = truemotive (i + 1) next'motive i next) (i : ) (hle : i current.states.count) (next : SearchState σ nfa) :
motive i hle next
@[simp]
theorem Regex.VM.eachStepChar.go_base {s : String} {σ : Strategy s} {nfa : NFA} {wf : nfa.WellFormed} {pos : s.ValidPos} {ne : pos s.endValidPos} {current next : SearchState σ nfa} :
go σ nfa wf pos ne current current.states.count next = (none, next)
@[simp]
theorem Regex.VM.eachStepChar.go_done {s : String} {σ : Strategy s} {nfa : NFA} {wf : nfa.WellFormed} {pos : s.ValidPos} {ne : pos s.endValidPos} {current : SearchState σ nfa} {i : } {next : SearchState σ nfa} (hlt : i < current.states.count) (hn : nfa[current.states[i]] = NFA.Node.done) :
go σ nfa wf pos ne current i next = (none, next)
@[simp]
theorem Regex.VM.eachStepChar.go_found {s : String} {σ : Strategy s} {nfa : NFA} {wf : nfa.WellFormed} {pos : s.ValidPos} {ne : pos s.endValidPos} {current : SearchState σ nfa} {i : } {next next' : SearchState σ nfa} {matched : Option σ.Update} (hlt : i < current.states.count) (hn : nfa[current.states[i]] NFA.Node.done) (h : stepChar σ nfa wf pos ne current.updates next current.states[i] = (matched, next')) (found : matched.isSome = true) :
go σ nfa wf pos ne current i next = (matched, next')
@[simp]
theorem Regex.VM.eachStepChar.go_not_found {s : String} {σ : Strategy s} {nfa : NFA} {wf : nfa.WellFormed} {pos : s.ValidPos} {ne : pos s.endValidPos} {current : SearchState σ nfa} {i : } {next next' : SearchState σ nfa} {matched : Option σ.Update} (hlt : i < current.states.count) (hn : nfa[current.states[i]] NFA.Node.done) (h : stepChar σ nfa wf pos ne current.updates next current.states[i] = (matched, next')) (not_found : ¬matched.isSome = true) :
go σ nfa wf pos ne current i next = go σ nfa wf pos ne current (i + 1) next'