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
Leonardo de Moura
740d42ea45
fix(library/tactic): we should preserve names when using the revert/do_something/intro idiom
2017-03-11 12:20:39 -08:00
Sebastian Ullrich
4d41b03168
chore(frontends/lean,library/tactic): remove old tactic_state functions
2017-02-17 15:41:58 +01: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
Gabriel Ebner
5fdc737dfc
feat(library/tactic): store name of current declaration in tactic_state
2017-01-28 08:27:19 +01:00
Leonardo de Moura
94f16d1e44
refactor(library/tactic): move defeq_canonizer::state to tactic_state
...
It was being stored in the environment before. This was very hackish,
and it was producing a series of unnecessary environment updates, and
thread local caches invalidations.
The new test tests/lean/run/heap.lean is 5x-6x faster after this commit.
2017-01-07 10:17:51 -08:00
Leonardo de Moura
5f87ec3356
feat(library/tactic): allow user to write their own pretty printer for tactic states
2016-12-30 18:58:50 -08:00
Leonardo de Moura
78f81034c6
feat(library): add helper methods
2016-08-29 08:31:33 -07:00
Leonardo de Moura
b317d4bc58
refactor(library/tactic): add hsubstitution module
2016-08-29 08:19:05 -07:00
Leonardo de Moura
206bf613d5
feat(library/tactic/subst_tactic): use substitutions instead of name_map<name> in the subst_tactic (low level) API
2016-08-28 13:29:44 -07:00
Leonardo de Moura
c032505023
chore(library/tactic/subst_tactic): missing '\n' in trace msg
2016-08-25 13:45:04 -07:00
Leonardo de Moura
8e63769413
chore(library/tactic/subst_tactic): remove 'static' to avoid warning in release mode
2016-08-22 09:23:18 -07:00
Leonardo de Moura
1ea3bc1683
fix(library/tactic/cases_tactic): lowlevel interface that gives access to renamed/introduced hypotheses
2016-08-21 15:55:56 -07:00
Leonardo de Moura
f7b9702438
fix(library/tactic/subst_tactic): typo
2016-08-21 15:55:56 -07:00
Leonardo de Moura
0f224ff437
fix(library/tactic/subst_tactic): incorrect depends_on
2016-08-16 11:19:06 -07:00
Leonardo de Moura
2ac7b5afca
fix(library/tactic/subst_tactic): typo
2016-07-15 13:52:55 -04:00
Leonardo de Moura
de0ae18dd1
feat(library/tactic/subst_tactic): add low-level subst tactic for internal use
2016-07-14 18:00:29 -04:00
Leonardo de Moura
59f2b9e8c2
refactor(library/type_context): "metavar_context & m_mctx" ==> "metavar_context m_mctx"
2016-06-25 13:08:03 -07:00
Leonardo de Moura
7390e8afda
refactor(library/app_builder): simplify app_builder API
2016-06-22 16:57:49 -07:00
Leonardo de Moura
38810ad4c1
refactor(library/tactic/subst_tactic): subst take a local instead of a name
2016-06-22 15:13:49 -07:00
Leonardo de Moura
359b566088
feat(library/tactic/subst_tactic): add tracing for subst tactic
2016-06-21 16:31:53 -07:00
Leonardo de Moura
397ea25e24
fix(library/tactic/subst_tactic): use intermediate state for errors
2016-06-20 10:22:36 -07:00
Leonardo de Moura
73b21b9e48
fix(library): assertion violations
2016-06-17 13:16:17 -07:00
Leonardo de Moura
cb9b5650b7
feat(library/tactic): add 'subst' tactic
2016-06-14 21:01:57 -07:00
Leonardo de Moura
aeee79da2b
chore(library): library/tactic => library/old_tactic
2016-06-06 16:38:27 -07:00
Leonardo de Moura
d8079aa16a
refactor(library): create copy of the kernel type_checker in library
...
Motivation: it will allow us to simplify the kernel type_checker and
make sure it implements the same API provided by type_context
2016-03-18 14:34:10 -07: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
69be4c720c
fix(library/tactic/subst_tactic): bug in 'subst' tactic
2015-06-12 12:11:44 -07:00
Leonardo de Moura
d0d3f9bb41
refactor(kernel,library,frontends/lean): add helper functions, and cleanup collect_locals
2015-06-05 17:29:36 -07:00
Leonardo de Moura
68688ecdf6
fix(library/tactic/subst_tactic): in the standard mode, use dependent elimination in the subst tactic (when needed)
...
Before this commit, the subst tactic was producing an type incorrect
result when dependent elimination was needed (see new test for an example).
2015-06-03 17:36:04 -07:00
Leonardo de Moura
d0987eb3ac
feat(library/tactic): add 'subtvars' tactic
2015-05-25 16:36:44 -07:00
Leonardo de Moura
a3f23d5233
feat(library/tactic): add improved 'subst' tactic
2015-05-25 15:03:59 -07:00