Commit graph

151 commits

Author SHA1 Message Date
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
Leonardo de Moura
0556412f8d refactor(*): add runtime folder
@kha The runtime folder includes what is needed to link a
standalone Lean program. It is still contains some unnecessary files.
We will be able to remove them after we release Lean4.
2018-05-14 14:23:56 -07:00
Leonardo de Moura
efb9fb0802 chore(kernel): remove opportunistic hash consing support
It just adds extra complexity and is in conflict for our plans for
Lean4. Moreover, in our experiments it impacts negatively on
performance: master and lean4 branches. The negative impact has been
confirmed by @kha too.
2018-04-12 16:43:10 -07:00
Nuno Lopes
ac6a16ddba feat(msvc): further work on MSVC compatibility 2018-02-06 10:11:09 -08:00
Leonardo de Moura
b5e2e8ed92 doc(library/module): document the persistent set_option discussion
cc @kha
2018-01-24 17:12:40 -08:00
Sebastian Ullrich
1ee945a31f fix(library): store and validate Lean version of .olean files
Fixes #1770
2018-01-23 11:14:18 -08:00
Gabriel Ebner
c5af2a6f4c fix(library/module): unfold macros in inductive types 2017-06-30 17:49:50 +02:00
Gabriel Ebner
4a6513e5f5 refactor(util/serializer,library/module): use basic_ostream::write for the olean code 2017-06-23 15:13:40 +02:00
Gabriel Ebner
a0a70a678a fix(library/module): check for end-of-file in deserialization 2017-06-21 11:25:25 +02:00
Gabriel Ebner
942f7bf8b5 fix(library/module): unify hash computation 2017-06-21 10:50:54 +02:00
Sebastian Ullrich
606cc85778 chore(library/module): output byte offset of olean corruption 2017-06-19 11:27:12 -07:00
Gabriel Ebner
3810e8950d refactor(util/lean_path,util/path): separate search path functions 2017-05-01 14:11:38 -07:00