Commit graph

162 commits

Author SHA1 Message Date
Leonardo de Moura
7696c28fe1 feat(library/module): module manager in Lean is alive 2019-05-14 11:10:49 -07:00
Leonardo de Moura
642c4c59bd feat(library/init/lean/environment): support for serializing/performing legacy modification objects 2019-05-14 10:08:31 -07:00
Leonardo de Moura
67d14705b0 chore(library/module): simplify write_module 2019-05-14 08:08:09 -07:00
Leonardo de Moura
427852d759 feat(library/init/lean/environment): add findOLean 2019-05-14 08:02:26 -07:00
Leonardo de Moura
e616def866 chore(library/module): remove dead declaration 2019-05-14 07:53:44 -07:00
Leonardo de Moura
22d2848d21 chore(library/module): store search_path in a global variable
Remark: I will use it to expose the following primitive in Lean
```
constant findOLean : Name -> IO String
```
2019-05-14 07:49:00 -07:00
Leonardo de Moura
1a610607b1 chore(library/module): remove old comment 2019-05-14 07:37:20 -07:00
Leonardo de Moura
358b731581 chore(library/module): simplify import_modules
Remark: `lean.cpp` is a total mess at this point. It contains
leftovers from the Lean2 and Lean3 designs, and hacks for supporting
the Lean4 transition.
2019-05-14 07:26:50 -07:00
Leonardo de Moura
9596fae665 chore(library/module): remove import errors 2019-05-14 07:13:50 -07:00
Leonardo de Moura
53ec9ee181 chore(*): style 2019-05-14 07:08:58 -07:00
Leonardo de Moura
5844913102 feat(library/module, library/init/lean/environment): add primitives for reading/writing files as compacted regions 2019-05-13 17:26:28 -07:00
Leonardo de Moura
40f9704540 chore(library/init/lean/environment): add placeholders for writing/reading .olean files 2019-05-13 15:48:23 -07:00
Leonardo de Moura
31d140adab refactor(library/module): use Lean modification list environment extension 2019-05-13 15:26:28 -07:00
Leonardo de Moura
3b3e50d315 chore(library/module): std::shared_ptr<modification> ==> modification*
Remark: this commit introduce memory leaks, but this is just an
intermediate step to get modification objects in Lean.
Recall that, we will eventually remove modification objects from Lean.
2019-05-13 15:05:21 -07:00
Leonardo de Moura
2e3604e80a chore(library/module): remove unnecessary field module_ext::m_imported 2019-05-13 14:34:03 -07:00
Leonardo de Moura
edb4d76ecd feat(kernel/environment): environment as a Lean object 2019-05-13 12:41:33 -07:00
Leonardo de Moura
06390337c6 chore(library/module): fix linker error 2019-05-11 17:08:58 -07:00
Leonardo de Moura
3444a295e7 feat(library/compiler,runtime): builtin support for lean.name 2019-02-05 12:57:46 -08:00
Sebastian Ullrich
2d9a16fd24 refactor(library/module_mgr): remove 2019-01-25 20:12:11 +01:00
Leonardo de Moura
e0bb21ba0b chore(library): remove noncomputable module 2018-10-22 09:39:03 -07:00
Leonardo de Moura
77e3c18cb0 feat(library/module): noncomputable keyword is now used only to disable code generation
We do not try to check whether code generation will succeed or not for
some declaration. In the future, we should probably rename it to
`nocode` or something similar.

