Compile well typed on wf expr
compile_well_typed_on_wf_expr
Plain-language statement
Compiling a well-typed expression should produce a term of the corresponding TermType, assuming that the expression is well-formed in the symbolic environment.
Exact Lean statement
theorem compile_well_typed_on_wf_expr {Γ : TypeEnv} {εnv : SymEnv} {tx : TypedExpr} :
CompileWellTypedCondition tx Γ εnv →
CompileWellTyped tx εnvFormal artifact
Lean source
theorem compile_well_typed_on_wf_expr {Γ : TypeEnv} {εnv : SymEnv} {tx : TypedExpr} : CompileWellTypedCondition tx Γ εnv → CompileWellTyped tx εnv:= by intros h cases tx case lit => exact compile_well_typed_lit h case var => exact compile_well_typed_var h case ite => have ⟨h1, h2, h3⟩ := h.eliminate_ite apply compile_well_typed_ite any_goals apply CompileWellTyped.add_wf any_goals apply compile_well_typed_on_wf_expr any_goals assumption case and => have ⟨ha, hb⟩ := h.eliminate_or_and ?_ apply (compile_well_typed_or_and ?_ ?_).right any_goals apply CompileWellTyped.add_wf any_goals apply compile_well_typed_on_wf_expr any_goals assumption any_goals simp case or => have ⟨ha, hb⟩ := h.eliminate_or_and ?_ apply (compile_well_typed_or_and ?_ ?_).left any_goals apply CompileWellTyped.add_wf any_goals apply compile_well_typed_on_wf_expr any_goals assumption any_goals simp case unaryApp => have hcond := h.eliminate_unaryApp apply compile_well_typed_unaryApp any_goals apply CompileWellTyped.add_wf any_goals apply compile_well_typed_on_wf_expr all_goals assumption case binaryApp => have ⟨ha, hb⟩ := h.eliminate_binaryApp apply compile_well_typed_binaryApp any_goals apply CompileWellTyped.add_wf any_goals apply compile_well_typed_on_wf_expr any_goals assumption case getAttr => have hcond := h.eliminate_getAttr apply compile_well_typed_getAttr any_goals apply CompileWellTyped.add_wf any_goals apply compile_well_typed_on_wf_expr all_goals assumption case hasAttr => have hcond := h.eliminate_hasAttr apply compile_well_typed_hasAttr any_goals apply CompileWellTyped.add_wf any_goals apply compile_well_typed_on_wf_expr all_goals assumption case set => have hcond := h.eliminate_set apply compile_well_typed_set · intros x hx apply CompileWellTyped.add_wf apply compile_well_typed_on_wf_expr (hcond x hx) apply hcond assumption assumption case record => have hcond := h.eliminate_record apply compile_well_typed_record · intros a x hx apply CompileWellTyped.add_wf apply compile_well_typed_on_wf_expr (hcond a x hx) apply hcond assumption assumption case call => have hcond := h.eliminate_call apply compile_well_typed_call · intros x hx apply CompileWellTyped.add_wf apply compile_well_typed_on_wf_expr (hcond x hx) apply hcond assumption assumption decreasing_by repeat case _ => simp [*]; omega -- Set · simp [*] have h := List.sizeOf_lt_of_mem hx omega -- Record · simp [*] have h := List.sizeOf_snd_lt_sizeOf_list hx simp at h omega -- Call · simp [*] have h := List.sizeOf_lt_of_mem hx omega- Project
- Cedar Specification
- License
- Apache-2.0
- Commit
- 3f093947b8ae
- Source
- cedar-lean/Cedar/Thm/SymCC/Compiler/WellTyped.lean:1475-1569
Reuse this declaration
Bring the exact result into your workflow
The import identifies the source module. Your project still needs the pinned package dependency shown on this page.
What this badge means
This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.
Continue in this project
Related declarations
Find? ext
Cedar.Data.Map.find?_ext
Plain-language statement
Two well-formed maps are equal if they have the same find? for every key.
Source project: Cedar Specification
Person-level attribution pending.
Find? notmem keys
Cedar.Data.Map.find?_notmem_keys
Plain-language statement
Inverse of find?_mem_toList, except that this requires wf
Source project: Cedar Specification
Person-level attribution pending.
Find? some iff in values
Cedar.Data.Map.find?_some_iff_in_values
Plain-language statement
The mp direction of this does not need the wf precondition and, in fact, is available separately as find?_some_implies_in_values above
Source project: Cedar Specification
Person-level attribution pending.