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
160b7e8847
refactor(library/init/meta/expr): local_const will have only one field
...
In Lean3, we supported two kinds of local constant:
context-less (inherited from Lean2) and context-based (type,
binder-info and pretty printing name are stored in the context).
The context-less was used in the kernel and a few modules we kept when
we moved from Lean2 to Lean3. Even if we keep the hybrind
representation, we should not expose the context-less to users.
2018-05-21 15:36:09 -07:00
Leonardo de Moura
4de9b8c177
chore(library/vm): rename constants
2018-05-20 12:30:15 -07:00
Leonardo de Moura
1e11611388
chore(library): cleanup constants.txt
2018-04-12 16:43:11 -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
Leonardo de Moura
9afb53fad5
feat(kernel/expr): allow metavariables to have user-facing names
...
We need this feature for:
1) Defining nonlinear search patterns. Example: (?m <= ?m + 1)
2) Preprocessing recursive equations and support the pattern
refinement approach used in Agda. Example: in Agda, they accept
```
def append {A : Type} : Π (m n : nat), Vec A m -> Vec A n -> Vec A (m + n)
| m n nil ys := ys
| m n (cons m' x xs) ys := cons x (append m' n xs ys)
```
These equations have to be refined. For example, `m` has to be
replaced with `0` (in the first equation), and `succ m'` in the
second. To implement this kind of refinement, we need to convert
the pattern variables (local constants) into metavariables during
elaboration. Then, the unassigned metavariables become local constants
again. This preprocessing step will fix some of the issues on #1594 .
To completely fix #1594 , we will need yet another preprocessing step
which will implement "complete transition" used in the equation
compiler before we start elim_match.cpp
2017-07-16 07:16:41 -07:00
Gabriel Ebner
b0185774a4
fix(library/vm/vm_expr): do not use expr_var as both function and class name
2017-07-04 09:10:35 +02:00
Leonardo de Moura
d73facb8bc
feat(library/init/meta/expr): add expr.has_local_in
2017-07-01 20:23:37 -07:00
Leonardo de Moura
b8fa7f5311
fix(library): expr, level, hash_map, rb_map has_repr instances should be has_to_string since they do not produce results that can be parsed by Lean
...
See #1664
2017-06-18 18:33:27 -07:00
Leonardo de Moura
dc1a1c8540
refactor(library): has_to_string ==> has_repr
...
See issue #1664
This is just the first step to implement proposal described at issue #1664 .
2017-06-18 18:29:19 -07:00
Sebastian Ullrich
283d8ade1a
fix(library/quote): use opaque macro for elaborated expr quotations
2017-06-07 10:00:17 -07:00
Gabriel Ebner
04f9eb0b4f
refactor(library/init/meta/expr): pure Lean implementation of reflected
2017-06-01 10:17:51 +02:00
Leonardo de Moura
42eeb445d4
fix(library): make sure `(t) does not evaluate t
...
See #1631
2017-05-31 22:03:15 -07:00
Leonardo de Moura
e163b5c884
feat(library/init/meta/expr): binder_info.other ==> binder_info.aux_decl
2017-05-23 21:42:52 -07:00
Sebastian Ullrich
84997bf4de
refactor(init/meta/expr): unify expr and pexpr
2017-05-17 10:38:12 -07:00
Sebastian Ullrich
808ab73d93
refactor(init): use list for expr.macro args
2017-05-14 19:17:28 -07:00
Sebastian Ullrich
42eb0c680e
feat(kernel/inductive,library/inductive_compiler): do not enforce positivity rule on meta inductives
2017-05-14 19:17:28 -07:00
Gabriel Ebner
b3975c8fc1
chore(library/vm/vm_expr): fix compiler warning
2017-05-11 11:04:11 +02:00
Sebastian Ullrich
4b21b13649
refactor(init): replace has_quote class with reflected
2017-05-09 16:02:42 -07:00
Sebastian Ullrich
ead6318ee0
feat(frontends/lean/elaborator): substitute reflected locals into expr quotes
2017-05-09 16:02:41 -07:00
Sebastian Ullrich
2825c5fbcc
feat(frontends/lean/elaborator): elaborate ``(e) to type reflected e` if possible and add coercion reflected -> expr
2017-05-09 16:02:41 -07:00
Sebastian Ullrich
0ca6e2c96f
refactor(library/{type_context,compiler/preprocess},frontends/lean/elaborator): use opaque, general type class instead of special app elaboration for eval_expr
2017-04-27 16:04:59 -07:00
Sebastian Ullrich
026c5ee509
fix(library/init/meta/expr,library/vm/vm_expr): fix macro args
2017-04-11 17:07:28 -07:00
Leonardo de Moura
31b6dc222d
feat(library/init/meta/expr): add expr.is_annotation
2017-03-18 13:40:11 -07:00
Sebastian Ullrich
5d68938a9c
feat(frontends/lean): expr literals ```(...)
2017-03-05 08:37:16 -08:00
Johannes Hölzl
bb4920fcbc
feat(library/vm/vm_expr): export instantiate_univ_params
2017-02-17 20:08:18 -08:00
Sebastian Ullrich
e8fa54cc51
refactor(init/meta): move macro creation defs from expr to pexpr
2017-02-17 13:45:57 +01:00
Sebastian Ullrich
d15591a2d8
feat(library,frontends/lean): expose parser to Lean and use for parsing tactic parameters
2017-02-17 13:45:56 +01:00
Gabriel Ebner
93d00534e0
fix(library/vm): enable bounds checks
2017-02-15 13:39:00 -08:00
Leonardo de Moura
5ca18b8d2e
feat(library/init/meta): add helper functions
2017-02-11 16:52:06 -08:00
Gabriel Ebner
95068e4e79
feat(library/sorry): make sorry a macro
2017-02-05 14:01:03 +01:00
Gabriel Ebner
952f444710
feat(init/meta/task): allow task creation from VM
2017-01-28 08:27:23 +01: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
0c4c41ae54
feat(library/init/meta): produce nicer error message for overloaded simp/ematch lemma
2017-01-07 14:13:46 -08:00
Leonardo de Moura
3061d8b9a3
feat(library): add mk_int_val_ne_proof
2016-12-24 15:22:31 -08:00
Jared Roesch
e65d90ac79
feat(*): C++ code generator
...
in progress move of Lean.native to init
2016-12-05 16:11:41 -08:00
Leonardo de Moura
21bad7cb97
feat(library/init/meta/comp_value_tactics): add support for char/string/fin at comp_val tactic
2016-11-23 13:19:54 -08:00
Leonardo de Moura
242ad1bd65
feat(library/init/meta/comp_value_tactics): add comp_val tactic for testing
2016-11-22 17:03:21 -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
a7af70da2e
feat(library/vm): add expr.copy_pos_info
2016-11-10 11:50:38 -08:00
Leonardo de Moura
4d52de6f33
refactor(library/tactic/simplify): add simplify subclasses, and use new simplifier at nested
2016-10-18 16:18:25 -07:00
Leonardo de Moura
89703ce669
feat(library/vm/vm_expr): expose replace
2016-10-01 09:23:40 -07: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
148da46481
feat(frontends/lean): 'mutual' and 'meta' are now keywords
2016-09-24 10:44:40 -07:00
Leonardo de Moura
94905a5511
feat(library/vm/vm_expr): add expr.hash
2016-06-23 12:45:31 -07:00
Leonardo de Moura
f0ec88c1d3
refactor(library/init/meta): free_var ==> local_const
...
Use the same names used in the C++ version
2016-06-22 14:48:09 -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
6157c66ac3
feat(library/vm/vm): allow vm_external subclasses to use their own memory allocation policy
2016-06-06 12:50:55 -07:00