Lemmas #
Proof that Compiler.Code.compile gives an array with the Compiler.NextOfLt and Capture.Valid
property and has no exceptions
c_compile_spec: main result
theorem Compiler.Lemmas.c_compile_spec (anchored : Bool) (hir : Regex.Syntax.Hir) :
⦃ fun (s : Array NFA.Unchecked.State × Array NFA.Capture × Array Nat) => s.fst.size = 0 ∧ s.snd.fst.size = 0 ⦄ Code.compile anchored hir ⦃ fun (x : Unit) (s : Array NFA.Unchecked.State × Array NFA.Capture × Array Nat) =>
NextOfLt s.fst ∧ cValid s.snd.fst; fun (x : String) (x_1 : Array NFA.Unchecked.State × Array NFA.Capture × Array Nat) => False ⦄
theorem Compiler.Lemmas.compile_nextOf_lt {states : Array NFA.Unchecked.State} {captures : Array NFA.Capture} {groups : Array Nat} {anchored : Bool} {expr : Regex.Syntax.Hir} (h : Code.compile anchored expr (#[], #[], #[]) = EStateM.Result.ok () (states, captures, groups)) :
NextOfLt states
theorem Compiler.Lemmas.compile_captures_valid {states : Array NFA.Unchecked.State} {captures : Array NFA.Capture} {groups : Array Nat} {anchored : Bool} {expr : Regex.Syntax.Hir} (h : Code.compile anchored expr (#[], #[], #[]) = EStateM.Result.ok () (states, captures, groups)) :
NFA.Capture.Valid captures