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] {s : String} {pos pos' : s.ValidPos} {i j : } {update : List ( × s.ValidPos)} (lt : i < nfa'.nodes.size) (wf : nfa.WellFormed) (next_lt : next < nfa.nodes.size) (eqj : j = next) (path : nfa'.Path nfa.nodes.size i pos j pos' update) :
    if i = nfa'.start then nfa'.Step nfa.nodes.size nfa'.start pos next pos' none pos' = pos update = [] ∃ (posm : s.ValidPos) (update₁ : List ( × s.ValidPos)) (update₂ : List ( × s.ValidPos)), nfa'.Path nfaPlaceholder.nodes.size nfaExpr.start pos nfaPlaceholder.start posm update₁ Loop posm pos' update₂ update = update₁ ++ update₂ else ∃ (posm : s.ValidPos) (update₁ : List ( × s.ValidPos)) (update₂ : List ( × s.ValidPos)), nfa'.Path nfaPlaceholder.nodes.size i pos nfaPlaceholder.start posm update₁ Loop posm pos' update₂ update = update₁ ++ update₂
    theorem Regex.NFA.Compile.ProofData.Star.Loop.intro [Star] {s : String} {pos pos' : s.ValidPos} {update : List ( × s.ValidPos)} (wf : nfa.WellFormed) (next_lt : next < nfa.nodes.size) (path : nfa'.Path nfa.nodes.size nfa'.start pos next pos' update) :
    Loop pos pos' update