Batched evaluate eq evaluate
Cedar.Thm.batched_evaluate_eq_evaluate
Project documentation
The main correctness theorem for batched evaluation: Batched evaluation with an entity loader produces the same result as normal evaluation with the complete entity store.
Exact Lean statement
theorem batched_evaluate_eq_evaluate
{x : TypedExpr}
{req : Request}
{es : Entities}
{env : TypeEnv} :
EntityLoader.WellBehaved es loader →
TypedExpr.WellTyped env x →
InstanceOfWellFormedEnvironment req es env →
(Residual.evaluate (batchedEvaluate x req loader iters) req es).toOption = (evaluate x.toExpr req es).toOptionFormal artifact
Lean source
theorem batched_evaluate_eq_evaluate {x : TypedExpr} {req : Request} {es : Entities} {env : TypeEnv} : EntityLoader.WellBehaved es loader → TypedExpr.WellTyped env x → InstanceOfWellFormedEnvironment req es env → (Residual.evaluate (batchedEvaluate x req loader iters) req es).toOption = (evaluate x.toExpr req es).toOption := by simp only [batchedEvaluate] intro h₁ h₂ h₃ have h₄ := (direct_request_and_entities_refine req es) have h₅ : Residual.WellTyped env (TypedExpr.toResidual x) := by { apply conversion_preserves_typedness exact h₂ } rw [conversion_preserves_evaluation x req es] rw [partial_evaluate_is_sound h₅ h₃ h₄] have h₆ : Residual.WellTyped env (TPE.evaluate x.toResidual req.asPartialRequest Map.empty) := by apply partial_eval_preserves_well_typed h₃ _ h₅ . constructor . apply as_partial_request_refines . apply any_refines_empty_entities have h₇: RequestAndEntitiesRefine req es req.asPartialRequest Map.empty := by constructor . apply as_partial_request_refines . apply any_refines_empty_entities rw [batched_evaluate_loop_eq_evaluate es h₁ h₆ h₇ h₃] rw [←partial_evaluate_is_sound h₅ h₃ h₇] rw [←partial_evaluate_is_sound h₅ h₃ h₄]- Project
- Cedar Specification
- License
- Apache-2.0
- Commit
- 3f093947b8ae
- Source
- cedar-lean/Cedar/Thm/BatchedEvaluator.lean:22-54
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.