Skip to content

Commit 46fb3c5

Browse files
Revert constant replay
1 parent eb92b4f commit 46fb3c5

File tree

3 files changed

+5
-65
lines changed

3 files changed

+5
-65
lines changed

REPL/Snapshots.lean

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -207,33 +207,12 @@ def create (ctx : ContextInfo) (lctx? : Option LocalContext) (prevEnv? : Option
207207
-- update local instances, which is necessary when `types` is non-empty
208208
Meta.withLocalInstances (lctx.decls.toList.filterMap id) do
209209
let goals := goals ++ (← types.mapM fun t => Expr.mvarId! <$> Meta.mkFreshExprMVar (some t))
210-
211-
-- Create a filtered environment that excludes the new (non-auxiliary) declarations
212-
-- Necessary to avoid self-references in proofs in tactic mode, while still allowing
213-
-- auxiliary declarations to be used in the proof.
214-
let coreState ← match prevEnv? with
215-
| none => getThe Core.State
216-
| some prevEnv => do
217-
let declsToFilter := ((← getLCtx).decls.toList.filterMap id).map (·.userName)
218-
let declsToFilterSet : Std.HashSet Name := declsToFilter.foldl (init := {}) fun s n => s.insert n
219-
220-
let currentConsts := ctx.env.constants.map₂.toList
221-
let prevConsts := prevEnv.constants.map₂.toList
222-
let diff := currentConsts.filter (fun (name, _) =>
223-
!prevConsts.any (fun (name', _) => name == name'))
224-
let filteredConstants := diff.filter fun (name, _) => !declsToFilterSet.contains name
225-
226-
-- Print for debugging purposes
227-
IO.println s!"Constants to filter: {declsToFilter}"
228-
IO.println s!"Replayed constants: {filteredConstants.map (·.1)}"
229-
230-
let filteredEnv ← prevEnv.replay (Std.HashMap.ofList filteredConstants)
231-
-- let filteredEnv := prevEnv
232-
let s ← getThe Core.State
233-
pure { s with env := filteredEnv }
234-
210+
let s ← getThe Core.State
211+
let s := match prevEnv? with
212+
| none => s
213+
| some env => { s with env }
235214
pure <|
236-
{ coreState := coreState
215+
{ coreState := s
237216
coreContext := ← readThe Core.Context
238217
metaState := ← getThe Meta.State
239218
metaContext := ← readThe Meta.Context

test/pattern_match.expected.out

Lines changed: 0 additions & 28 deletions
This file was deleted.

test/pattern_match.in

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)