Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
Find a file
Leonardo de Moura fabf7f6380 perf(library/equations_compiler, library/compiler): expand auxiliary _match_idx definitions when generating byte code
We use the auxiliary procedure pull_nested_rec_fn to pull recursive
application in nested match expressions. This is needed because the
nested match expression is compiled before we process the recursive
procedure that contains it. This transformation may produce
performance problems if the recursive application does not depend on
the data being matched. Here is an example from the new test:

```
def tst : tree → nat
| (tree.leaf v) := v
| (tree.node v l r) :=
  match f v with
  | tt := tst l
  | ff := tst r
  end
```

pull_nested_rec_fn will convert it into

```
def tst : tree → nat
| (tree.leaf v)     := v
| (tree.node v l r) := tst._match_1 (f v) (tst l) (tst r)
```

Since our interpreter uses eager evaluation, both `(tst l)` and `(tst r)`
are executed. This commit fixes this issue by expanding `tst._match_1`
during code generation.
2017-11-09 11:14:57 -08:00
.github chore(.github/CONTRIBUTING): fix typos and URLs 2017-10-30 16:23:22 +01:00
bin chore(src/emacs): move lean-mode to https://github.com/leanprover/lean-mode 2017-10-06 10:46:43 -07:00
doc feat(library/init/meta): move rb_tree and rb_map to native namespace 2017-11-07 13:41:45 -08:00
extras/latex chore(extras/depgraph): remove leandeps 2017-07-15 02:27:17 -07:00
images
leanpkg fix(leanpkg): fix error message 2017-09-14 18:48:18 +02:00
library chore(library/init/data/ordering): mark aux functions as protected 2017-11-08 16:23:12 -08:00
script chore(script/package_registry): remove library_dev from test suite 2017-08-17 07:41:35 -07:00
src perf(library/equations_compiler, library/compiler): expand auxiliary _match_idx definitions when generating byte code 2017-11-09 11:14:57 -08:00
tests perf(library/equations_compiler, library/compiler): expand auxiliary _match_idx definitions when generating byte code 2017-11-09 11:14:57 -08:00
tmp chore(tmp): save rbtree experiment 2017-11-08 16:23:12 -08:00
.appveyor.yml chore(.appveyor.yml,.travis.yml): simplify using glob patterns 2017-07-26 17:13:34 +02:00
.clang-format feat(library/vm/process): add basic process support 2017-03-28 18:08:06 -07:00
.codecov.yml fix(.codecov.yml): do not fail github ci if coverage drops by 0.01% 2017-06-25 10:35:02 +02:00
.gitignore chore(gitignore): ignore nix files 2017-06-19 13:16:04 +02:00
.travis.yml chore(.travis.yml): undo Travis update 2017-09-15 12:33:46 -07:00
LICENSE
README.md chore(src/emacs): move lean-mode to https://github.com/leanprover/lean-mode 2017-10-06 10:46:43 -07:00