Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
Find a file
Leonardo de Moura f879cdb12f test(tests/playground): add new example in Lean and OCaml
@kha I wrote a simple test in Lean and OCaml. Right now, the numbers on
my machine are

arith_eval.ml         8.13 secs
arith_eval_nat.lean   10.71 secs

OCaml is computing with machine boxed integers, and we are computing
with `nat`. Our version is more expensive since we have to check
whether the number is small or big, and whether the result needs to be a
mpz value or not.

Almost half of our runtime is spent deallocating the big object returned
by `mk_expr`. The deferred free feature does not help here because
we don't deallocate the object in the end but as we execute `eeval`.
So, we perform many small invocations to `del`. None of them take
long, but the overall cost is super high. I can use a different strategy
where `del(o)` just updates the `g_to_free` list, and we deallocate
at most `LEAN_DEFERRED_FREE_QUOTA` at each allocation. The current
deferred free approach would also work if we could use the borrowed
annotations in `eeval`. In this case, we would not delete the input
expression as we evaluate it.

As an experiment, I manually added a `lean::inc` before invoking
`eeval`. The idea was prevent memory deallocation. With this
modification, the program runs in 5.87 secs.

BTW, I also wrote a version using uint32 (arith_eval_uint32.lean),
but the current compiler generates poor code for it.
I know how to fix the performance problem.
2019-02-14 15:50:07 -08:00
.github chore(.github/CONTRIBUTING): fix typos and URLs 2017-10-30 16:23:22 +01:00
bin chore(bin/lean-gdb): add lean::object pretty printer 2019-02-07 13:02:48 +01:00
doc chore(doc/examples/compiler/test): simplify example 2019-02-06 17:23:16 -08:00
gen fix(runtime): replace lean::alloca with macro 2019-02-04 09:36:53 -08:00
images chore(CMakeLists.txt): move Lean logo to make sure we can test leanemacs without installing Lean 2015-01-31 17:38:49 -08:00
lean4-mode chore(shell/lean): reduce lean interface to taking a single file, assuming all dependencies have already been built 2019-01-25 18:27:38 +01:00
library fix(library/init/lean/default): missing file 2019-02-14 15:21:53 -08:00
script chore(CMakeLists): style_check: ignore src/boot/ 2019-02-07 15:41:12 +01:00
src fix(library/init/lean/default): missing file 2019-02-14 15:21:53 -08:00
tests test(tests/playground): add new example in Lean and OCaml 2019-02-14 15:50:07 -08:00
.appveyor.yml chore(.appveyor,.travis): disable leanpkg registry tests 2018-04-12 18:32:20 +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
.gitattributes chore(.gitattributes): use union merge strategy for doc/changes.md 2017-12-11 12:49:10 +01:00
.gitignore chore(.gitignore): ignore library/Makefile 2018-11-07 09:30:32 +01:00
.travis.yml chore(.travis.yml): trigger AppVeyor nightly build from Travis 2018-04-13 16:44:27 +02:00
LICENSE
README.md chore(README): point CI links to lean4 branch 2018-04-12 13:50:42 +02:00

logo

LicenseWindowsLinux / macOSTest CoverageChat
Codecov Join the Zulip chat

About

Installation

Stable and nightly binary releases of Lean are available on the homepage. For building Lean from source, see the build instructions.

Miscellaneous

Roadmap