@@ -3,7 +3,7 @@ Copyright (c) 2022 Jannis Limperg. All rights reserved.
3
3
Released under Apache 2.0 license as described in the file LICENSE.
4
4
Authors: Jannis Limperg
5
5
-/
6
-
6
+ import Lean.Replay
7
7
import Aesop.Tracing
8
8
import Aesop.Tree.Tracing
9
9
import Aesop.Tree.TreeM
@@ -52,14 +52,14 @@ local macro "throwPRError " s:interpolatedStr(term) : term =>
52
52
-- ## Copying Declarations
53
53
54
54
private def getNewConsts (oldEnv newEnv : Environment) :
55
- Array ConstantInfo := Id.run do
55
+ HashMap Name ConstantInfo := Id.run do
56
56
let oldMap₂ := oldEnv.constants.map₂
57
57
let newMap₂ := newEnv.constants.map₂
58
58
if oldMap₂.size == newMap₂.size then
59
- #[]
59
+ HashMap.empty
60
60
else
61
- newMap₂.foldl (init := #[] ) λ cs n c =>
62
- if oldMap₂.contains n then cs else cs.push c
61
+ newMap₂.foldl (init := HashMap.empty ) λ cs n c =>
62
+ if oldMap₂.contains n then cs else cs.insert n c
63
63
64
64
-- For each declaration `d` that appears in `newState` but not in
65
65
-- `oldState`, add `d` to the environment. We assume that the environment in
@@ -71,7 +71,7 @@ private def getNewConsts (oldEnv newEnv : Environment) :
71
71
-- identical. (These contain imported decls.)
72
72
private def copyNewDeclarations (oldEnv newEnv : Environment) : CoreM Unit := do
73
73
let newConsts := getNewConsts oldEnv newEnv
74
- setEnv $ newConsts.foldl (init := ← getEnv) λ env c => env.add c
74
+ setEnv (← ( ← getEnv).replay newConsts)
75
75
76
76
open Match in
77
77
private def copyMatchEqnsExtState (oldEnv newEnv : Environment) : CoreM Unit := do
0 commit comments