Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
Find a file
Leonardo de Moura 770649ce1d refactor: do not save/restore cache at "telescope" methods
@kha @dselsam FYI

The original motivation for saving/restoring the cache was not
correctness, but cache size management. When we go inside a binder
using the telescope methods, we extend the local context with new fresh
free variables, execute the action `k` using the new extended local
context, and then restore it. Any cached result containing these
fresh variables is dead after executing `k`. So, `savingCache` here
could be viewed as a "checkpoint". However, it also removes any
cached entry that does not contain the new fresh variables.
I found this inconvenient in practice, and it is the wrong choice
in a few cases. Example: we have a `forall` expr (aka arrow), and use a
telescope to go inside, and then invoke TC. If the telescope uses
`savingCache`, we lose the cached TC instance witness. This is
wasteful since the witness often doesn't even depend on the new fresh
free variables created by the telescope.
Thus, this commit removes the `savingCache` occurrences from
the "telescope" methods. Users may still manually use it if
they think it is appropriate. That is, they can write
```lean
savingCache $ forallTelescope e $ fun xs body => <code>
```
if they really want to discard any new cache entry created while
executing `<code>`.
2019-12-02 11:11:49 -08:00
.github chore: switch to Github Actions 2019-11-21 13:11:16 -08:00
bin chore: update .gitignores 2019-11-29 11:18:26 +01:00
doc doc: update build docs 2019-11-29 11:23:42 +01:00
images
lean4-mode chore: remove cygwin support 2019-11-12 08:28:58 -08:00
nix chore: add CCACHE option, on by default if available 2019-11-21 13:11:02 -08:00
script chore: switch to Github Actions 2019-11-21 13:11:16 -08:00
src refactor: do not save/restore cache at "telescope" methods 2019-12-02 11:11:49 -08:00
stage0 feat: remove ignoreImplict workaround 2019-11-27 06:54:55 -08:00
tests feat: add SynthInstance.lean 2019-12-01 18:32:48 -08:00
tmp/new-frontend chore(library/init/lean): disable new frontend for now 2019-06-05 15:26:43 -07:00
.clang-format
.codecov.yml fix(.codecov.yml): do not fail github ci if coverage drops by 0.01% 2017-06-25 10:35:02 +02:00
.gitattributes chore(.gitattributes): use union merge strategy for doc/changes.md 2017-12-11 12:49:10 +01:00
.gitignore chore: update .gitignores 2019-11-29 11:18:26 +01:00
default.nix chore: add CCACHE option, on by default if available 2019-11-21 13:11:02 -08:00
LICENSE
README.md chore(README): update 2019-04-24 11:40:46 -07:00
shell.nix chore: switch to Github Actions 2019-11-21 13:11:16 -08:00

We are currently developing Lean 4. Lean 3 is still the latest official release. This repository contains work in progress.

Important. Unless you are one of our collaborators

  • We strongly suggest you use Lean 3.
  • Pull requests are not welcome.
  • New issues are not welcome, and will be closed without any feedback.