cc @kha
2018-10-22 09:35:05 -07:00
Sebastian Ullrich
15d11cc483 feat(library/module_mgr): profile .olean serialization/deserialization 2018-09-20 13:54:17 -07:00
Leonardo de Moura
5d455bf10a chore(library/compiler): skip type checking for _cstage1 declarations
This is a temporary hack for speeding up build time.
2018-09-17 14:45:04 -07:00
Sebastian Ullrich
af99f153f8 refactor(library/module{,_mgr},frontends/lean/parser): use absolute module names everywhere for identifying modules, move actual importing from parser to module_mgr 2018-09-11 13:55:25 -07:00
Sebastian Ullrich
716de48078 chore(library/module): remove loaded_module.m_env
It was used by `--run` only, which I guess will change quite a bit anyway
2018-09-11 13:55:25 -07:00
Sebastian Ullrich
904d7c4a88 chore(*): remove old task API and task queues 2018-09-11 13:55:25 -07:00
Sebastian Ullrich
38208802c6 refactor(*): replace log_tree with simple message_log list, make module_mgr synchronous 2018-09-11 13:55:25 -07:00
Leonardo de Moura
58e91559d0 feat(*): use new inductive datatype module 2018-09-06 18:09:22 -07:00
Leonardo de Moura
101886ffae feat(kernel): proper constant_info and declaration objects for quot type 2018-08-28 13:46:31 -07:00
Leonardo de Moura
161431e995 feat(kernel): implement new mutual_definition declaration object
This commit also removes the old `environment::add_meta` hackish method.
2018-08-28 10:30:44 -07:00
Leonardo de Moura
cdb2824d86 fix(library/module): debug build 2018-08-28 08:09:57 -07:00
Leonardo de Moura
776c977742 refactor(kernel): continue constant_info/declaration refactoring 2018-08-27 17:23:26 -07:00
Leonardo de Moura
ae18cee0ea chore(library/module): remove pos_info tracking
We will use a completely different approach in Lean4
2018-08-27 15:55:57 -07:00
Leonardo de Moura
2ab2265d22 chore(library/module): remove dead APIs 2018-08-27 15:40:20 -07:00
Leonardo de Moura
dec166b387 chore(library/module): remove dead info 2018-08-27 15:35:10 -07:00
Leonardo de Moura
f3e99286bb chore(kernel): remove certified_declaration 2018-08-22 12:11:34 -07:00
Leonardo de Moura
c0b93d3694 refactor(kernel): remove unnecessary certify_unchecked 2018-07-30 12:54:05 -07:00
Leonardo de Moura
ec1aa2553c refactor(kernel/declaration): implement definition/constant/axiom/theorem using runtime/object
TODO: inductive, constructor, recursor
2018-06-25 10:05:45 -07:00
Leonardo de Moura
c5714c2fac chore(kernel): remove expr.macro constructor
We are now ready to implement `expr` using `runtime/object`.
2018-06-19 17:54:43 -07:00
Leonardo de Moura
13c532d0d4 fix(*): truncation bugs
- Lean strings (like std::string) may contain null characters. The
  codebase was ignoring this issue.

- We now have a wrapper `string_ref` for wrapping Lean string objects in
  C++. This wrapper also implements correctly the coercions std::string <-> string_ref.
  Remark: I also found a few places where the code relies on the
  following property which is not true
  Forall s : std::string, std::string(s.c_str()) == s

- `name` object wrapper was assuming that all numerals were small
  `nat` values. This is true in most cases, but the system would
  crash when processing if it is a big number.

- The commit tries to make sure runtime/util/kernel are correct.
  Modules that will be deleted contain many `TODO` comments
  indicating they may crash and/or produce incorrect results
  when strings contain null characters and numerals are big.

cc @kha

@kha: I thought about using `string` instead of `string_ref`.
We consistently use `std::string`. So, it should be fine, but I
was concerned about code readability.

After we bootstrap Lean4, we will be able to delete `lean::list`
template, and rename `lean::list_ref` to `lean::list`.

I am going to add `pair_ref` for wrapping Lean pair objects.
If we use `lean::string` instead of `lean::string_ref`, then
we should also use `lean::pair` instead of `lean::pair_ref`.
But, there is a problem in this case since we have
https://github.com/leanprover/lean4/blob/master/src/util/pair.h#L13
:(
2018-06-15 16:05:11 -07:00
Leonardo de Moura
c0e1d05199 chore(kernel): type_checker ==> old_type_checker 2018-06-06 16:10:40 -07:00
Leonardo de Moura
ac0352b584 refactor(kernel): remove quotitent normalizer extension
The `quot` type is now implemented in the kernel.
We will do the same thing for inductives.
We will not support normalizer extensions anymore in Lean4.
It doesn't make sense since we settled with 2 extensions: quotients and
inductives. Moreover, any new extension would require substantial
changes (e.g., code generator).
The normalizer_extension feature was useful when we were experimenting
with different kernel flavors.
2018-06-01 10:52:17 -07:00
Leonardo de Moura
722974e8c7 feat(kernel): add option to skip type checking at add_meta 2018-05-31 17:27:55 -07:00
Leonardo de Moura
eab962bbc6 feat(kernel): add add_meta 2018-05-31 15:40:50 -07:00
Leonardo de Moura
cab6b39c76 refactor(library): remove sorry checking
We have to revise how we do this.
2018-05-31 15:20:39 -07:00
Leonardo de Moura
112d1da8d0 refactor(library/module): no need to store trust lvl in declarations
We are going to delete macros. So, we don't need to store trust_lvl information.
2018-05-31 14:55:18 -07:00
Leonardo de Moura
3c1ccc9b74 refactor(kernel): use m_meta instead of m_trusted 2018-05-31 11:18:00 -07:00
Leonardo de Moura
75c63ec921 refactor(*): list<name> ==> obj_list<name> 2018-05-23 15:48:43 -07:00
Leonardo de Moura
d92679f969 refactor(*): replace name with lean.name 2018-05-20 09:42:44 -07:00
Leonardo de Moura
1bc7c0812c chore(kernel,library): remove task from the kernel and library 2018-05-18 09:06:03 -07:00