Skip to content

Commit dedf7a8

Browse files
authored
feat: allow setting reducibilityCoreExt in async contexts (#11301)
This PR allows setting reducibilityCoreExt in async contexts (e.g. when using `mkSparseCasesOn` in a realizable definition)
1 parent 0133586 commit dedf7a8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Lean/ReducibilityAttrs.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ builtin_initialize reducibilityCoreExt : PersistentEnvExtension (Name × Reducib
3636
statsFn := fun s => "reducibility attribute core extension" ++ Format.line ++ "number of local entries: " ++ format s.size
3737
-- attribute is set by `addPreDefinitions`
3838
asyncMode := .async .asyncEnv
39+
replay? := some <| fun _oldState newState newItems otherState =>
40+
newItems.foldl (init := otherState) fun otherState k =>
41+
if let some v := newState.find? k then
42+
otherState.insert k v
43+
else
44+
otherState
3945
}
4046

4147
builtin_initialize reducibilityExtraExt : SimpleScopedEnvExtension (Name × ReducibilityStatus) (SMap Name ReducibilityStatus) ←

0 commit comments

Comments
 (0)