Commit graph

68 commits

Author SHA1 Message Date
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
af55cb13e7 fix(library/messages,library/init/lean/message): wrap message_log in structure, reverse in the end 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
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
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
8ee2f4fea1 feat(*): basic runtime string support 2018-05-14 16:52:55 -07:00
Sebastian Ullrich
fbe6b70295 perf(library/module_mgr): fix module_info reference cycle 2018-03-08 10:06:20 -08:00
Sebastian Ullrich
fe2e95def3 fix(library/module_mgr): Revert "feat(library/module_mgr): save .olean files of non-dirty .lean files in server mode"
This reverts commit 18c2e3739a.
The change introduced a bug where a .olean file may have been saved even if
the corresponding module had produced errors during processing, as long as these
errors were not part of the current region of interest.
2018-02-05 14:36:27 +01:00
Sebastian Ullrich
18c2e3739a feat(library/module_mgr): save .olean files of non-dirty .lean files in server mode
Note, currently there is no way for a dirty file to become non-dirty again
2018-01-23 11:14:18 -08:00
Sebastian Ullrich
e8c057f1de refactor(library/module_mgr): simplify module loading code 2018-01-23 11:14:18 -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
9118079f7f fix(library/module_mgr): error handling in cyclic imports
Fixes #1807
2017-09-12 17:22:47 +02:00
Gabriel Ebner
814a5edaf1 fix(library/module_mgr): check for errors when writing olean files 2017-06-21 11:25:25 +02:00
Gabriel Ebner
1e7e440951 fix(library/module_mgr): actually cancel invalidated tasks 2017-06-05 19:36:09 +02:00
Gabriel Ebner
b1e417805e fix(frontends/lean/scanner): do not treat 0xFF as end-of-file
Fixes #1624.  We just replace 0xFF by 0x00 when reading a new input
byte.  This shows up as an unexpected token error.
2017-05-31 16:54:04 +02:00
Gabriel Ebner
40eb5d0556 feat(library/module_mgr): skip reverse dependency rebuild if file content is unchanged 2017-05-23 11:14:30 -07:00
Gabriel Ebner
07c25338b9 feat(shell/server): add search command 2017-05-22 09:40:38 -07:00
Gabriel Ebner
f14763b777 fix(library/module_mgr): fall back to olean if lean does not exist 2017-05-01 14:11:39 -07:00
Gabriel Ebner
3810e8950d refactor(util/lean_path,util/path): separate search path functions 2017-05-01 14:11:38 -07:00
Gabriel Ebner
baa4c48f1f refactor(util/lean_path): explicitly pass around search path 2017-05-01 14:11:38 -07:00
Gabriel Ebner
01a7efc007 fix(library/module_mgr): do not crash on missing imports
Fixes #1506.
2017-04-04 19:56:33 +02:00
Gabriel Ebner
8c1136c1b6 fix(library/module_mgr): get_first_diff_pos: handle newlines correctly 2017-03-27 14:01:04 -07:00
Gabriel Ebner
318910f99b refactor(frontends/lean/parser): store snapshots in a lazy async list 2017-03-27 14:00:53 -07:00
Gabriel Ebner
c7ca21625c feat(util/log_tree): annotate nodes with detail levels 2017-03-23 09:03:43 +01:00
Gabriel Ebner
2799375d24 chore(*): style 2017-03-23 08:57:56 +01:00
Gabriel Ebner
aebd18f136 feat(shell/server): only compile region of interest 2017-03-23 08:57:56 +01:00
Gabriel Ebner
5f872912e0 refactor(shell/lean): set exit status 1 iff at least one error was reported 2017-03-23 08:57:56 +01:00
Gabriel Ebner
595cbb8fe9 refactor(*): task<T>, log_tree, cancellation_token 2017-03-23 08:57:52 +01:00
Gabriel Ebner
cbc0bb1f7c feat(library/module): store whether we used sorry in olean 2017-02-05 16:35:32 +01:00
Gabriel Ebner
f3b9439029 feat(library/module_mgr): add function to get combined environment 2017-01-31 09:39:31 +01:00
Gabriel Ebner
0d949e0da7 chore(library/module_mgr): explain exceptional case 2017-01-17 17:10:37 -08:00
Gabriel Ebner
a230c47178 feat(util/task_queue,emacs,*): highlight running tasks with different background color 2017-01-17 17:10:37 -08:00
Gabriel Ebner
1a6629ce3b feat(frontends/lean/parser): keep list of tasks that have to succeed 2017-01-17 15:31:17 -08:00
Leonardo de Moura
eabbc5bb68 chore(library/module_mgr): comment unreachable_code assertion
@gebner, could you please take a look a check whether there is a better fix.
2017-01-15 23:18:44 +01:00
Sebastian Ullrich
b180c54c0e feat(shell): move lean.js to server mode 2017-01-13 07:34:54 -08:00
Gabriel Ebner
db81e4b5b8 feat(frontends/lean/parser): gracefully handle scanner exceptions in imports 2017-01-11 23:49:44 -08:00
Gabriel Ebner
7319000c98 fix(library/module_mgr): set up message handling outside of exception handler 2017-01-11 23:49:44 -08:00
Gabriel Ebner
130f80efff fix(library/module_mgr): gracefully handle exceptions during dependency discovery 2017-01-11 23:49:44 -08:00
Gabriel Ebner
70e41305e5 fix(module_mgr): produce olean files with correct mtimes 2017-01-06 01:04:18 -08:00
Gabriel Ebner
063130ee18 feat(kernel/environment): add function that checks whether all proofs are correct 2017-01-05 18:09:28 -08:00
Gabriel Ebner
96398500b6 fix(library/module_mgr): do not cause waits for preimported modules 2017-01-04 16:30:22 -08:00
Gabriel Ebner
f6b8eb6821 feat(util/task_queue): lazy tasks 2017-01-04 16:30:22 -08:00
Gabriel Ebner
e3b3de5cf3 fix(module_mgr): guard all accesses to m_mod_info 2016-12-23 18:01:44 +01:00
Leonardo de Moura
896bc2c75a chore(*): fix style 2016-12-20 11:31:00 -08:00
Gabriel Ebner
8132957391 fix(library/module_mgr): build olean files with mtimes in correct order 2016-12-20 10:55:34 -08:00
Gabriel Ebner
0550d2a6ac refactor(library/module): import all modules in a single call 2016-12-20 10:15:19 -08:00
Gabriel Ebner
99fc13af98 refactor(library/module_mgr): cache olean imports as well 2016-12-20 10:15:19 -08:00
Gabriel Ebner
370d69de3f refactor(library/module): interface to get task dependencies for modifications 2016-12-20 10:15:19 -08:00
Gabriel Ebner
a2bc967fac feat(library/module): reuse pre-imported init module 2016-12-20 10:15:19 -08:00