Commit graph

16740 commits

Author SHA1 Message Date
Leonardo de Moura
3651dc7618 feat(library/init/lean): add evalConst
The implementation is good enough for implementing extensible parsers,
elaborators and tactics, but there are a few TODOs

1- We should have a better story for standalone applications.
   Most of them don't need `evalConst`, and the global table is
   just initialization overhead.

2- The global table introduces a dependency on the `Lean.Name`
   implementation. So, all standalone applications will depend on it.

3- We are not storing arity 0 constants in the table.
   This one should be easy to fix in the future.
2019-06-07 16:31:28 -07:00
Leonardo de Moura
c3a7cc4617 feat(library/init/lean/compiler/ir/emitcpp): register functions 2019-06-07 15:34:55 -07:00
Leonardo de Moura
b2ae4c51af chore(shell/lean): cleanup 2019-06-07 14:52:16 -07:00
Leonardo de Moura
e080909ba7 chore(gen/apply): move to script 2019-06-07 11:05:14 -07:00
Leonardo de Moura
9ac18251f8 chore(src/sexpr): remove sexpr 2019-06-07 11:00:00 -07:00
Leonardo de Moura
d664486eca chore(util): move format to src/util 2019-06-07 10:58:23 -07:00
Leonardo de Moura
12809945ba chore(util/sexpr/format): use Lean implementation 2019-06-07 10:45:42 -07:00
Leonardo de Moura
373011bc20 chore(library/init/lean/format): export group 2019-06-07 10:35:04 -07:00
Leonardo de Moura
5eaca0d89e chore(util/sexpr/format): preparing to switch to Lean implementation 2019-06-07 10:18:23 -07:00
Leonardo de Moura
452485a706 chore(library/init/lean/format): export functions 2019-06-07 10:10:13 -07:00
Leonardo de Moura
aadb07d5e4 chore(tests/lean): remove/fix tests 2019-06-07 09:56:11 -07:00
Leonardo de Moura
3afa4f7ab0 chore(util/safe_arith): remove dead code 2019-06-07 09:52:31 -07:00
Leonardo de Moura
f6b9a0fe9c chore(util/sexpr/format): preparing to switch to Lean implementation 2019-06-07 09:46:34 -07:00
Leonardo de Moura
7beb74fb0f chore(util/sexpr/format): remove dead code 2019-06-07 09:28:30 -07:00
Leonardo de Moura
ff86159297 test(tests/playground/eval): proof of concept for a safe eval function 2019-06-06 17:06:32 -07:00
Leonardo de Moura
0553d60dbf feat(library/compiler/util): switch to new attributes implemented in Lean 2019-06-06 15:40:39 -07:00
Leonardo de Moura
b292fc13cc chore(library/init/lean/compiler/inline): export typo 2019-06-06 15:28:20 -07:00
Leonardo de Moura
e4063f5eec chore(stage0): update 2019-06-06 15:20:13 -07:00
Leonardo de Moura
d74f52e8dd feat(library/init/lean/parser/identifier): add indentifier.lean back 2019-06-06 15:18:22 -07:00
Leonardo de Moura
f0bb48a48a chore(library/init/lean/parser/trie): put trie back 2019-06-06 15:14:27 -07:00
Leonardo de Moura
8f9b73399b feat(library/compiler/eager_lambda_lifting): implement using Lean version 2019-06-06 15:09:57 -07:00
Leonardo de Moura
57e250a768 chore(stage0): remove leftover 2019-06-06 15:09:41 -07:00
Leonardo de Moura
9b457cc77c feat(library/init/lean/compiler/inline): implement tester functions and export them 2019-06-06 15:07:08 -07:00
Leonardo de Moura
dbe38b054d feat(library/init/lean/name): add Lean version of name::append_after 2019-06-06 14:28:59 -07:00
Leonardo de Moura
1658be20f1 feat(library/init/data/string): add String.isPrefixOf 2019-06-06 14:20:50 -07:00
Leonardo de Moura
72290483e4 chore(library/init/lean/compiler): attributes.lean ==> inline.lean 2019-06-06 14:08:13 -07:00
Leonardo de Moura
e05cdc2b08 feat(library/init/lean/compiler): declare function inlining attributes in Lean
Remark: they are not active yet since we haven't removed the ones
defined in C++ yet.
2019-06-06 11:05:54 -07:00
Leonardo de Moura
2a557b1bbd feat(frontends/lean/decl_attributes): connect old frontend to new attribute manager 2019-06-06 10:43:09 -07:00
Leonardo de Moura
fc4abbd6c3 chore(shell/lean): compilation warning 2019-06-06 10:42:39 -07:00
Leonardo de Moura
c8a972c57b fix(library/init/lean/attributes): typos at @[export] 2019-06-06 10:41:17 -07:00
Leonardo de Moura
44cba2fb3d chore(library/init/lean/attributes): add Inhabited instance and improve stats 2019-06-06 10:39:40 -07:00
Leonardo de Moura
280e7bb006 feat(library/init/lean/attributes): add TagAttributes
`TagAttribute`s are implemented on top of the low level Attribute API,
and `PersistentEnvExtension`.
This is just the first attribute on a series of attributes we are
going to implement using Lean itself.
2019-06-05 21:54:28 -07:00
Leonardo de Moura
fb77d71d23 feat(library/init/lean/attributes): export attribute API 2019-06-05 16:55:47 -07:00
Leonardo de Moura
d212abb9ee feat(library/init/lean/syntax): export helper functions for creating syntax in C++ 2019-06-05 16:49:58 -07:00
Leonardo de Moura
df3b85490b feat(library/init/lean/position): add new FileMap 2019-06-05 15:58:53 -07:00
Leonardo de Moura
7909d86e5d feat(library/init/lean): Syntax objects with new SyntaxNodeKind and Substring, and arrays instead of lists
We can use `SyntaxNodeKind.id : Nat` to implement maps from kind to
values using arrays.
2019-06-05 15:35:51 -07:00
Leonardo de Moura
02847f6dc7 chore(stage0): update 2019-06-05 15:29:13 -07:00
Leonardo de Moura
55626ba60d chore(library/init/lean): disable new frontend for now
We are going to start making drastic changes in the parser,
elaborator, attributes, etc. Examples:
- No View objects. I am going to implement match_syntax.
- No RecT in the parser. I am going to implement parser extensions
using an approach similar to the one I used to implement environment
extensions.
- No Parsec. I will use an approach similar to the one used in the
experiment https://github.com/leanprover/lean4/tree/master/tests/playground/parser

