Opt compile correctness andor
Cedar.Thm.Opt.compile.correctness.andor
Project documentation
Correctness theorem for Opt.compile -- and and or cases
Exact Lean statement
theorem Opt.compile.correctness.andor (x₁ x₂ : Expr) (εnv : SymEnv) :
Opt.compile (.and x₁ x₂) εnv = (do
let term ← SymCC.compile (.and x₁ x₂) εnv
let footprint := footprint (.and x₁ x₂) εnv
.ok { term, footprint }
)
∧
Opt.compile (.or x₁ x₂) εnv = (do
let term ← SymCC.compile (.or x₁ x₂) εnv
let footprint := footprint (.or x₁ x₂) εnv
.ok { term, footprint }
)Formal artifact
Lean source
theorem Opt.compile.correctness.andor (x₁ x₂ : Expr) (εnv : SymEnv) : Opt.compile (.and x₁ x₂) εnv = (do let term ← SymCC.compile (.and x₁ x₂) εnv let footprint := footprint (.and x₁ x₂) εnv .ok { term, footprint } ) ∧ Opt.compile (.or x₁ x₂) εnv = (do let term ← SymCC.compile (.or x₁ x₂) εnv let footprint := footprint (.or x₁ x₂) εnv .ok { term, footprint } ):= by constructor all_goals { simp [Opt.compile, SymCC.compile, footprint] rw [Opt.compile.correctness x₁ εnv, Opt.compile.correctness x₂ εnv] simp [Opt.compileAnd, SymCC.compileAnd, Opt.compileOr, SymCC.compileOr, footprint.ofBranch, EmptyCollection.emptyCollection] cases h₁ : SymCC.compile x₁ εnv <;> simp only [Except.bind_ok, Except.bind_err] case ok t₁ => cases h₂ : SymCC.compile x₂ εnv <;> simp only [Except.bind_ok, Except.bind_err] case error e => split <;> simp [*] case ok t₂ => split <;> simp [*] split <;> simp at * split <;> simp [*] first | rw [Data.Set.union_empty_right (Data.Set.union_wf _ _)] | rw [Data.Set.union_empty_right (footprint_wf _ _)] }- Project
- Cedar Specification
- License
- Apache-2.0
- Commit
- 3f093947b8ae
- Source
- cedar-lean/Cedar/Thm/SymCC/Opt/Compiler.lean:821-850
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.