Commit graph

44 commits

Author SHA1 Message Date
Leonardo de Moura
559211d284 perf(library/local_context): fix performance bottleneck at local_const
This is one of the performance problems at issue #1646.
The method `local_context::erase_user_name(local_decl const & d)` was
inefficient when there are many locals with the same user facing name.
For size 7 in the example described at issue #1646, the average size of the
declaration list was 400. Here are the runtimes for size 7

Before: 19.021 secs
After:  16.433 secs

There are more performance issues.
2017-06-06 10:01:08 -07:00
Leonardo de Moura
b42ae2cf54 fix(library/type_context): fixes #1500 2017-03-31 19:19:44 -07:00
Leonardo de Moura
3322adde1b fix(library/tactic/subst_tactic): fixes #1467 2017-03-17 19:54:35 -07:00
Daniel Selsam
1f6306d068 perf(library/inductive_compiler): simplification with sizeof lemmas 2017-03-01 21:13:20 -08:00
Leonardo de Moura
53667dd602 fix(library): change API and make sure we don't crash when searching for a non existing local decl
Fixes #1363

After error recovery has been implemented in the elaborator, a few
assumptions made in the type context are not valid anymore since we may
be recovering from errors, and the local and metavariable contexts may
be invalid.

I used the approach used in the class environment.

- find* methods return optional<...>
- get* methods throw exception for unknown elements

Remarks:

I preserved code patterns such as

     optional<local_decl> d = lctx.find_local_decl(...)
     lean_assert(d)

and did not convert them into

     local_decl d = lctx.get_local_decl(...)

Reason: the intention is clear that the local must be defined there.
If it is not we should analyze the problem and decide whether we should
throw an exception or not.

However, I converted code patterns such as

    local_decl d = *lctx.find_local_decl(...)

into

    local_decl d = lctx.get_local_decl(...)

Disclaimer: this change fixes issue #1363, but it may obfuscate other bugs.
2017-02-07 09:38:19 -08:00
Leonardo de Moura
da945e34de perf(library/equations_compiler/util, library/local_context): preserve instance fingerprint and avoid flushing the cache 2017-01-07 00:17:09 -08:00
Leonardo de Moura
d546671849 chore(library/local_context): style 2017-01-03 15:00:46 -08:00
Leonardo de Moura
34073c6f32 feat(library/tactic/smt/smt_state): improve smt_goal formatting 2017-01-03 13:50:25 -08:00
Gabriel Ebner
4dac796337 feat(library/local_context): make get_unused_name O(log(n)) 2016-09-19 16:38:03 -07:00
Leonardo de Moura
e6dd5242fc feat(library/equations_compiler): add option eqn_compiler.zeta 2016-09-10 14:00:16 -07:00
Leonardo de Moura
532efde665 chore(library/local_context): fix warning 2016-09-09 18:01:39 -07:00
Leonardo de Moura
6c13241d59 feat(library/local_context): add low-level methods for declaring local_decls 2016-09-09 17:43:07 -07:00
Leonardo de Moura
78f81034c6 feat(library): add helper methods 2016-08-29 08:31:33 -07:00
Leonardo de Moura
98aefca014 fix(library/local_context): depends_on should take into account assigned metavariables 2016-08-25 13:49:54 -07:00
Leonardo de Moura
5c0a69657d feat(frontends/lean/pp,library/local_context): nicer pp for fresh names 2016-08-05 19:06:26 -07:00
Leonardo de Moura
bae10d7530 feat(library/type_context): restrict context of metavariables during unification if approximate() is true 2016-08-02 16:31:12 -07:00
Leonardo de Moura
c46403265b feat(library/local_context): add instance_mvars method for local_context object 2016-07-31 02:36:51 -07:00
Leonardo de Moura
cc429b1ab7 refactor(library/local_context,library/type_context): remove frozen mode, cleanup instance cache 2016-07-27 16:07:48 -07:00
Leonardo de Moura
c4953cac43 feat(frontends/lean/elaborator): only use eliminator elaboration is function is fully applied 2016-07-25 17:24:57 -07:00
Leonardo de Moura
394995dff0 fix(library/local_context): missing 'const' 2016-07-12 13:41:42 -04:00
Leonardo de Moura
07388479e6 feat(library/local_context): helper functions 2016-07-05 09:08:11 -07:00
Daniel Selsam
e1bc0a68e6 refactor(simplifier): port skeleton to new tactic framework
Conflicts:
	library/init/meta/tactic.lean
	src/library/tactic/tactic_state.cpp
