Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: elaborate theorem bodies in parallel #5864

Draft
wants to merge 256 commits into
base: async-proofs-base
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
256 commits
Select commit Hold shift + click to select a range
7e28a50
single promise
Kha Jul 20, 2024
8097c73
porgess
Kha Jul 29, 2024
379b94e
add back
Kha Jul 31, 2024
edd8a81
restore server code
Kha Jul 31, 2024
686f407
more
Kha Jul 31, 2024
c874da0
final
Kha Jul 31, 2024
03a88ec
more
Kha Aug 1, 2024
cfa4752
fix tests
Kha Aug 1, 2024
2e32033
Merge branch 'het-snaps-cmdline' into async-kernel
Kha Aug 2, 2024
aea190b
minimalSnapshots for async linting
Kha Aug 2, 2024
f820121
minimalSnapshots for async TC
Kha Aug 2, 2024
2b7e048
Merge branch 'master' of https://github.com/leanprover/lean4 into asy…
Kha Aug 2, 2024
3bd32d7
fix
Kha Aug 2, 2024
17452b6
go back to theorems only for now
Kha Aug 2, 2024
cc66581
chore: update stage0
Kha Aug 2, 2024
3f3a03e
oops
Kha Aug 3, 2024
23f61d1
disable async linting again
Kha Aug 3, 2024
64673a1
Revert "chore: update stage0"
Kha Aug 5, 2024
d3079a6
cleanup
Kha Aug 6, 2024
bd3003d
Merge branch 'master' of https://github.com/leanprover/lean4 into asy…
Kha Aug 6, 2024
0f5390d
Merge branch 'master' of https://github.com/leanprover/lean4 into asy…
Kha Aug 9, 2024
5a20929
fix trace.Elab.snapshotTree
Kha Aug 9, 2024
41a2b52
Merge branch 'master' of https://github.com/leanprover/lean4 into asy…
Kha Aug 9, 2024
763cd89
fix
Kha Aug 9, 2024
d97a52b
chore: clean up cmdline snapshots logic
Kha Aug 14, 2024
c1044f0
Merge branch 'clean-cmdline-snaps' into async-kernel
Kha Aug 14, 2024
c57f9dd
Merge remote-tracking branch 'upstream/nightly-with-mathlib' into asy…
Kha Aug 16, 2024
d07aad4
clean up async promise use
Kha Aug 16, 2024
5a2ee0f
async kernel test
Kha Aug 16, 2024
0477624
Kernel.Environment
Kha Aug 20, 2024
c06a09c
feat: split `Lean.Kernel.Environment` from `Lean.Environment`
Kha Aug 23, 2024
2d84289
fix deprecation
Kha Aug 24, 2024
dd71ff9
even more deprecations
Kha Aug 26, 2024
90d71bd
fixes
Kha Aug 26, 2024
4c5088e
make sure Kernel.isDefEq/whnf use native reduction
Kha Aug 26, 2024
89cfafe
replace scope_native_reduce_fn with parameter passing
Kha Aug 26, 2024
348b652
update documentation
Kha Aug 27, 2024
fbc7e3e
make setBase private again
Kha Aug 27, 2024
bf2da5e
Merge branch 'kernel-env' into async-proofs
Kha Aug 27, 2024
45ff446
correct prefix restriction, Prelude passes
Kha Aug 27, 2024
efc0772
progess
Kha Aug 30, 2024
b5b9092
traces
Kha Sep 1, 2024
da63230
more
Kha Sep 3, 2024
1c33ad1
feat: IO.getTID
Kha Sep 10, 2024
651f043
feat: thread support for trace.profiler.output
Kha Sep 10, 2024
a4f5866
feat: trace.profiler: unconditionally show times of trace classes ena…
Kha Sep 10, 2024
cdd3265
profile async proofs
Kha Sep 10, 2024
556af07
Elab.block
Kha Sep 11, 2024
5ad9bb1
Merge remote-tracking branch 'upstream/master' into async-proofs
Kha Sep 11, 2024
e90f4de
disable Lake
Kha Sep 12, 2024
a5bcd27
Elab.block cont
Kha Sep 12, 2024
ec67cdd
Avoid some getConstInfos
Kha Sep 12, 2024
c658d6b
AsyncConstantInfo
Kha Sep 12, 2024
367540a
fix variable inclusion in async theorems
Kha Sep 13, 2024
5a52c3a
Merge branch 'upstream/master' into async-proofs
Kha Sep 15, 2024
47dd9d3
fix
Kha Sep 15, 2024
459d0f7
No async processing with late-triggering attrs
Kha Sep 17, 2024
af65397
Disable broken linter for now
Kha Sep 18, 2024
5825496
Global theorems
Kha Sep 18, 2024
d8bc2cb
fixes
Kha Sep 18, 2024
1c829ac
more fixes
Kha Sep 18, 2024
ac12529
more global theorems
Kha Sep 19, 2024
22d939c
even more global theorems
Kha Sep 20, 2024
cad2ff1
this way around is faster
Kha Sep 20, 2024
fc9b8a8
perf: optimize unfolding constant lookup
Kha Sep 21, 2024
17dce45
that's not unfoldable
Kha Sep 23, 2024
a1b2182
optimize Environment.findX
Kha Sep 23, 2024
fee8e84
dbg_trace Environment.setState
Kha Sep 23, 2024
b0c61fe
chore: remove `matcherExt` cache
Kha Oct 1, 2024
ab9d861
revamp async env API
Kha Sep 24, 2024
4aa1d1f
Merge branch 'upstream/nightly-with-mathlib' into async-proofs
Kha Oct 2, 2024
8615c7a
remove dbgStackTrace with panic
Kha Oct 4, 2024
bb9813d
merge push-xwrmupowysmt
Kha Oct 27, 2024
d095f81
async matcherinfo
Kha Oct 7, 2024
1afe0a7
async exportEntriesFn
Kha Oct 7, 2024
4ea6136
postponed compilation
Kha Oct 10, 2024
94d0973
fix async environment access
Kha Oct 11, 2024
4e17aa1
support asyncly added axioms
Kha Oct 11, 2024
9f79c9f
make all SimplePersistentEnvExts async-aware
Kha Oct 11, 2024
5fd0b75
fixes
Kha Oct 11, 2024
29d5c91
fix duplicate exports
Kha Oct 11, 2024
b2a37b2
enable realizations
Kha Oct 11, 2024
995555d
chore: remove dead code
Kha Oct 11, 2024
1faee26
fix section var filtering with async theorems
Kha Oct 11, 2024
2fa3615
fix findNoAsyncTheorem
Kha Oct 11, 2024
7bcef2f
reserved name action for preprocessed simp theorems
Kha Oct 11, 2024
b431895
fix: add realized consts to env once
Kha Oct 12, 2024
59bd509
allow realizations in aux decls ad-hoc
Kha Oct 12, 2024
45a06e3
consider private names in realization
Kha Oct 12, 2024
fe52f24
further fix realizations
Kha Oct 13, 2024
bfb8948
use nicer `Inhabited Expr` value
Kha Oct 14, 2024
28542b1
fix: realizing in async
Kha Oct 14, 2024
f24a14c
fix: exporting async
Kha Oct 14, 2024
053a863
allow async eqn cache accesses
Kha Oct 14, 2024
ed750dc
fix: async thms turned into axioms
Kha Oct 23, 2024
7447141
force compile in evalExpr
Kha Oct 23, 2024
bce25cb
async reducible
Kha Oct 23, 2024
409d54c
async header elab, avoids deadlock
Kha Oct 23, 2024
bc0cf19
enable realizations for inductive ctors
Kha Oct 24, 2024
3905683
fix async profile
Kha Oct 24, 2024
117ec10
improve async profile
Kha Oct 24, 2024
4111e49
unblock getEqnsFor on theorems
Kha Oct 24, 2024
48e2778
Back out "chore: remove `matcherExt` cache"
Kha Oct 24, 2024
f9be05b
allow `matcherExt` to work locally in async branches
Kha Oct 24, 2024
df39b5c
skip duplicate realized consts, will need to revisit
Kha Oct 25, 2024
c546f28
merge master
Kha Oct 25, 2024
2bcacaa
fix compiler setState
Kha Oct 25, 2024
1629424
fix trace.Elab.snapshotTree
Kha Oct 25, 2024
7374557
fix auto params in async theorems
Kha Oct 25, 2024
fd279b2
fix async env lookup of hygiened names
Kha Oct 25, 2024
6351b67
fix auto implicits in async thms
Kha Oct 25, 2024
ebe4214
fix `open` tactic in async theorems
Kha Oct 25, 2024
bd6a8e2
Environment.dbgFormatAsyncState
Kha Oct 25, 2024
ec159d8
isRflTheorem must realize missing constants
Kha Oct 25, 2024
26fdd06
comment findAsync? a bit
Kha Oct 27, 2024
27f8a83
the crucial comment
Kha Oct 27, 2024
518b9fb
chore: allow specifying LEAN_OPTS in `make` invocation
Kha Oct 27, 2024
371fe0c
fix nested realization
Kha Oct 27, 2024
6ae4c68
fix unresolved promise
Kha Oct 27, 2024
4d634bf
fix native_decide
Kha Oct 27, 2024
5882aaa
fix const realization deadlock
Kha Oct 27, 2024
f810459
remove obsolete test
Kha Oct 27, 2024
91d036e
restrict benchmarks for now due to missing -lLake
Kha Oct 27, 2024
0828604
realized constants should not report extensions
Kha Oct 28, 2024
3319266
fix `addDecl (skipExisting := true)`
Kha Oct 28, 2024
600b587
optimize `setImportedEntries`
Kha Oct 28, 2024
e298702
debugAsSorry doesn't seem necessary anymore
Kha Oct 28, 2024
c11567b
work around `gettid` not being available on glibc 2.27 and macOS
Kha Oct 28, 2024
7c6dfec
reactivate building Lake
Kha Oct 28, 2024
3b44cca
turn kernel blocking wait into continuation
Kha Oct 29, 2024
e00fabc
remove some more blockers
Kha Oct 29, 2024
902a3c4
async theorems with attributes
Kha Oct 29, 2024
f713e9a
remove @[simp] async blocker
Kha Oct 29, 2024
006d140
trace attribute application
Kha Oct 29, 2024
0786bc6
fix async tracing
Kha Nov 5, 2024
b98b409
fix postponing mutual defns
Kha Nov 6, 2024
0a3c666
fix default snapshot desc
Kha Nov 6, 2024
33e051d
delay all defs
Kha Nov 5, 2024
d34f83e
postponedCompiles should be an env ext
Kha Nov 6, 2024
09fb998
fix declarations getting lost in checkSubDecls*
Kha Nov 7, 2024
6f27a6a
runAsyncAsSnapshot desc
Kha Nov 7, 2024
d3bc0f4
chore: introduce UNSAFE_INCREMENTAL
Kha Nov 7, 2024
b32c6d9
fix afterCompilation attrs being applied too early
Kha Nov 7, 2024
f21f94a
cannot use addAsync with postponed decls
Kha Nov 7, 2024
6ca58e3
partial cleanup of postponed decls
Kha Nov 7, 2024
8639449
restrict postponement back to async elab for now
Kha Nov 7, 2024
56ea19c
reactivate a more kosher cmdlineSnapshots
Kha Nov 8, 2024
6b197a0
must force postponed compiles when eagerly compiling
Kha Nov 8, 2024
b98300d
fix toKernelNoAsync with postponed decls
Kha Nov 8, 2024
967861b
deprecate and avoid Environment.addAndCompile
Kha Nov 8, 2024
161fcec
fix runAsyncAsSnapshot
Kha Nov 8, 2024
8a1e3eb
resolveGlobalName trace
Kha Oct 29, 2024
82cf580
avoid more Environment.find?s
Kha Nov 9, 2024
bdd7b82
interpreter error message
Kha Nov 9, 2024
2654804
rebuild: async addDecl
Kha Nov 10, 2024
4340de8
better MutualDef snapshot desc
Kha Nov 10, 2024
a547b66
dubious async compileDecls?
Kha Nov 10, 2024
ec609d0
remove postponement
Kha Nov 12, 2024
0a6a419
fix addDecl
Kha Nov 13, 2024
ae2d8f6
sync all extension changes
Kha Nov 13, 2024
2e4afff
base -> kernel
Kha Nov 13, 2024
1572640
fix setMainModule, needs a more principled solution
Kha Nov 13, 2024
1d17e83
clean up checked env access
Kha Nov 13, 2024
4d8561c
fix updateBase
Kha Nov 13, 2024
979dd2b
remove kernel namespace remnants
Kha Nov 13, 2024
08ccd35
cleanup
Kha Nov 13, 2024
4ce251f
fix checkAndCommitEnv
Kha Nov 13, 2024
4d45908
revert async env ext changes
Kha Nov 13, 2024
d29d6d8
re-enable async proofs
Kha Nov 13, 2024
3dd829d
more environment asynchrony API
Kha Nov 9, 2024
1ddb9f6
re-activate findStateAsync
Kha Nov 9, 2024
3ad871f
make some env exts async
Kha Nov 9, 2024
e9d4080
more async env exts
Kha Nov 13, 2024
99d1794
more async env ext API
Kha Nov 9, 2024
f08b2ed
more async env exts
Kha Nov 9, 2024
a777e7e
match ext async
Kha Nov 9, 2024
d8c5e4c
env fixes
Kha Nov 9, 2024
f35a794
more async lookup
Kha Nov 9, 2024
4be3d83
avoid trivial task in addConstAsync
Kha Nov 14, 2024
cd0ec87
re-enable proof commitConst
Kha Nov 14, 2024
c2e90c2
async eqns
Kha Nov 14, 2024
0822d5a
testfile
Kha Nov 14, 2024
4b17c42
merge master
Kha Nov 14, 2024
8245a20
evalExprCore Elab.block
Kha Nov 14, 2024
e0e33b5
use gettid on Linux after all, via syscall()
Kha Nov 12, 2024
8d15779
refactor: split `Lean.Language.Basic`
Kha Nov 20, 2024
6694250
feat: snapshotTrees
Kha Nov 20, 2024
938e77d
use snapshotTrees
Kha Nov 20, 2024
3bc1f28
fix tests
Kha Nov 21, 2024
3c7dc4b
feat: creation and logging for asynchronous elaboration tasks
Kha Nov 20, 2024
85ca914
merge master
Kha Nov 22, 2024
d8db3c9
merge master
Kha Nov 26, 2024
f05032e
merge master
Kha Nov 29, 2024
2b9c4fa
merge master
Kha Dec 2, 2024
ae86dc9
minimize diff with master
Kha Dec 2, 2024
ef7ebe0
minimize further
Kha Dec 2, 2024
0289e43
respect Elab.async
Kha Dec 2, 2024
23fb458
make `isStructure` async-aware
Kha Nov 14, 2024
bcb0317
feat: parallel progress notifications
Kha Dec 3, 2024
8aa29d7
fix: do not double-report `snapshotTasks` after `wrapAsyncAsSnapshot`
Kha Nov 14, 2024
db22dfd
fix: missing task ranges in trace.Elab.snapshotTrees
Kha Nov 14, 2024
b64d206
async-aware declRangeExt
Kha Nov 14, 2024
da9b442
adjust progress range of MutualDef body task
Kha Nov 14, 2024
24d61ef
merge master
Kha Dec 6, 2024
6665837
feat: verify insertMany method for adding lists to HashMaps (#6211)
monsterkrampe Jan 15, 2025
b3f8fef
fix: improve E-matching pattern selection heuristics (#6653)
leodemoura Jan 15, 2025
54f06cc
feat: better support for partial applications in the E-matching proce…
leodemoura Jan 15, 2025
65175dc
feat: improve`grind` diagnostic information (#6656)
leodemoura Jan 15, 2025
127b3f9
feat: more grind tests (#6650)
kim-em Jan 15, 2025
64cf5e5
feat: improve `grind` search procedure (#6657)
leodemoura Jan 15, 2025
0050e93
refactor: lake: use `StateRefT` for `BuildStore` (#6290)
tydeu Jan 15, 2025
6259b47
feat: improve case-split heuristic used in `grind` (#6658)
leodemoura Jan 16, 2025
af4a7d7
fix: `grind` term preprocessor (#6659)
leodemoura Jan 16, 2025
3a6c5cf
feat: canonicalizer diagnostics (#6662)
leodemoura Jan 16, 2025
80ddbf4
feat: align List/Array/Vector.flatMap (#6660)
kim-em Jan 16, 2025
f4c9934
feat: Vector.getElem_flatMap (#6661)
kim-em Jan 16, 2025
f015271
feat: align List.replicate/Array.mkArray/Vector.mkVector lemmas (#6667)
kim-em Jan 16, 2025
906aa1b
feat: add `Nat.[shiftLeft_or_distrib`, shiftLeft_xor_distrib`, shiftL…
luisacicolini Jan 16, 2025
e42f7d9
feat: equality resolution for `grind` (#6663)
leodemoura Jan 16, 2025
17c0187
fix: add workaround for `MessageData` limitations (#6669)
leodemoura Jan 16, 2025
60142c9
chore: remove unneeded instance (#6671)
hargoniX Jan 16, 2025
35a4da2
feat: add `simp`-like parameters to `grind` (#6675)
leodemoura Jan 17, 2025
7f0ae22
fix: don't filter out local instances in LCNF toMono pass (#6664)
zwarich Jan 17, 2025
b7815b5
feat: add lcAny constant to Prelude (#6665)
zwarich Jan 17, 2025
e3fd954
chore: update stage0
Jan 17, 2025
f374ef1
refactor: move `ext` environment extension to `Lean.Meta.Tactic`
leodemoura Jan 17, 2025
9b629cc
chore: update stage0
leodemoura Jan 17, 2025
4d4c094
feat: extensionality theorems in `grind` (#6682)
leodemoura Jan 17, 2025
d4070d4
fix: `grind` parameter issues and configuration (#6686)
leodemoura Jan 18, 2025
98e3d6f
fix: make `#check_failure`'s output be info (#6685)
Seasawher Jan 18, 2025
5e63dd2
chore: fix typo in docstring of mkMVar (#6687)
goens Jan 18, 2025
3770808
feat: split `Lean.Kernel.Environment` from `Lean.Environment` (#5145)
Kha Jan 18, 2025
5fb2e89
chore: update stage0
Jan 18, 2025
50a0a97
refactor: move registration of namespaces on kernel add into elaborat…
Kha Jan 18, 2025
70050c3
chore: `init_grind_norm` command parser (#6689)
leodemoura Jan 18, 2025
2694179
chore: update stage0
Jan 18, 2025
8a8417f
refactor: `getUnfoldableConst*?` (#5997)
Kha Jan 18, 2025
5998ba5
feat: regression tests for `grind` adapted from `lean-egg` (#6688)
kim-em Jan 18, 2025
478d421
feat: `init_grind_norm` elaborator (#6690)
leodemoura Jan 19, 2025
7ee9382
chore: update stage0
Jan 19, 2025
4d8bc22
feat: Environment.addConstAsync (#6691)
Kha Jan 19, 2025
4213862
chore: remove `[grind_norm]` attribute (#6692)
leodemoura Jan 19, 2025
74bd40d
chore: update stage0
Jan 19, 2025
75c104c
feat: align List/Array/Vector.reverse lemmas (#6695)
kim-em Jan 19, 2025
b289b66
chore: remove deprecations from 2024-06 (#6696)
kim-em Jan 19, 2025
35bbb48
feat: refactor List/Array.mapFinIdx to unbundle the Fin argument (#6697)
kim-em Jan 19, 2025
645bdea
perf: optimize `setImportedEntries` (#6698)
Kha Jan 19, 2025
d329b77
fix: do not double-report `snapshotTasks` after `wrapAsyncAsSnapshot`
Kha Nov 14, 2024
49d5cf6
feat: asynchronous kernel checking
Kha Dec 2, 2024
322a0d3
merge async-tc
Kha Dec 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -699,12 +699,12 @@ else()
endif()

if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
add_custom_target(lake_lib ALL
add_custom_target(lake_lib
WORKING_DIRECTORY ${LEAN_SOURCE_DIR}
DEPENDS leanshared
COMMAND $(MAKE) -f ${CMAKE_BINARY_DIR}/stdlib.make Lake
VERBATIM)
add_custom_target(lake_shared ALL
add_custom_target(lake_shared
WORKING_DIRECTORY ${LEAN_SOURCE_DIR}
DEPENDS lake_lib
COMMAND $(MAKE) -f ${CMAKE_BINARY_DIR}/stdlib.make libLake_shared
Expand Down
8 changes: 4 additions & 4 deletions src/Init/Data/Array/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ def mapM {α : Type u} {β : Type v} {m : Type v → Type w} [Monad m] (f : α
/-- Variant of `mapIdxM` which receives the index as a `Fin as.size`. -/
@[inline]
def mapFinIdxM {α : Type u} {β : Type v} {m : Type v → Type w} [Monad m]
(as : Array α) (f : Fin as.size → α → m β) : m (Array β) :=
(as : Array α) (f : (i : Nat) → α → (h : i < as.size) → m β) : m (Array β) :=
let rec @[specialize] map (i : Nat) (j : Nat) (inv : i + j = as.size) (bs : Array β) : m (Array β) := do
match i, inv with
| 0, _ => pure bs
Expand All @@ -464,12 +464,12 @@ def mapFinIdxM {α : Type u} {β : Type v} {m : Type v → Type w} [Monad m]
rw [← inv, Nat.add_assoc, Nat.add_comm 1 j, Nat.add_comm]
apply Nat.le_add_right
have : i + (j + 1) = as.size := by rw [← inv, Nat.add_comm j 1, Nat.add_assoc]
map i (j+1) this (bs.push (← f ⟨j, j_lt⟩ (as.get j j_lt)))
map i (j+1) this (bs.push (← f j (as.get j j_lt) j_lt))
map as.size 0 rfl (mkEmpty as.size)

@[inline]
def mapIdxM {α : Type u} {β : Type v} {m : Type v → Type w} [Monad m] (f : Nat → α → m β) (as : Array α) : m (Array β) :=
as.mapFinIdxM fun i a => f i a
as.mapFinIdxM fun i a _ => f i a

@[inline]
def findSomeM? {α : Type u} {β : Type v} {m : Type v → Type w} [Monad m] (f : α → m (Option β)) (as : Array α) : m (Option β) := do
Expand Down Expand Up @@ -588,7 +588,7 @@ def map {α : Type u} {β : Type v} (f : α → β) (as : Array α) : Array β :

/-- Variant of `mapIdx` which receives the index as a `Fin as.size`. -/
@[inline]
def mapFinIdx {α : Type u} {β : Type v} (as : Array α) (f : Fin as.size → α → β) : Array β :=
def mapFinIdx {α : Type u} {β : Type v} (as : Array α) (f : (i : Nat) → α → (h : i < as.size) → β) : Array β :=
Id.run <| as.mapFinIdxM f

@[inline]
Expand Down
Loading
Loading