Commit graph

3460 commits

Author SHA1 Message Date
Sebastian Ullrich
f6973be5e3 refactor: replace C++ import parser with Lean one
imports are now completely opaque to C++
2019-11-21 15:52:01 +01:00
Sebastian Ullrich
44d5eddf16 chore: remove support for relative imports 2019-11-20 16:39:53 +01:00
Sebastian Ullrich
3980194fbf chore: more assertions and old code 2019-11-19 12:55:02 +01:00
Leonardo de Moura
46adfcfdb6 refactor: Name fully implemented in Lean 2019-11-18 19:54:05 -08:00
Leonardo de Moura
cba3dabcec chore: update stage0 2019-11-18 19:54:05 -08:00
Leonardo de Moura
b09fb4348d chore: rename Name constructors 2019-11-18 19:54:05 -08:00
Leonardo de Moura
3bc61e7ee9 chore: remove special support for Name in the equation compiler 2019-11-18 12:45:53 -08:00
Leonardo de Moura
85a1994bbb chore: use mkNameStr and mkNameNum for building quoted names 2019-11-18 12:45:53 -08:00
Leonardo de Moura
85092412c7 refactor: remove Expr.FVar hack
@Kha @dselsam:
This hack was preventing us from making `Expr` a "real" Lean type.
This was bad for a few reasons:
- It was hard to extend/modify `Expr` in Lean since we would also have
to modify the C++ code that creates the `Expr` objects with the hidden
fields.
- `Expr.lam` and `Expr.forallE` were not following the Lean layout
standard where we sort fields by size. @Kha: recall we used that to
avoid a UB. The issue with `Expr.lam` and `Expr.forallE` is that they
have a "visible" field (`BinderInfo`), which is smaller than
hidden fields such as hash code.
- `Expr.fvar` had only one field at `Expr.lean,` but four behind the
scenes.

I added a new constructor `Local` that is only accessible from C++.
It is only used in legacy code we inherited from Lean2.
We will eventually delete it.

This refactoring was quite painful since many parts of the codebase
were mixing the new `Expr.fvar` with the old `Expr.local`.
I doubt I would be able to do it without the new staging framework
@Kha built.

BTW, some of the patches are horrible. I didn't care much since we
are going to deleted the super ugly files. That being said,
you should expect new weird bevaior due to `Expr.fvar` vs `Expr.local`.

Next step: use the new `ExprCachedData` to make all `Expr` hidden visibles
accessible from Lean.

