Commit graph

34 commits

Author SHA1 Message Date
Leonardo de Moura
bda46cc9ac feat(kernel): add inductive_decl type on top of runtime/object, and ajust kernel/inductive.cpp 2018-06-26 12:16:33 -07:00
Leonardo de Moura
bb0b43798c feat(kernel/declaration): add wrappers for accessing inductive/constructor/recursor declarations 2018-06-25 15:01:02 -07:00
Leonardo de Moura
7684860aec feat(kernel): add C++ wrappers for creating inductive declarations 2018-06-25 14:24:48 -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
9c6238e1ac refactor(kernel/declaration): reducibility hints as runtime/object 2018-06-25 08:04:44 -07:00
Leonardo de Moura
ede1a51d60 refactor(kernel/declaration): remove self_opt flag from reducibility hints
This flag was used by the kernel to decide whether the following
heuristic should be used to avoid unfolding `f` at `is_def_eq`.

       f a =?= f b
       -----------
         a =?= b

This heuristic was introduced at Lean1 after a discussion with
Georges Gontier. Since this discussion, we added support for
caching failures of this heuristic. This proved to be much more
effective to attack the performance problems.
Moreover, we do not even use this flag in the `type_context::is_def_eq`
used during elaboration.

The current codebase contains only one place where this flag was set to
`false`: coercions generated at structure_cmd. This change was
made at commit
1c70514231
in the Lean2 codebase when we were not caching failures and
the kernel type checker was also used during elaboration.
2018-06-22 09:02:50 -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
1bc7c0812c chore(kernel,library): remove task from the kernel and library 2018-05-18 09:06:03 -07:00
Leonardo de Moura
ef784ce7b8 fix(library/tactic/simp_lemmas): auto_params when adding simp lemmas 2017-12-09 09:47:39 -08:00
Gabriel Ebner
595cbb8fe9 refactor(*): task<T>, log_tree, cancellation_token 2017-03-23 08:57:52 +01:00
Gabriel Ebner
1a6629ce3b feat(frontends/lean/parser): keep list of tasks that have to succeed 2017-01-17 15:31:17 -08:00
Gabriel Ebner
a972c13ce9 refactor(library/task_queue): move task queue to util 2016-12-12 10:01:34 -05:00
Leonardo de Moura
f96d35dc1c fix(library/aux_definition,frontends/lean/definition_cmds): unfold macros at trust level 0 2016-12-05 13:08:12 -08:00
Leonardo de Moura
d40e97b4bc chore(*): compilation errors, fix style, fix warnings 2016-11-29 11:35:01 -08:00
Gabriel Ebner
3ecfddcbd5 fix(*): fix build 2016-11-29 11:12:43 -08:00
Gabriel Ebner
385ea13688 feat(kernel/declaration,*): all theorems are delayed, and are revealed on delta-reduction 2016-11-29 11:12:43 -08:00
Gabriel Ebner
8eb4bbd0cb fix(kernel/declaration): allow introspection of declarations in GDB
If the declaration::cell struct is not defined in the same header file
as declaration, GDB will show the cells as <incomplete type>.
2016-11-07 14:55:32 -08:00
Leonardo de Moura
f7df7dc9a7 refactor(kernel): add reducibility_hints 2016-09-04 16:30:02 -07:00
Leonardo de Moura
f4df90d6ac fix(kernel/declaration): bug at use_untrusted 2016-06-02 17:40:09 -07:00
Leonardo de Moura
df0d39ccee feat(kernel,library/definitional,frontends/lean/structure_cmd): make sure we can define inductive datatypes and structures containing untrusted declarations
If they contain untrusted declarations, then the associated
declarations (e.g., constructors) will be automatically tagged as untrusted.
2016-06-02 16:19:06 -07:00
Leonardo de Moura
7932872487 feat(kernel/declaration): untrusted constant declarations
This feature is useful for implementing the new tactic framework
2016-04-28 15:16:24 -07:00
Leonardo de Moura
a29eaf0067 feat(kernel): add 'trusted' flag for definitions 2016-04-11 15:49:29 -07:00
Leonardo de Moura
e635d9be9f refactor(kernel): rename get_weight to get_height at declaration
Motivation:
- It is the standard name for the concept: declaration height
- Avoid confusion with the expression weight
2015-06-30 12:59:10 -07:00
Leonardo de Moura
1e6550eda6 feat(kernel/default_converter): take into account the 'theorem' annotations in the converability checker
The idea is that we should seldon need to unfold theorems.
The convertability checker should use that.
When the convertability checker was implemented, theorems were opaque in
Lean. So, this hint was not needed.

This modification is another workaround for the performance problem with
the migrate command at library/data/real/division.lean.
This solution is better than applying proof irrelevance eagerly because
it also addresses similar problems in the HoTT library which does not
support proof irrelevance.

This commit also enables the conv_opt for all theorems.
2015-06-30 10:42:26 -07:00
Leonardo de Moura
bd28396be0 feat(kernel): transparent theorems
closes #576
2015-05-09 11:42:29 -07:00
Leonardo de Moura
cf7e60e5a6 refactor(kernel): remove "opaque" field from kernel declarations
see issue #576
2015-05-08 16:06:16 -07:00
Leonardo de Moura
57ea660963 refactor(*): start process for eliminating of opaque definitions from the kernel
see issue #576
2015-05-08 16:06:04 -07:00
Leonardo de Moura
dbc8e9e13a refactor(*): add method get_num_univ_params 2015-01-28 17:22:18 -08:00
Leonardo de Moura
bf081ed431 refactor(kernel): rename var_decl to constant_assumption
Motivation: it matches the notation used to declare it.
2014-10-02 17:55:34 -07:00
Leonardo de Moura
1d92097781 refactor(kernel/declaration): return reference to type/value/name 2014-09-25 12:17:04 -07:00
Leonardo de Moura
da481c3274 refactor(kernel): explicit initialization/finalization
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-24 10:12:28 -07:00
Leonardo de Moura
0779db7ae9 fix(kernel): set module_idx on theorems, otherwise we are not able to import theorems that use opaque definitions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-16 16:56:11 -07:00
Leonardo de Moura
33bbcd9526 chore(kernel/declaration): rename declaration::get_params to declaration::get_univ_params
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-02 16:20:34 -07:00
Leonardo de Moura
8872d4a531 refactor(kernel): rename definition class to declaration
The name was misleading since not every declaration is a definition.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-05-20 10:41:38 -07:00