Project documentation
The lemma shows that interpret and compile can be applied in any order to get the same result. In particular, let x be an expression, εnv a well-formed symbolic environment for x, and I a well-formed interpretion for εnv. Then, compiling x with respect to (εnv.interpret I) gives the same result as interpreting the output of compiling x...
Exact Lean statement
theorem compile_interpret {x : Expr} {εnv : SymEnv} {I : Interpretation} {t : Term} :
I.WellFormed εnv.entities →
εnv.WellFormedFor x →
compile x εnv = .ok t →
compile x (εnv.interpret I) = .ok (t.interpret I)Formal artifact
Lean source
theorem compile_interpret {x : Expr} {εnv : SymEnv} {I : Interpretation} {t : Term} : I.WellFormed εnv.entities → εnv.WellFormedFor x → compile x εnv = .ok t → compile x (εnv.interpret I) = .ok (t.interpret I):= by intros h₁ h₂ h₃ match x with | .lit _ => exact compile_interpret_lit h₃ | .var _ => exact compile_interpret_var h₁ h₂ h₃ | .ite x₁ x₂ x₃ => have ih₁ := @compile_interpret x₁ have ih₂ := @compile_interpret x₂ have ih₃ := @compile_interpret x₃ exact compile_interpret_ite h₁ h₂ h₃ ih₁ ih₂ ih₃ | .and x₁ x₂ => have ih₁ := @compile_interpret x₁ have ih₂ := @compile_interpret x₂ exact compile_interpret_and h₁ h₂ h₃ ih₁ ih₂ | .or x₁ x₂ => have ih₁ := @compile_interpret x₁ have ih₂ := @compile_interpret x₂ exact compile_interpret_or h₁ h₂ h₃ ih₁ ih₂ | .unaryApp _ x₁ => have ih₁ := @compile_interpret x₁ exact compile_interpret_unaryApp h₁ h₂ h₃ ih₁ | .binaryApp _ x₁ x₂ => have ih₁ := @compile_interpret x₁ have ih₂ := @compile_interpret x₂ exact compile_interpret_binaryApp h₁ h₂ h₃ ih₁ ih₂ | .getAttr x₁ _ => have ih₁ := @compile_interpret x₁ exact compile_interpret_getAttr h₁ h₂ h₃ ih₁ | .hasAttr x₁ _ => have ih₁ := @compile_interpret x₁ exact compile_interpret_hasAttr h₁ h₂ h₃ ih₁ | .set xs => have ih : ∀ xᵢ ∈ xs, CompileInterpret xᵢ := by intro xᵢ _ exact @compile_interpret xᵢ exact compile_interpret_set h₁ h₂ h₃ ih | .record axs => have ih : ∀ aᵢ xᵢ, (aᵢ, xᵢ) ∈ axs → CompileInterpret xᵢ := by intro aᵢ xᵢ h have _ : sizeOf xᵢ < 1 + sizeOf axs := List.sizeOf_snd_lt_sizeOf_list h exact @compile_interpret xᵢ exact compile_interpret_record h₁ h₂ h₃ ih | .call _ xs => have ih : ∀ xᵢ ∈ xs, CompileInterpret xᵢ := by intro xᵢ _ exact @compile_interpret xᵢ exact compile_interpret_call h₁ h₂ h₃ ih- Project
- Cedar Specification
- License
- Apache-2.0
- Commit
- 3f093947b8ae
- Source
- cedar-lean/Cedar/Thm/SymCC/Compiler.lean:108-159
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.