Commit graph

29 commits

Author SHA1 Message Date
Leonardo de Moura
2058d33d07 feat(runtime,library/compiler): add name.dec_eq builtin 2019-02-05 14:36:02 -08:00
Leonardo de Moura
3444a295e7 feat(library/compiler,runtime): builtin support for lean.name 2019-02-05 12:57:46 -08:00
Leonardo de Moura
9256618d67 chore(library/vm): remove vm_name 2018-10-23 11:32:56 -07:00
Leonardo de Moura
3ac6eab393 chore(library/vm): remove vm_list 2018-10-02 08:44:05 -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
d92679f969 refactor(*): replace name with lean.name 2018-05-20 09:42:44 -07:00
Leonardo de Moura
a52b418452 refactor(*): mk sure old name has same shape of new lean.name type 2018-05-20 08:48:48 -07:00
Leonardo de Moura
db4b00c7d8 chore(util,library): remove small_object_allocator
We use small_object_allocator to allocate vm_obj's.
However small_object_allocator is not thread safe. So, we need to copy
vm_obj's between threads. Moreover, in our experiments, we observed that
JEMALLOC is actually faster than the small_object_allocator.

Here are numbers for the reduced corelib.

small_object_allocator:  15.62 secs
gcc 4.9 allocator:       16.19 secs
jemalloc:                13.83 secs
2018-04-12 16:43:10 -07:00
Gabriel Ebner
93d00534e0 fix(library/vm): enable bounds checks 2017-02-15 13:39:00 -08:00
Leonardo de Moura
b1d097e63a feat(library/init/meta): add 'delta' tactic for applying delta reduction
closes #1331
2017-01-26 19:04:07 -08:00
Leonardo de Moura
6f502b9afd fix(library/vm): make sure vm_rb_map objects can be stored in ts_vm_obj
See discussion at #1337
2017-01-26 15:58:11 -08:00
Leonardo de Moura
434ada7dcc chore(library/vm,library/tactic): add missing override 2017-01-24 16:19:36 -08:00
Leonardo de Moura
7a6b9e193c feat(library/vm, frontends/lean/info_manager): add thread safe vm_obj wrapper, and use it to store arbitrary vm thunks in the info_manager 2017-01-21 22:38:33 -08:00
Leonardo de Moura
6d06f8bf29 feat(library/init/meta/name): add name.append 2016-11-18 14:25:30 -08:00
Leonardo de Moura
d5aa92eaeb feat(library/tactic/tactic_state): add vm_obj introspection 2016-11-14 21:58:34 -08:00
Leonardo de Moura
6a49b2e18b chore(library/vm,library/tactic): fix warnings produced by the new clang++ 2016-09-25 11:14:28 -07:00
Leonardo de Moura
0db1f3a9d1 feat(library/init/meta): add helper functions 2016-07-23 11:39:11 -07:00
Leonardo de Moura
2df6fb35e6 feat(library/vm): avoid list<A> eager conversion to vm_obj (for A in {name, level, expr}) 2016-06-09 14:16:32 -07:00
Leonardo de Moura
376bc8a090 feat(library/vm): expose 'declaration' C++ object 2016-06-07 15:38:48 -07:00
Leonardo de Moura
36c61bc0fb refactor(library/init): cmp_result => ordering 2016-06-07 10:14:07 -07:00
Leonardo de Moura
6157c66ac3 feat(library/vm/vm): allow vm_external subclasses to use their own memory allocation policy 2016-06-06 12:50:55 -07:00
Leonardo de Moura
fb6c9f2879 feat(library/vm/vm_expr): add more functions to 'expr' API 2016-06-06 11:26:19 -07:00
Leonardo de Moura
163a650ede chore(library/vm): fix style 2016-06-03 16:22:14 -07:00
Leonardo de Moura
fe4fafd95d chore(library/vm): remove unnecessary includes 2016-06-03 13:07:06 -07:00
Leonardo de Moura
eafc78f02d feat(library/meta/name): add extra name functions 2016-06-03 09:36:42 -07:00
Leonardo de Moura
924f3629ee feat(library/vm): expose name of the C++ functions that implement builtins 2016-06-02 12:48:43 -07:00
Leonardo de Moura
a6a7daff59 refactor(library/vm): avoid constants.txt when creating bindings 2016-06-02 11:45:56 -07:00
Leonardo de Moura
81947e145e feat(library/vm,library/compiler): add support for builtin cases_on 2016-06-01 19:06:52 -07:00
Leonardo de Moura
6f02d30185 feat(library/vm): add basic support for C++ name objects in the VM
We still need to add support for the recursor
2016-06-01 13:10:24 -07:00