2016-06-24 15:20:40 -07:00
Leonardo de Moura
fd08a9badf refactor(library/local_context): store pp_name in local_ref's
This commit also removes the now obsolete API get_local_pp_name from abstract_type_context
2016-06-21 10:50:38 -07:00
Leonardo de Moura
125a80ad69 feat(library/tactic): add 'clear' tactic 2016-06-11 20:23:24 -07:00
Leonardo de Moura
6829c81f18 feat(library/tactic): add 'rename' tactic 2016-06-11 19:18:25 -07:00
Leonardo de Moura
c5d56be4ee fix(library/local_context): typo 2016-06-10 18:29:41 -07:00
Leonardo de Moura
181e48e3f3 feat(library/tactic/tactic_state): add tactic_state.to_format 2016-06-09 10:47:17 -07:00
Leonardo de Moura
bd18516ddd fix(library/local_context): typo 2016-05-01 19:01:30 -07:00
Leonardo de Moura
ee27480210 feat(library/type_context): initialize type class resolution 2016-03-27 13:41:07 -07:00
Leonardo de Moura
8038ca5f0c refactor(metavar_context): metavar_decl contains a local_context instead of local_decls
Motivations:
- A goal is essentially a metavar_decl
- We need the local_context to implement restrict_metavars_context method
2016-03-15 12:52:30 -07:00
Leonardo de Moura
a823b0e6ec feat(library/type_context): pop_local for type_context 2016-03-09 10:22:48 -08:00
Leonardo de Moura
fcf3e2e065 fix(library/local_context): typo 2016-03-05 16:57:15 -08:00
Leonardo de Moura
c0fc9e5479 feat(library/local_context, library/metavar_context): add new well_formed methods and procedures 2016-03-05 14:56:13 -08:00
Leonardo de Moura
fdbe8ee98a feat(library/local_context): add get_local_decl_from_user_name 2016-03-05 13:35:54 -08:00
Leonardo de Moura
c3568e1ebb fix(library/local_context): typo in assertion 2016-03-05 13:28:33 -08:00
Leonardo de Moura
66d583d279 feat(library/local_context): add well_formed debugging methods 2016-03-05 13:09:36 -08:00
Leonardo de Moura
994c9298b5 feat(library/local_context): add local_decls (set), and freeze operation for local declarations 2016-03-04 13:59:11 -08:00
Leonardo de Moura
5194df5e97 feat(library/local_context): encode order using a tree instead of a list
Motivations:
- It will be faster to delete local declarations.
- It is faster to find all local declarations that were created after a
give local declaration.
2016-03-01 16:23:51 -08:00
Leonardo de Moura
2982db6f80 feat(library/local_context): add new local context type 2016-03-01 13:40:37 -08:00
Leonardo de Moura
632d4fae36 chore(library): rename local_context to old_local_context 2016-02-11 18:15:16 -08:00
Leonardo de Moura
c9e9fee76a refactor(*): remove name_generator and use simpler mk_fresh_name 2016-02-11 18:05:57 -08:00
Leonardo de Moura
df3100d2cd fix(library/local_context): bug in abstract_locals procedure 2015-09-12 17:17:13 -07:00
Leonardo de Moura
70fc05294b refactor(library/local_context): avoid hack in local_context 2015-06-18 15:41:00 -07:00
Leonardo de Moura
756fae7c2a refactor(frontends/lean): move local_context to library 2014-12-10 12:43:32 -08:00
Renamed from src/frontends/lean/local_context.cpp (Browse further)