Documentation

RegexCorrectness.NFA.Semantics.ProofData.Loop

Consider nfa' := nfa.pushRegex next e. When there is a path in nfa' from nfa'.start to next, it must have looped nfaExpr before n times, followed by the last step from nfa'.start to next.

A Loop term corresponds to such a loop. The last variant corresponds to the last step, and the loop variant extracts the first iteration and the remaining loop.

Instances For
    theorem Regex.NFA.Compile.ProofData.Star.Loop.introAux [Star] {i : } {it : String.Iterator} {j : } {it' : String.Iterator} {update : List ( × String.Pos)} (lt : i < nfa'.nodes.size) (wf : nfa.WellFormed) (next_lt : next < nfa.nodes.size) (eqj : j = next) (path : nfa'.Path nfa.nodes.size i it j it' update) :
    if i = nfa'.start then nfa'.Step nfa.nodes.size nfa'.start it next it' none it' = it update = [] ∃ (itm : String.Iterator) (update₁ : List ( × String.Pos)) (update₂ : List ( × String.Pos)), nfa'.Path nfaPlaceholder.nodes.size nfaExpr.start it nfaPlaceholder.start itm update₁ Loop itm it' update₂ update = update₁ ++ update₂ else ∃ (itm : String.Iterator) (update₁ : List ( × String.Pos)) (update₂ : List ( × String.Pos)), nfa'.Path nfaPlaceholder.nodes.size i it nfaPlaceholder.start itm update₁ Loop itm it' update₂ update = update₁ ++ update₂
    theorem Regex.NFA.Compile.ProofData.Star.Loop.intro [Star] {it it' : String.Iterator} {update : List ( × String.Pos)} (wf : nfa.WellFormed) (next_lt : next < nfa.nodes.size) (path : nfa'.Path nfa.nodes.size nfa'.start it next it' update) :
    Loop it it' update