All proofs
Project-declaredLean 4.31.0 · null

Compile evaluate

Cedar.Thm.compile_evaluate

Project documentation

The lemma shows that the symbolic compiler (compile) behaves like the concrete evaluator (evaluate) on literal inputs. In particular, let x be an expression, εnv a well-formed symbolic environment for x, and env a well-formed concrete environment for x that is equivalent to εnv. Then, the result produced by the symbolic compiler on x and...

Exact Lean statement

theorem compile_evaluate {x : Expr} {env : Env} {εnv : SymEnv} {t : Term} :
  env ∼ εnv →
  env.WellFormedFor x →
  εnv.WellFormedFor x →
  compile x εnv = .ok t →
  evaluate x env.request env.entities ∼ t

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
theorem compile_evaluate {x : Expr} {env : Env} {εnv : SymEnv} {t : Term} :  env ∼ εnv   env.WellFormedFor x   εnv.WellFormedFor x   compile x εnv = .ok t   evaluate x env.request env.entities ∼ t:= by  intros h₁ h₂ h₃ h₄  match x with  | .lit _             => exact compile_evaluate_lit h₄  | .var _             => exact compile_evaluate_var h₁ h₄  | .ite x₁ x₂ x₃      =>    have ih₁ := @compile_evaluate x₁    have ih₂ := @compile_evaluate x₂    have ih₃ := @compile_evaluate x₃    exact compile_evaluate_ite h₁ h₂ h₃ h₄ ih₁ ih₂ ih₃  | .and x₁ x₂         =>    have ih₁ := @compile_evaluate x₁    have ih₂ := @compile_evaluate x₂    exact compile_evaluate_and h₁ h₂ h₃ h₄ ih₁ ih₂  | .or x₁ x₂          =>    have ih₁ := @compile_evaluate x₁    have ih₂ := @compile_evaluate x₂    exact compile_evaluate_or h₁ h₂ h₃ h₄ ih₁ ih₂  | .unaryApp _ x₁     =>    have ih₁ := @compile_evaluate x₁    exact compile_evaluate_unaryApp h₁ h₂ h₃ h₄ ih₁  | .binaryApp _ x₁ x₂ =>    have ih₁ := @compile_evaluate x₁    have ih₂ := @compile_evaluate x₂    exact compile_evaluate_binaryApp h₁ h₂ h₃ h₄ ih₁ ih₂  | .getAttr x₁ _     =>    have ih₁ := @compile_evaluate x₁    exact compile_evaluate_getAttr h₁ h₂ h₃ h₄ ih₁  | .hasAttr x₁ _     =>    have ih₁ := @compile_evaluate x₁    exact compile_evaluate_hasAttr h₁ h₂ h₃ h₄ ih₁  | .set xs           =>    have ih :  xᵢ  xs, CompileEvaluate xᵢ := by      intro xᵢ _      exact @compile_evaluate xᵢ    exact compile_evaluate_set h₁ h₂ h₃ h₄ ih  | .record axs      =>    have ih :  aᵢ xᵢ, (aᵢ, xᵢ)  axs  CompileEvaluate xᵢ := by      intro aᵢ xᵢ h      have _ : sizeOf xᵢ < 1 + sizeOf axs := List.sizeOf_snd_lt_sizeOf_list h      exact @compile_evaluate xᵢ    exact compile_evaluate_record h₁ h₂ h₃ h₄ ih  | .call _ xs       =>    have ih :  xᵢ  xs, CompileEvaluate xᵢ := by      intro xᵢ _      exact @compile_evaluate xᵢ    exact compile_evaluate_call h₁ h₂ h₃ h₄ ih
Project
Cedar Specification
License
Apache-2.0
Commit
3f093947b8ae
Source
cedar-lean/Cedar/Thm/SymCC/Compiler.lean:47-99

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

Project-declaredLean 4.31.0

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.

authorizationprogram verificationsemantics

Source project: Cedar Specification

Person-level attribution pending.

View proof record
Project-declaredLean 4.31.0

Find? notmem keys

Cedar.Data.Map.find?_notmem_keys

Plain-language statement

Inverse of find?_mem_toList, except that this requires wf

authorizationprogram verificationsemantics

Source project: Cedar Specification

Person-level attribution pending.

View proof record
Project-declaredLean 4.31.0

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

authorizationprogram verificationsemantics

Source project: Cedar Specification

Person-level attribution pending.

View proof record