It is easier to perform these changes with the new frontend disabled.
I will slowly re-active it as I apply the changes.

cc @kha
2019-06-05 15:26:43 -07:00
Leonardo de Moura
95b3ad69f9 chore(frontends/lean): remove parsing_only and prio from old attribute parser
This is a preparation for adding new attribute manager to the old frontend.
2019-06-05 15:01:03 -07:00
Leonardo de Moura
e90a79f996 chore(tests/playground/parser/syntax): fix test 2019-06-05 14:19:24 -07:00
Leonardo de Moura
e081332ef8 feat(library/scoped_ext): switch to new scope manager implemented in Lean
We still invoke the old `scoped_ext`s implemented in C++.
2019-06-05 14:12:27 -07:00
Leonardo de Moura
fd29b7e45d feat(util/io): add helper functions for consuming IO results in C++ 2019-06-05 13:53:38 -07:00
Leonardo de Moura
642992eeca chore(library/init/lean/attributes): missing @[export] 2019-06-05 13:30:26 -07:00
Leonardo de Moura
e379d58802 chore(stage0): update 2019-06-05 13:18:59 -07:00
Leonardo de Moura
fd9c8a4c82 feat(library/init/lean/attributes): add pushScope/popScope, missing APIs, and @[export] 2019-06-05 13:17:25 -07:00
Leonardo de Moura
2cb50f31bd chore(library/init/lean/environment): error message consistency 2019-06-05 09:16:10 -07:00
Leonardo de Moura
67a4ebbde6 feat(library/init/lean/attributes): low level attribute registration, and frontend attribute actions
Remark: the attribute actions used by the frontend are all in IO.
These actions access attributes by name, and need access to the IO.ref
that contains all registered attributes in the system.
2019-06-05 09:15:35 -07:00
Leonardo de Moura
583f38d1e5 feat(library/init/lean/attributes): attribute API for implementing the new frontend 2019-06-05 07:02:06 -07:00
Sebastian Ullrich
1f51a96794 chore(stage0): fix build 2019-06-05 10:54:01 +02:00
Leonardo de Moura
4ee3332763 chore(stage0): update 2019-06-04 16:56:53 -07:00