instantiate mvar,
mspec with a precondition like fun s => s = states ∧ P gives a uninstantiated mvar
Equations
- Compiler.Lemmas.tacticInst_mvar = Lean.ParserDescr.node `Compiler.Lemmas.tacticInst_mvar 1024 (Lean.ParserDescr.nonReservedSymbol "inst_mvar" false)
Instances For
instantiate mvars,
mspec with a precondition like fun s => s = states ∧ P gives a uninstantiated mvar
Equations
- Compiler.Lemmas.tacticInst_mvars = Lean.ParserDescr.node `Compiler.Lemmas.tacticInst_mvars 1024 (Lean.ParserDescr.nonReservedSymbol "inst_mvars" false)
Instances For
Instances For
@[simp]
theorem
Compiler.Lemmas.isAppend_trans
{s1 s2 s3 : Array NFA.Unchecked.State}
(h1 : isAppend s1 s2)
(h2 : isAppend s2 s3)
:
isAppend s1 s3
Instances For
Equations
- Compiler.Lemmas.statesNextOfLeLt prevs s = (prevs.size ≤ s.size ∧ Compiler.NextOfLt s)
Instances For
def
Compiler.Lemmas.stateIdNextOfLt
(prevs : Array NFA.Unchecked.State)
(sid : NFA.Unchecked.StateID)
(s : Array NFA.Unchecked.State)
:
Equations
- Compiler.Lemmas.stateIdNextOfLt prevs sid s = (prevs.size < s.size ∧ sid < s.size ∧ Compiler.NextOfLt s)
Instances For
def
Compiler.Lemmas.stateIdNextOfLeLt
(prevs : Array NFA.Unchecked.State)
(sid : NFA.Unchecked.StateID)
(s : Array NFA.Unchecked.State)
:
Equations
- Compiler.Lemmas.stateIdNextOfLeLt prevs sid s = (prevs.size ≤ s.size ∧ sid < s.size ∧ Compiler.NextOfLt s)
Instances For
def
Compiler.Lemmas.stateIdNextOfEqLt
(prevs : Array NFA.Unchecked.State)
(sid : NFA.Unchecked.StateID)
(s : Array NFA.Unchecked.State)
:
Equations
- Compiler.Lemmas.stateIdNextOfEqLt prevs sid s = (prevs.size = s.size ∧ sid < s.size ∧ Compiler.NextOfLt s)
Instances For
def
Compiler.Lemmas.tRefNextOfLt
(prevs : Array NFA.Unchecked.State)
(t : ThompsonRef)
(s : Array NFA.Unchecked.State)
:
Equations
- Compiler.Lemmas.tRefNextOfLt prevs t s = (prevs.size < s.size ∧ Compiler.Lemmas.tRefLt t s ∧ Compiler.NextOfLt s)
Instances For
def
Compiler.Lemmas.tRefNextOfLeLt
(prevs : Array NFA.Unchecked.State)
(t : ThompsonRef)
(s : Array NFA.Unchecked.State)
:
Equations
- Compiler.Lemmas.tRefNextOfLeLt prevs t s = (prevs.size ≤ s.size ∧ Compiler.Lemmas.tRefLt t s ∧ Compiler.NextOfLt s)
Instances For
Equations
- Compiler.Lemmas.cValid caps = NFA.Capture.Valid caps
Instances For
Equations
- Compiler.Lemmas.cMemAndValid prev caps = ((∀ (a : NFA.Capture), a ∈ prev → a ∈ caps) ∧ NFA.Capture.Valid caps)
Instances For
Equations
- Compiler.Lemmas.cValidFunc captures curr = (curr = captures ∧ Compiler.Lemmas.cValid captures)
Instances For
Equations
- Compiler.Lemmas.cMemAndValidFunc captures curr = (curr = captures ∧ Compiler.Lemmas.cMemAndValid captures curr)
Instances For
theorem
Compiler.Lemmas.cap_exists_of_cap_role_end_of_cValid
(caps : Array NFA.Capture)
(h : cValid caps)
(a : NFA.Capture)
(h1 : a ∈ caps)
(h2 : a.role = NFA.Capture.Role.End)
:
theorem
Compiler.Lemmas.cValid_of_empty
(captures : Array NFA.Capture)
(h : captures.size = 0)
:
cValid captures
theorem
Compiler.Lemmas.cValid_of_cMemAndValid
(prevs caps : Array NFA.Capture)
(h : cMemAndValid prevs caps)
:
cValid caps
@[simp]
theorem
Compiler.Lemmas.cMemAndValid_of_cValid_of_eq
(captures s : Array NFA.Capture)
:
s = captures ∧ cValid captures → cMemAndValid captures s
@[simp]
theorem
Compiler.Lemmas.cMemAndValid_of_push_of_role_start
(captures : Array NFA.Capture)
(capture : NFA.Capture)
(hr : capture.role = NFA.Capture.Role.Start)
(hc : cValid captures)
:
cMemAndValid captures (captures.push capture)
theorem
Compiler.Lemmas.cMemAndValid_of_push_of_role_end
(captures : Array NFA.Capture)
(capture : NFA.Capture)
(hc : cValid captures)
(h : ∃ (c : NFA.Capture), c ∈ captures ∧ c.role = NFA.Capture.Role.Start ∧ c.group = capture.group)
:
cMemAndValid captures (captures.push capture)
@[simp]
theorem
Compiler.Lemmas.cMemAndValidFunc_of_cValidFunc
(captures s : Array NFA.Capture)
:
cValidFunc captures s → cMemAndValidFunc captures s
theorem
Compiler.Lemmas.coe_spec_EStateM_to_EStateM_Prod
{ε σ₁ α σ₂ : Type}
(σ₃ : Type)
{v₁ : EStateM ε σ₁ α}
{P₁ : σ₁ → Prop}
{Q₁ : α → σ₁ → Prop}
(hspec₁ : ⦃fun (s : σ₁) => ⌜P₁ s⌝⦄ v₁ ⦃(fun (a : α) (s : σ₁) => ⌜Q₁ a s⌝, fun (x : ε) => ⌜False⌝, ())⦄)
(P₂ Q₂ : σ₂ → Prop)
(hpq : ∀ (s : σ₂), P₂ s → Q₂ s)
:
theorem
Compiler.Lemmas.coe_spec_EStateM_to_CompilerM
{ε σ₁ α : Type}
{captures : Array NFA.Capture}
{v₁ : EStateM ε σ₁ α}
{P₁ : σ₁ → Prop}
{Q₁ : α → σ₁ → Prop}
(hspec₁ : ⦃fun (s : σ₁) => ⌜P₁ s⌝⦄ v₁ ⦃(fun (a : α) (s : σ₁) => ⌜Q₁ a s⌝, fun (x : ε) => ⌜False⌝, ())⦄)
:
⦃fun (s : σ₁ × Array NFA.Capture × Array Nat) => ⌜P₁ s.fst ∧ s.snd.fst = captures ∧ cValid captures⌝⦄ liftM
v₁ ⦃(fun (r : α) (s : σ₁ × Array NFA.Capture × Array Nat) =>
⌜Q₁ r s.fst ∧ s.snd.fst = captures ∧ cMemAndValid captures s.snd.fst⌝, fun (x : ε) (x_1 : σ₁ × Array NFA.Capture × Array Nat) => ⌜False⌝, ())⦄
theorem
Compiler.Lemmas.coe_spec_StateT_to_CompilerM
{σ₁ α ε : Type}
{captures : Array NFA.Capture}
{v : StateT σ₁ Id α}
{P₁ : σ₁ → Prop}
{Q₁ : α → σ₁ → Prop}
(hspec : ⦃fun (s : σ₁) => ⌜P₁ s⌝⦄ v ⦃(fun (a : α) (s : σ₁) => ⌜Q₁ a s⌝, ())⦄)
:
⦃fun (s : σ₁ × Array NFA.Capture × Array Nat) => ⌜P₁ s.fst ∧ s.snd.fst = captures ∧ cValid captures⌝⦄ liftM
v ⦃(fun (r : α) (s : σ₁ × Array NFA.Capture × Array Nat) =>
⌜Q₁ r s.fst ∧ s.snd.fst = captures ∧ cMemAndValid captures s.snd.fst⌝, fun (x : ε) (x_1 : σ₁ × Array NFA.Capture × Array Nat) => ⌜False⌝, ())⦄
theorem
Compiler.Lemmas.lift_CompilerM_bind_pure
{ε σ α : Type}
[MonadLiftT (EStateM ε σ) Code.CompilerM]
(x : EStateM ε σ α)
:
theorem
Compiler.Lemmas.nextOf_transition_le_of_le
(states : Array NFA.Unchecked.State)
(trans : Array NFA.Unchecked.Transition)
(h : ∀ (i : Nat) (x : i < trans.size), trans[i].next ≤ states.size)
: