@@ -29,7 +29,7 @@ in the code base at the moment.
2929-/
3030abbrev EntityLoader.WellBehaved (store: Entities) (loader: EntityLoader) : Prop :=
3131 ∀ s, s ⊆ (loader s).keys ∧
32- EntitiesRefine store ((loader s).mapOnValues EntityDataOption .asPartial)
32+ EntitiesRefine store ((loader s).mapOnValues MaybeEntityData .asPartial)
3333
3434theorem as_partial_request_refines {req : Request} :
3535 RequestRefines req req.asPartialRequest := by
@@ -51,12 +51,12 @@ theorem any_refines_empty_entities :
5151 intro a e₂ h₁
5252 contradiction
5353
54- -- Helper lemma for map append refinementSlicedEntities
54+ -- Helper lemma for map append refinement
5555theorem entities_refine_append (es : Entities) (m1 m2 : PartialEntities) :
5656 EntitiesRefine es m1 → EntitiesRefine es m2 → EntitiesRefine es (m2 ++ m1) := by
5757 intro h1 h2
5858 unfold EntitiesRefine
59- intro a e₂ h_findSlicedEntities
59+ intro a e₂ h_find
6060 rw [Map.find?_append] at h_find
6161 cases h_case : m2.find? a with
6262 | some e₂' =>
@@ -67,21 +67,21 @@ theorem entities_refine_append (es : Entities) (m1 m2 : PartialEntities) :
6767 rw [h_eq]
6868 exact h2 a e₂' h_case
6969 | none =>
70- have h_find1 : m1.find? a = some e₂ := byMaybeEntityData.asPartial
70+ have h_find1 : m1.find? a = some e₂ := by
7171 rw [h_case] at h_find
72- simp only [Option.none_or] at h_fMaybeEntityData.asPartial
73- rw [h_find]MaybeEntityData.asPartial
72+ simp only [Option.none_or] at h_find
73+ rw [h_find]
7474 exact h1 a e₂ h_find1
7575
7676
7777theorem direct_request_and_entities_refine (req : Request) (es : Entities) :
7878 RequestAndEntitiesRefine req es req.asPartialRequest es.asPartial := by
7979 constructor
80- · exact as_partiaMaybeEntityData.asPartial_refines
80+ · exact as_partial_request_refines
8181 · unfold EntitiesRefine Entities.asPartial
8282 intro uid data₂ h_find
8383 have h_mapOnValues := Map.find?_mapOnValues_some' EntityData.asPartial h_find
84- obtain ⟨data₁, h_find₁, h_eq⟩ := h_MaybeEntityData.asPartial
84+ obtain ⟨data₁, h_find₁, h_eq⟩ := h_mapOnValues
8585 exists data₁
8686 exact ⟨h_find₁,
8787 by rw [h_eq]; apply PartialIsValid.some; rfl,
@@ -105,8 +105,8 @@ theorem batched_eval_loop_eq_evaluate
105105 case h_1 => simp only
106106 case h_2 iters n=>
107107 let toLoad := (Set.filter (fun uid => (Map.find? current_store uid).isNone) x.allLiteralUIDs)
108- let newEntities := ((loader toLoad).mapOnValues EntityDataOption .asPartial)
109- let newStore :=SlicedEntitiesrent_store
108+ let newEntities := ((loader toLoad).mapOnValues MaybeEntityData .asPartial)
109+ let newStore := newEntities ++ current_store
110110
111111 have h₀₂ := h₀
112112 specialize h₀₂ toLoad
@@ -120,7 +120,7 @@ theorem batched_eval_loop_eq_evaluate
120120 · unfold RequestAndEntitiesRefine at h₂
121121 exact h₂.right
122122 · apply h₅
123- let newRes := SlicedEntitiesasPartialRequest newStore
123+ let newRes := TPE.evaluate x req.asPartialRequest newStore
124124 have h₇ : (Residual.evaluate newRes req es).toOption = (Residual.evaluate x req es).toOption := by
125125 subst newRes
126126 rw [← partial_evaluate_is_sound h₁ h₃ h₆]
0 commit comments