Leonardo de Moura
fd5bfc7dfe
refactor(kernel): simplify binder_info
...
Now, it is an enumeration type like its Lean counterpart.
2018-06-20 15:31:40 -07:00
Leonardo de Moura
e90585737f
refactor(*): use C++11 std::current_exception and std::rethrow_exception
...
With these new C++11 APIs, we can delete the `clone` and `rethrow`
methods from our exception classes.
2018-06-07 16:28:54 -07:00
Leonardo de Moura
bdea7d420d
chore(*): type_context ==> type_context_old
2018-03-05 12:38:24 -08:00
Leonardo de Moura
4a936f004b
feat(library/tactic): use new cache in the apply and simp tactics
2018-02-21 15:04:20 -08:00
Sebastian Ullrich
6ab13a433d
chore(library/type_context): should not have an implicit constructor, copy constructor, or assignment operator
2018-02-02 08:58:53 -08:00
Leonardo de Moura
040722c7e7
feat(library/init/meta): add unify config option to apply_cfg
...
This commit also fixes a problem in the `apply` tactic error messages.
2018-01-04 12:51:59 -08:00
Leonardo de Moura
e23db3970a
feat(library/init/meta/tactic): apply tactic return parameter name associated with new metavars
2017-12-10 12:11:58 -08:00
Leonardo de Moura
062ebf4344
fix(library/tactic/apply_tactic): when using elimator-like definitions
...
We found this problem when developing the red-black tree module.
2017-11-16 11:21:17 -08:00
Leonardo de Moura
f7fe2a775c
feat(library/init/meta/rewrite_tactic): improve rewrite tactic
...
`rewrite` tactic improvements
- Add support for `auto_param` and `opt_param`
- Order new goals using the same strategies available for `apply`
- Allow user to set configuration object in interactive mode.
@Armael This commit should address the issue you raised about the order
of new goals in the `rewrite` tactic.
See new test tests/lean/run/rw1.lean for examples.
2017-06-30 12:03:27 -07:00
Leonardo de Moura
e971acabb0
feat(library/init/meta): handle auto_params and opt_params at apply tactic
2017-06-27 18:17:48 -07:00
Leonardo de Moura
ac19b15169
fix(library/tactic/apply_tactic): remove unnecessary code from apply_tactic, and add tests for #1342
...
See issue #1342
2017-06-27 16:07:59 -07:00
Leonardo de Moura
5a2b7348f9
feat(library/tactic/apply_tactic): make apply tactic more robust
...
See issue #1342
Support for auto_param and opt_param have not been implemented yet.
2017-06-27 10:42:26 -07:00
Leonardo de Moura
d0dede53f5
chore(library/tactic): make sure "pattern" is the first argument of is_def_eq
2017-04-25 09:59:04 -07: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
f650a1b873
refactor(library/init/meta): avoid '_core' idiom using default parameters
...
I kept a few core methods (e.g., exact_core and apply_core). Reason:
if we use default parameters
meta constant exact (e : expr) (md := semireducible) : tactic unit
then, we will not be able to write
to_expr p >>= exact
The workaround is
do t <- to_expr p, exact t
or
to_expr p >>= (fun x, exact x)
One alternative is to change how we handle default parameters, and
eta-expand applications that involve default parameters.
We may also have an attribute [eta_expand]. Then
attribute [eta_expand] foo
instructs the elaborator to automatically eta-expand foo-applications.
The attribute would give users more control, and avoid potential
performance problems. Without the attribute, then for every function
application the elaborator has to check the type and decide whether it
must be eta-expanded or not.
@gebner @kha What do you think?
2017-02-14 09:46:55 -08:00
Johannes Hölzl
9902a0d4d1
feat(src/library/tactic): apply_core returns list of all generated metavariables
2017-02-10 16:07:33 -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
9f6e71b374
feat(library/tactic): add "approximate" parameter to apply_core and rewrite_core
...
If this parameter is set to true, then approximate unification is
used.
closes #1208
2016-12-10 10:24:05 -08:00
Leonardo de Moura
ef28ae5073
feat(library/vm/vm_format,library/tactic): use thunks unit->format when producing error messages
2016-08-04 19:19:09 -07:00
Leonardo de Moura
bc9a0701f8
refactor(library/tactic/apply_tactic): expose 'apply' tactic for internal use
2016-07-10 10:41:02 -07:00
Leonardo de Moura
d524ab013f
refactor(library/init/meta): make sure 'transparency' is the first argument
2016-06-28 10:25:38 +01: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
f05e0cfa5a
fix(library/tactic/apply_tactic): instantiate metavariables before type class resolution
2016-06-18 10:38:54 -07:00
Leonardo de Moura
9cc3fb90ff
chore(library/tactic/apply_tactic): remove trace msg
2016-06-18 10:35:12 -07:00
Leonardo de Moura
00717318f0
feat(library/tactic/apply_tactic): add option to disable type class resolution to apply_core
2016-06-18 10:03:38 -07:00
Leonardo de Moura
66c6d3b87a
feat(library/tactic/apply_tactic): add remove_redundant_goals
2016-06-17 20:21:17 -07:00
Leonardo de Moura
61a845c005
feat(library/tactic): add 'apply' tactic
2016-06-17 20:11:52 -07:00
Leonardo de Moura
aeee79da2b
chore(library): library/tactic => library/old_tactic
2016-06-06 16:38:27 -07:00
Leonardo de Moura
2a38ddb124
refactor(library): merge util and occurs
2016-03-22 09:51:06 -07:00
Leonardo de Moura
c98f1bfd24
refactor(library): remove type_util module and implement get_num_args using abstract_type_context
2016-03-21 16:30:08 -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
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
f67181baf3
chore(*): remove support for Lua
2016-02-11 17:17:55 -08:00
Leonardo de Moura
6a36bffe4b
fix(library/class_instance_resolution): bugs in new type class resolution procedure
2015-11-08 14:04:57 -08:00
Leonardo de Moura
dd5bb8e7f7
chore(library/tactic/apply_tactic): remove dead code
2015-09-16 08:41:02 -07:00
Leonardo de Moura
634c0b5e9d
feat(library/tactic,frontends/lean): propagate new options back to elaborator
2015-09-02 20:34:14 -07:00
Leonardo de Moura
a3c404ac3b
feat(library/tactic/apply_tactic): do not report elaboration failure in apply tactic when proof_state.report_failure() is false
2015-08-21 15:45:52 -07:00
Leonardo de Moura
0ae24faae3
feat(library/tactic/constructor_tactic): use 'fapply' in 'constructor' tactic
...
closes #676
2015-06-16 12:03:31 -07:00
Leonardo de Moura
169f956143
fix(library/tactic): remove dead code
2015-06-16 11:57:37 -07:00
Leonardo de Moura
d547698a56
refactor(library,library/tactic): move class_instance_synth to library
...
This module will be needed by the simplifier
2015-06-01 16:30:40 -07:00
Leonardo de Moura
ed01242bc1
chore(library/tactic/apply_tactic): remove dead code
2015-05-26 12:18:50 -07:00
Leonardo de Moura
7f0951b8e7
feat(library/tactic): improve assumption tactic performance
2015-05-25 20:22:37 -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
0b57f7d00a
refactor(library/tactic): refine interface between tactic and proof-term modes
...
Some constraints were being lost with the previous interface.
This is why we had a workaround in fintype.lean.
We can also remove some hacks we have used in the past.
2015-05-07 18:02:51 -07:00
Leonardo de Moura
e379034b95
feat(library/tactic): improve 'assumption' tactic
...
- It uses the unifier in "conservative" mode
- It only affects the current goal
closes #570
2015-05-02 17:33:54 -07:00
Leonardo de Moura
9ba8b284a1
fix(library/tactic/apply_tactic): add eapply, and fix issue #361
2015-05-01 15:08:00 -07:00
Leonardo de Moura
63eb155c7e
feat(library/tactic): add 'injection' tactic
...
see issue #500
2015-05-01 12:45:21 -07:00
Leonardo de Moura
7e9f574ef3
fix(library/tactic/apply_tactic): use internally 'apply' instead of 'fapply' as the default "apply" tactic
...
This changes improves the 'constructor' tactic
2015-04-30 21:58:35 -07:00
Leonardo de Moura
15e52b06df
fix(library/tactic/constructor_tactic): bug in constructor tactic
...
see example (constr_tac2.lean) in comment at issue #500
2015-04-30 20:18:24 -07:00