Skip to content

Commit 0bd8465

Browse files
authored
chore: bump to v4.2.0-rc2 (#72)
* fix: use replay from leanprover/lean4#2617 * chore: adapt to leanprover/lean4#2621 * bump to v4.2.0-rc2
1 parent 831865d commit 0bd8465

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

Aesop/Search/Expansion/Simp.lean

+5-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,12 @@ def mkSimpOnly (stx : Syntax) (usedSimps : UsedSimps) (includeFVars : Bool) :
4444
let env ← getEnv
4545
for (thm, _) in usedSimps.toArray.qsort (·.2 < ·.2) do
4646
match thm with
47-
| .decl declName => -- global definitions in the environment
47+
| .decl declName inv => -- global definitions in the environment
4848
if env.contains declName && !Lean.Elab.Tactic.simpOnlyBuiltins.contains declName then
49-
args := args.push (← `(Parser.Tactic.simpLemma| $(mkIdent (← unresolveNameGlobal declName)):ident))
49+
args := args.push (← if inv then
50+
`(Parser.Tactic.simpLemma| ← $(mkIdent (← unresolveNameGlobal declName)):ident)
51+
else
52+
`(Parser.Tactic.simpLemma| $(mkIdent (← unresolveNameGlobal declName)):ident))
5053
| .fvar fvarId => -- local hypotheses in the context
5154
if ! includeFVars then
5255
continue

Aesop/Tree/ExtractProof.lean

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2022 Jannis Limperg. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Jannis Limperg
55
-/
6-
6+
import Lean.Replay
77
import Aesop.Tracing
88
import Aesop.Tree.Tracing
99
import Aesop.Tree.TreeM
@@ -52,14 +52,14 @@ local macro "throwPRError " s:interpolatedStr(term) : term =>
5252
-- ## Copying Declarations
5353

5454
private def getNewConsts (oldEnv newEnv : Environment) :
55-
Array ConstantInfo := Id.run do
55+
HashMap Name ConstantInfo := Id.run do
5656
let oldMap₂ := oldEnv.constants.map₂
5757
let newMap₂ := newEnv.constants.map₂
5858
if oldMap₂.size == newMap₂.size then
59-
#[]
59+
HashMap.empty
6060
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
6363

6464
-- For each declaration `d` that appears in `newState` but not in
6565
-- `oldState`, add `d` to the environment. We assume that the environment in
@@ -71,7 +71,7 @@ private def getNewConsts (oldEnv newEnv : Environment) :
7171
-- identical. (These contain imported decls.)
7272
private def copyNewDeclarations (oldEnv newEnv : Environment) : CoreM Unit := do
7373
let newConsts := getNewConsts oldEnv newEnv
74-
setEnv $ newConsts.foldl (init := ← getEnv) λ env c => env.add c
74+
setEnv (← (← getEnv).replay newConsts)
7575

7676
open Match in
7777
private def copyMatchEqnsExtState (oldEnv newEnv : Environment) : CoreM Unit := do

lake-manifest.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
{"version": 5,
1+
{"version": 6,
22
"packagesDir": "lake-packages",
33
"packages":
44
[{"git":
55
{"url": "https://github.com/leanprover/std4",
66
"subDir?": null,
7-
"rev": "f2df4ab8c0726fce3bafb73a5727336b0c3120ea",
7+
"rev": "85a0d4891518518edfccee16cbceac139efa460c",
88
"opts": {},
99
"name": "std",
1010
"inputRev?": "main",
11-
"inherited": false}}]}
11+
"inherited": false}}],
12+
"name": "aesop"}

lean-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
leanprover/lean4:v4.2.0-rc1
1+
leanprover/lean4:v4.2.0-rc2

0 commit comments

Comments
 (0)