Documentation

Cedar.Thm.SymCC.Compiler.Attr

This file proves the compilation lemmas for .hasAttr and .getAttr expressions. #

theorem Cedar.Thm.compile_evaluate_hasAttr {x₁ : Spec.Expr} {a : Spec.Attr} {env : Spec.Env} {εnv : SymCC.SymEnv} {t : SymCC.Term} (heq : env ∼ εnv) (hwe : env.WellFormedFor (x₁.hasAttr a)) (hwε : εnv.WellFormedFor (x₁.hasAttr a)) (hok : SymCC.compile (x₁.hasAttr a) εnv = Except.ok t) (ih : CompileEvaluate x₁) :
theorem Cedar.Thm.compile_evaluate_getAttr_record {a : Spec.Attr} {v₁ : Spec.Value} {es : Spec.Entities} {εs : SymCC.SymEntities} {t₁ t₂ : SymCC.Term} {ty₁ tyₐ : SymCC.TermType} {rty rty' : Data.Map Spec.Attr SymCC.TermType} (hwφ₁ : SymCC.Term.WellFormed εs t₁) (hty₁ : t₁.typeOf = ty₁.option) (hwo : SymCC.Term.WellFormed εs (SymCC.Factory.option.get t₁) ∧ (SymCC.Factory.option.get t₁).typeOf = SymCC.TermType.record rty') (hwφ₂ : SymCC.Term.WellFormed εs t₂) (htyₐ : t₂.typeOf = tyₐ.option) (ha : RecordGetAttr t₂ (SymCC.Factory.option.get t₁) rty a) (ih : Except.ok v₁ ∼ t₁) :
theorem Cedar.Thm.compile_evaluate_getAttr_entity {a : Spec.Attr} {v₁ : Spec.Value} {es : Spec.Entities} {εs : SymCC.SymEntities} {t₁ t₂ : SymCC.Term} {fₐ : SymCC.UnaryFunction} {ety : Spec.EntityType} {tyₐ : SymCC.TermType} {rty : Data.Map Spec.Attr SymCC.TermType} (heq : SymCC.SameEntities es εs) (hwε : εs.WellFormed) (hwf₁ : Spec.Value.WellFormed es v₁) (hwφ₁ : SymCC.Term.WellFormed εs t₁) (hty₁ : t₁.typeOf = (SymCC.TermType.entity ety).option) (hwo : SymCC.Term.WellFormed εs (SymCC.Factory.option.get t₁) ∧ (SymCC.Factory.option.get t₁).typeOf = SymCC.TermType.entity ety) (hwφ₂ : SymCC.Term.WellFormed εs t₂) (htyₐ : t₂.typeOf = tyₐ.option) (hf : εs.attrs ety = some fₐ) (ha : RecordGetAttr t₂ (SymCC.Factory.app fₐ (SymCC.Factory.option.get t₁)) rty a) (ih : Except.ok v₁ ∼ t₁) :
theorem Cedar.Thm.compile_evaluate_getAttr {x₁ : Spec.Expr} {a : Spec.Attr} {env : Spec.Env} {εnv : SymCC.SymEnv} {t : SymCC.Term} (heq : env ∼ εnv) (hwe : env.WellFormedFor (x₁.getAttr a)) (hwε : εnv.WellFormedFor (x₁.getAttr a)) (hok : SymCC.compile (x₁.getAttr a) εnv = Except.ok t) (ih : CompileEvaluate x₁) :
theorem Cedar.Thm.compileGetAttr_ok_typeOf_eq {t t₁ t₂ t₃ : SymCC.Term} {a : Spec.Attr} {εs : SymCC.SymEntities} (hwε : εs.WellFormed) (hw₁ : SymCC.Term.WellFormed εs t₁) (hw₂ : SymCC.Term.WellFormed εs t₂) (hty : t₁.typeOf = t₂.typeOf) (hok₁ : SymCC.compileGetAttr t₁ a εs = Except.ok t) (hok₂ : SymCC.compileGetAttr t₂ a εs = Except.ok t₃) :
t₃.typeOf = t.typeOf