checkpoint
2019-11-15 14:04:26 -08:00
Leonardo de Moura
d9f3b4bf63 refactor: remove Expr.mvar hidden field 2019-11-15 10:04:42 -08:00
Leonardo de Moura
fd66963e85 chore: remove dead code 2019-11-14 15:24:18 -08:00
Leonardo de Moura
c4d974eb89 feat: allow attributes to be applied before elaboration
This is useful when the attribute may influence the elaboration of the declaration.
2019-11-13 15:40:19 -08:00
Leonardo de Moura
7dbb927144 chore: temporary hack
cc @kha
2019-11-11 11:30:22 -08:00
Sebastian Ullrich
17b8ac894a fix: parser error recovery should be silent and be able to skip more than one token 2019-11-10 09:01:43 -08:00
Sebastian Ullrich
1442c1b377 feat: call linters on non-mutual definitions 2019-11-09 15:43:37 -08:00
Leonardo de Moura
dce1de3905 chore: remove transparency_mode::None 2019-11-08 10:04:06 -08:00
Leonardo de Moura
f88561ae68 feat: add trace! macro 2019-10-22 16:08:37 -07:00
Sebastian Ullrich
9b55687597 fix: show #eval errors 2019-10-18 13:10:13 +02:00
Sebastian Ullrich
7c56754495 feat: profile #synth calls 2019-10-18 11:27:55 +02:00
Sebastian Ullrich
ef6853979f fix: syntax for universe parameters in axiom 2019-10-08 18:11:37 +02:00
Leonardo de Moura
4793cbfa9a feat: add #[elem1, elem2, ..] notation for creating arrays
@kha @dselsam: I added this notation because I am tired of writing
`[elem1, elem2, ...].toArray`. BTW, the new notation is based on the
one available in SML.
2019-10-07 15:36:44 -07:00
Leonardo de Moura
5801e0e65a fix: print module name instead of file name 2019-10-04 20:02:43 -07:00
Leonardo de Moura
0714716477 fix: file and import names, tests and stage0
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2019-10-04 17:04:02 -07:00
Leonardo de Moura
e596089a2d chore: one module per import command 2019-10-04 12:27:47 -07:00
Daniel Selsam
a82266c652 feat(library/init/lean/typeclass): #synth with tabled resolution 2019-10-03 17:23:53 -07:00
Leonardo de Moura
261c0b9c24 feat(frontends/lean): add panic! macro
cc @dselsam
2019-09-30 17:16:19 -07:00
Leonardo de Moura
d6ea1d1a3f feat(frontends/lean/builtin_cmds): add #synth command 2019-09-24 11:32:43 +08:00
Leonardo de Moura
345cc22f79 feat(frontends/lean/elaborator): do not create checkpoint at let x := v; 2019-09-21 10:27:30 -07:00
Sebastian Ullrich
31c170117e feat(frontends/lean/builtin_cmds,library/compiler/ir_interpreter): reimplement #eval 2019-09-19 17:52:18 +02:00
Leonardo de Moura
8148136aa9 fix(util/nat): nat::get_small_value must return size_t since unbox now returns size_t 2019-09-18 17:13:46 -07:00
Leonardo de Moura
b2693962bd chore(library/init/lean): export as C functions 2019-08-17 07:30:07 -07:00
Leonardo de Moura
a5c97e21bf chore(library/init/lean): export as C functions 2019-08-16 20:15:30 -07:00
Leonardo de Moura
61beb56a83 chore(*): fix some compilation warnings 2019-08-15 09:26:13 -07:00
Leonardo de Moura
e9a63bf419 chore(frontends/lean/elaborator): remove recover_expr_from_exception 2019-08-14 14:20:15 -07:00
Leonardo de Moura
03e455d32d feat(frontends/lean/elaborator): add oldElaborate 2019-08-13 19:23:29 -07:00
Leonardo de Moura
a7a5718819 chore(frontends/lean): simplify old elaborator 2019-08-13 18:49:38 -07:00
Sebastian Ullrich
3ed67138d5 chore(*): update equation syntax in files and old parser
for f in ../../**/*.lean; do echo $f; ./patch.lean.out $f > tmp && cat tmp > $f; done
2019-08-09 11:11:34 +02:00
Leonardo de Moura
8ac58a66f8 chore(library/abstract_type_context): remove unnecessary virtual method only used at old pp.cpp 2019-08-07 12:05:10 -07:00
Leonardo de Moura
1ef23950a4 chore(library/init/lean/expr): expose temporary legacy constructor 2019-08-04 08:03:09 -07:00
Leonardo de Moura
b221b09ad5 chore(library/init, frontends/lean): ensure old and new parser use the same command for initializing quotient module 2019-07-31 17:07:05 -07:00
Sebastian Ullrich
aa30a8f273 fix(frontends/lean/elaborator): remove dubious error reporting code that makes Lean compiled with clang 8 segfault 2019-07-26 12:39:35 -07:00
Leonardo de Moura
18d47a2b74 chore(frontends/lean): remove allow_field_notation = false setting
This setting was used for the explicit notation `@`.
We should not need it.
2019-07-17 19:09:15 -07:00
Leonardo de Moura
d03e00de99 chore(frontends/lean/builtin_exprs): remove obsolete notation from old parser 2019-07-17 19:09:15 -07:00
Leonardo de Moura
a3c0e2bb36 chore(frontends/lean/builtin_exprs): ensure old let notation is not accepted 2019-07-17 08:26:42 -07:00
Leonardo de Moura
b2e1ff8b3e feat(library/init): use new "empty match" syntax 2019-07-15 16:25:14 -07:00
Leonardo de Moura
7d062dd961 feat(frontends/lean): add new "empty/no match" syntax to old parser 2019-07-15 16:18:44 -07:00
Leonardo de Moura
57e2f1be2a feat(library/init/lean/parser/term): builtin operators 2019-07-11 10:13:00 -07:00
Leonardo de Moura
1a81d60820 chore(frontends/lean/parser): simplify binder notation
The `<ident> : <expr>` now requires explicit brackets.
2019-07-08 08:54:19 -07:00
Leonardo de Moura
0fc9aa24bc chore(frontends/lean/parser): remove "binder collection" support
This kind of notation will not be supported in the new builtin parser.
If users want they may define their own notation with this feature.
2019-07-08 08:36:29 -07:00
Leonardo de Moura
8fa888878f chore(frontends/lean/parser): remove support for binders 2019-07-07 08:37:49 -07:00