Commit graph

968 commits

Author SHA1 Message Date
Sebastian Ullrich
a29d33485c feat(util/list_ref): to_list_ref, which I didn't need in the end 2019-01-17 17:06:52 +01:00
Sebastian Ullrich
db6b1d6e85 feat(frontends/lean/vm_elaborator,library/init/lean/elaborator): pass parser_state between languages, create parser object on C++ side to existing functions (that don't actually parse anything) 2018-12-18 15:30:38 +01:00
Leonardo de Moura
efa703d2b5 feat(runtime): implement string.iterator primitives in the new runtime
Some of the primitives do not have optimal implementation.

@Kha Could you please check if everything we use in the parser has a
reasonable implementation?
2018-11-15 10:42:23 -08:00
Leonardo de Moura
bcc4956ca5 feat(library/compiler/llnf): reuse constructor memory cells
This commit also add two new instructions to the old VM: `updt` and
`updt_cidx`.
They allow us to test the new new memory reuse technique.

TODO: We need to reset fields after we project. Otherwise, we prevent
destructive updates on nested objects.
2018-10-29 18:46:26 -07:00
Leonardo de Moura
28a34e798a feat(library/compiler/csimp): projection to field
The new test demonstrations this transformation.
2018-10-28 09:38:45 -07:00
Leonardo de Moura
10b99a678c chore(util/list_ref): add objects a list of objects 2018-10-15 11:57:12 -07:00
Leonardo de Moura
d29e95af08 fix(util/list_ref): typo 2018-10-05 17:30:27 -07:00
Leonardo de Moura
be6324e183 chore(util/list_ref): missing include 2018-10-05 17:30:27 -07:00
Leonardo de Moura
8d4f7bb8ec feat(util/timeit): add simpler type for threshold 2018-09-20 12:05:48 -07:00
Sebastian Ullrich
43e57358af refactor(library/module_mgr): minor refactorings 2018-09-11 13:55:25 -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
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
Sebastian Ullrich
99ab0e9d67 refactor(library/messages): make an object_ref 2018-09-11 13:55:25 -07:00
Leonardo de Moura
4863ca071a chore(runtime): make sure we use the same naming convention for getters and setters 2018-09-09 10:07:00 -07:00
Leonardo de Moura
1d5529389a chore(util/name_generator): add explicit 2018-09-08 15:42:48 -07:00
Leonardo de Moura
6b673d1ca9 chore(util,kernel): consistent constructors for object_ref-like wrappers 2018-09-07 17:06:41 -07:00
Leonardo de Moura
71dd8653bc feat(library/init/core): decidable_eq is a proper class
We need this to take advantage of the new indexing structure we are
going to add to improve performance.
2018-09-07 16:38:11 -07:00
Leonardo de Moura
498cfa84fd fix(util/object_ref): typo 2018-09-02 21:06:51 -07:00
Leonardo de Moura
517923d362 feat(kernel/inductive): generate recursors in the new inductive datatype module 2018-08-31 17:47:22 -07:00
Leonardo de Moura
3e528a9b67 chore(runtime): fix assertions 2018-08-28 10:33:22 -07:00
Leonardo de Moura
96ff6b1718 feat(util/object_ref): add helper functions 2018-08-27 16:28:37 -07:00
Leonardo de Moura
db98397cc0 feat(runtime): object compactor
We need more testing and performance testing.
We also need to compare serializer and compacted_region.
2018-08-19 17:10:18 -07:00
Leonardo de Moura
67ab1ec8f2 chore(util/worker_queue): remove dead code 2018-08-16 14:14:57 -07:00
Leonardo de Moura
01ea596aea refactor(kernel/expr): implement expr using runtime/object 2018-06-21 16:05:33 -07:00
Leonardo de Moura
a2c2d1d9e7 feat(util/object_ref): add ternary mk_cnstr 2018-06-20 14:25:09 -07:00
Leonardo de Moura
e14255e7ae chore(util/sexpr): remove sexpr serializer
It was dead code.
Moreover, sexpr will not be part of Lean4
2018-06-20 11:27:29 -07:00
Leonardo de Moura
9e7e600ad7 feat(kernel): add expr.proj constructor
TODO: implement infer_proj and reduce_proj
2018-06-19 15:45:49 -07:00
Leonardo de Moura
0847571ea6 feat(kernel): add mdata constructor 2018-06-18 13:36:22 -07:00
Leonardo de Moura
d704bfef17 fix(util/pair_ref): missing file 2018-06-18 08:19:32 -07:00
Leonardo de Moura
9ef934e090 chore(util): style 2018-06-15 16:05:11 -07:00
Leonardo de Moura
f7d73fb304 feat(util/kvmap): add C++ kvmap wrapper 2018-06-15 16:05:11 -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
c8a13a9ada refactor(*): name convention obj_list => list_ref
Remark: we use the `_ref` suffix for Lean object smart pointers
when the name clashes with an existing name.
2018-06-15 16:05:11 -07:00
Leonardo de Moura
fe2d416cde fix(runtime,util,kernel): should not use strcmp to compare Lean string objects
Reason:
- UTF8 encoding
- Lean strings may contain null char. That is, null char is not an end
  of string delimiter like in C. Lean string objects are similar to std::string
2018-06-15 16:05:11 -07:00
Leonardo de Moura
4878abfda4 chore(util/nat): fix style 2018-06-14 14:04:37 -07:00
Leonardo de Moura
017e1d7a5f fix(util/name): strcmp does not implement Lean string equality 2018-06-13 11:43:05 -07:00
Leonardo de Moura
4432629eb0 feat(util/nat): add C++ wrapper for manipulating runtime nat values 2018-06-13 09:29:52 -07:00
Leonardo de Moura
e90585737f refactor(*): use C++11 std::current_exception and std::rethrow_exception
With these new C++11 APIs, we can delete the `clone` and `rethrow`
methods from our exception classes.
2018-06-07 16:28:54 -07:00
Leonardo de Moura
0dd25b0a24 refactor(util,library): move subscripted_name_set to library 2018-06-05 08:06:32 -07:00
Leonardo de Moura
909284dd74 refactor(runtime): normlize object names 2018-06-01 15:34:42 -07:00
Leonardo de Moura
75c63ec921 refactor(*): list<name> ==> obj_list<name> 2018-05-23 15:48:43 -07:00
Leonardo de Moura
a1b9ae0e67 feat(util/obj_list): add map_reuse and cleanup code 2018-05-23 15:05:08 -07:00
Leonardo de Moura
4af1f31877 feat(util, kernel): add obj_list wrapper for Lean list objects, and use it to implement list of universe levels 2018-05-23 14:48:22 -07:00
Leonardo de Moura
ef8bbccf9f chore(util/object_ref): disable automatic coercion from object_ref to object * 2018-05-23 13:12:40 -07:00
Leonardo de Moura
3d46684d2a chore(util/name): minor change 2018-05-23 09:41:44 -07:00
Leonardo de Moura
e2a7d78dd6 chore(util/name): remove dead code 2018-05-22 17:57:33 -07:00
Leonardo de Moura
5b17a30203 feat(runtime): add object serializer
Any type implemented on top of `object` gets the serializer/deserializer for free
2018-05-22 16:34:41 -07:00
Leonardo de Moura
67b59a0a3c fix(util): memory leaks 2018-05-22 11:05:51 -07:00
Leonardo de Moura
df26e10609 fix(util): assertion violations 2018-05-20 13:42:22 -07:00