Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
Find a file
Leonardo de Moura 145bd50903 feat: disallow patterns with choice nodes
@Kha Patterns with nested "choice" nodes produce counterintuitive
behavior, and hard to understand errors. They only work when we have
the exact same overloads at macro definition and application time.

Here is a funky example
```
syntax [myAdd] term "++":65 term:65 : term    -- overloads "++"
/- The following `macro_rules` manages to eliminate "choice" node by using the
   explicitly provided node kind. -/
macro_rules [myAdd] `($a ++ $b) => `($a + $b)

check (1:Nat) ++ 2 -- works as expected

syntax "FOO!" term : term

/- Before this commit, the following pattern was accepted,
   and it contained a "choice" node for `++`. It is a `myAdd` or
   `HasAppend.append`.

   Now, this kind of pattern is rejected since it contains a nested
   "choice" -/
macro_rules `(FOO! $a ++ $b) => `($a ++ $b)

/- Before this commit, the following command worked because
   it contained a "choice" node similar to the one at macro definition
   time. -/
check FOO! [1, 2] ++ [2, 3]

-- Now, we have 3 overloads for "++".
syntax [myAppend] term "++":65 term:65 : term

-- The `macro_rules` fails here.
```

This commit fixes this weird behavior by disallowing "choice" nodes in
patterns.
2020-01-26 15:13:14 -08:00
.github chore: CI: check for memory leaks in tests & stdlib 2019-12-23 14:25:17 +01:00
bin fix: lean-gdb.py 2019-12-17 12:16:34 -08:00
doc fix: dead link in doc 2020-01-02 14:36:14 +01: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: improve · input method 2019-12-21 15:55:14 -08:00
nix chore: fix nix-build by disabling ccache for now 2020-01-25 15:26:59 +01:00
script chore: extended CI checks 2019-12-07 21:51:59 +01:00
src feat: disallow patterns with choice nodes 2020-01-26 15:13:14 -08:00
stage0 chore: update stage0 2020-01-26 15:13:14 -08:00
tests test: overload builtin notation 2020-01-26 14:00:41 -08:00
tmp refactor: cleanup 2019-12-06 14:41:39 -08: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: 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.