Documentation

RegexCorrectness.VM.Search.Basic

theorem Regex.VM.captureNext.go.induct' (σ : Strategy) (nfa : NFA) (wf : nfa.WellFormed) (motive : String.IteratorOption σ.UpdateSearchState σ nfaSearchState σ nfaProp) (not_found : ∀ (it : String.Iterator) (matched : Option σ.Update) (current next : SearchState σ nfa), it.atEnd = truemotive it matched current next) (found : ∀ (it : String.Iterator) (matched : Option σ.Update) (current next : SearchState σ nfa), ¬it.atEnd = truecurrent.states.isEmpty = truematched.isSome = truemotive it matched current next) (ind_not_found : ∀ (it : String.Iterator) (matched : Option σ.Update) (current next : SearchState σ nfa), let stepped := eachStepChar σ nfa wf it current next; let expanded := εClosure σ nfa wf it.next none stepped.2 [(σ.empty, nfa.start, )]; ¬it.atEnd = truematched = nonestepped.1 = nonemotive it.next expanded.1 expanded.2 { states := current.states.clear, updates := current.updates }motive it matched current next) (ind_found : ∀ (it : String.Iterator) (matched : Option σ.Update) (current next : SearchState σ nfa), let stepped := eachStepChar σ nfa wf it current next; ¬it.atEnd = true(matched.isSome = true¬current.states.isEmpty = true)matched.isSome = true stepped.1.isSome = truemotive it.next (stepped.1 <|> matched) stepped.2 { states := current.states.clear, updates := current.updates }motive it matched current next) (it : String.Iterator) (matched : Option σ.Update) (current next : SearchState σ nfa) :
motive it matched current next
@[simp]
theorem Regex.VM.captureNext.go_not_found {σ : Strategy} {nfa : NFA} {wf : nfa.WellFormed} {it : String.Iterator} {matched : Option σ.Update} {current next : SearchState σ nfa} (atEnd : it.atEnd = true) :
go σ nfa wf it matched current next = matched
@[simp]
theorem Regex.VM.captureNext.go_found {σ : Strategy} {nfa : NFA} {wf : nfa.WellFormed} {it : String.Iterator} {matched : Option σ.Update} {current next : SearchState σ nfa} (atEnd : ¬it.atEnd = true) (isEmpty : current.states.isEmpty = true) (isSome : matched.isSome = true) :
go σ nfa wf it matched current next = matched
@[simp]
theorem Regex.VM.captureNext.go_ind_not_found {σ : Strategy} {nfa : NFA} {wf : nfa.WellFormed} {it : String.Iterator} {matched : Option σ.Update} {current next : SearchState σ nfa} (stepped expanded : Option σ.Update × SearchState σ nfa) (eq₁ : stepped = eachStepChar σ nfa wf it current next) (eq₂ : expanded = εClosure σ nfa wf it.next none stepped.2 [(σ.empty, nfa.start, )]) (atEnd : ¬it.atEnd = true) (isNone₁ : matched = none) (isNone₂ : stepped.1 = none) :
go σ nfa wf it matched current next = go σ nfa wf it.next expanded.1 expanded.2 { states := current.states.clear, updates := current.updates }
@[simp]
theorem Regex.VM.captureNext.go_ind_found {σ : Strategy} {nfa : NFA} {wf : nfa.WellFormed} {it : String.Iterator} {matched : Option σ.Update} {current next : SearchState σ nfa} (stepped : Option σ.Update × SearchState σ nfa) (eq : stepped = eachStepChar σ nfa wf it current next) (atEnd : ¬it.atEnd = true) (hemp : matched.isSome = true¬current.states.isEmpty = true) (isSome : matched.isSome = true stepped.1.isSome = true) :
go σ nfa wf it matched current next = go σ nfa wf it.next (stepped.1 <|> matched) stepped.2 { states := current.states.clear, updates := current.updates }