Commit graph

929 commits

Author SHA1 Message Date
Leonardo de Moura
77d3a788e8 refactor(init): init/category ==> init.control 2018-04-27 08:33:08 -07:00
Leonardo de Moura
0af913c99f refactor(library/init/data/string): define decidable_eq string instance earlier 2018-04-27 08:16:14 -07:00
Leonardo de Moura
c427fb4086 refactor(*): create library/init/lean folder
The new folder will contain the new parser, macro expander and compiler.
This commit also renames the namespace for the old parser `lean3.parser`
2018-04-27 08:02:40 -07:00
Leonardo de Moura
1e11611388 chore(library): cleanup constants.txt 2018-04-12 16:43:11 -07:00
Leonardo de Moura
1ad1080f11 refactor(library): keep only basic nat theorems
All theorems are proved without using the tactic framework.
Thus, we can define `fin/uint32/uint64` types and their operations
before we define the tactic framework.
2018-04-11 16:47:54 -07:00
Leonardo de Moura
10ddfdafbd chore(*): remove VM monitor 2018-04-10 16:08:47 -07:00
Leonardo de Moura
b74e05b262 chore(*): remove mk_*_instance tactics 2018-04-10 16:03:42 -07:00
Leonardo de Moura
1b1495aea4 chore(*): remove norm_num 2018-04-10 15:59:29 -07:00
Leonardo de Moura
7aaac31e35 chore(library/init/data/nat): remove dependency 2018-04-10 15:48:13 -07:00
Leonardo de Moura
b0e49535fa chore(*): remove transfer and coinductive predicates 2018-04-10 13:38:18 -07:00
Leonardo de Moura
b14d69b1d7 chore(*): remove converter, ac_tactics, hole_commands, rbtree/rbmap proofs, bitvec 2018-04-10 12:25:51 -07:00
Leonardo de Moura
a2f0bf7c1b chore(*): disable SMT tactic framework and backward chaining 2018-04-10 12:05:51 -07:00
Sebastian Ullrich
3fefe94757 refactor(library/init/core,library/init/unit): make unit an abbreviation of punit.{0} 2018-03-27 10:33:04 -07:00
Sebastian Ullrich
70167def6f refactor(init/category/state): replace monad_state_lift with Haskell's MonadState
* does not leak information about the inner monad via out_param
* can be derived from an inner `monad_state` instance
2018-03-20 14:58:37 -07:00
Sebastian Ullrich
23884d2863 refactor(init/data/option_t): move to init/category and adapt style 2018-03-20 14:58:36 -07:00
Sebastian Ullrich
bcbe5ec9f4 refactor(init/category/functor): merge has_map into functor 2018-03-20 14:58:36 -07:00
Sebastian Ullrich
afe3078b4b chore(init/category): final touches 2018-03-20 14:58:36 -07:00
Sebastian Ullrich
69cfdbd290 refactor(init/category): make all monad transformers structures, replace monad classes with has_monad_lift_t wrappers 2018-03-20 14:58:36 -07:00
Sebastian Ullrich
159b45c74f refactor(init/category/state): introduce monad_state
* rename `read/write` to `get/put`, as in Haskell
* define `state` as `state_t id`
2018-03-20 14:58:35 -07:00
Sebastian Ullrich
1c6861528b refactor(init/category): move monad laws into separate type classes defined after the tactic framework 2018-03-20 14:58:35 -07:00
Sebastian Ullrich
63382cf7e3 chore(init/category/transformers): move monad_transformer, monad_lift out of monad namespace, make universe polymorphic 2018-03-20 14:58:35 -07:00
Leonardo de Moura
2889482fe9 fix(library/init/meta/interactive): fixes #1943 2018-03-06 17:36:18 -08:00
Sebastian Ullrich
61b6e26671 fix(init/meta/tactic): make tactic.funext work on non-abstractions 2018-02-28 12:49:22 +01:00
Leonardo de Moura
b72d465835 refactor(library/init/meta): remove tactic_state.mk_empty
The tactic_state object will contain a name_generator for creating fresh
names. `tactic_state.mk_empty` is bad because it does not have sufficient
information to create this name_generator.
Moreover `tactic_state.mk_empty` was only being used to convert
`tactic A` into a `parser A`.
We implement this primitive now in C++. In C++, we will be able
to use the parser name generator to initialize a fresh `tactic_state`.
2018-02-27 14:45:47 -08:00
Leonardo de Moura
c0267727a8 fix(library/init/meta): mk_fresh_name should not be used to create user facing names
The tactic `mk_fresh_name` is used to create internal unique ids.
We should not use them to create (temporary) user facing
names. Reasons:
1- They are "cryptic".
2- They are not very stable. Minor changes in Lean may change the
value returned and may break proofs that rely on these fresh names.
2018-02-26 10:49:53 -08:00
Leonardo de Moura
21812768b0 fix(library/init/meta/interactive): fixes #1889 2018-02-23 12:39:11 -08:00
Leonardo de Moura
24e7a5a339 feat(library/tactic): add frozen_local_instances tactic for retrieving list of frozen local instances 2018-02-23 11:39:38 -08:00
Leonardo de Moura
db4fcac40c feat(library): add tactic unfreeze_local_instances 2018-02-23 11:12:05 -08:00
Leonardo de Moura
46ed0ad677 refactor(library/congr_lemma): remove mk_rel_iff_congr_lemma and mk_rel_eq_congr_lemma 2018-02-21 15:04:20 -08:00
Leonardo de Moura
afb65f3d3d feat(library/init/meta/comp_value_tactics): add comp_val interactive tactic 2018-02-21 10:35:26 -08:00
Leonardo de Moura
61930c3d85 fix(library/init/meta/comp_value_tactics): instantiate metavars 2018-02-21 10:28:27 -08:00
Scott Morrison
5d094cf835 cleanup(init/meta/tactic) removing obsolete meta constants 2018-02-13 10:45:04 -08:00
Leonardo de Moura
9331945e8b fix(library/init/meta/interactive): alternative fix for issue at #1913
We also document the problem to make sure we don't spend time again
trying to understand the workaround. This is an instance of a bigger
problem that should be addressed later.
2018-01-28 09:07:11 -08:00
Leonardo de Moura
1c61129d40 feat(library/init/meta/tactic): expose approx at unify and is_def_eq tactics 2018-01-25 22:27:18 -08:00
Leonardo de Moura
368f17d0b1 feat(library/tactic/simplify): add simp! 2018-01-16 17:29:24 -08:00
Leonardo de Moura
c195d7c2a1 feat(library/tactic/simp_tactic): improve mk_simp_attr
- An new simp attribute may depend on other existing attributes

- Add `[norm]` simp attribute. It is an extension of the default `[simp]` attribute.
  It should be used to add extra rules for normalizing goals.
  These extra rules are used to produce normal forms and/or reduce the
  number of constants used in a goal. Here is an example coming from a
  discussion with @kha. When working with monads, we may want to
  eliminate `<$>` by using the lemma `f <$> x = x >>= pure ∘ f`.
  This lemma is in the `[norm]` simp set, but it is not in `[simp]`
2018-01-16 16:47:30 -08:00
Leonardo de Moura
cebde17bec feat(library/tactic/simplify): simp reduces c a_1 ... a_n = c b_1 ... b_n into a_1 = b_1 /\ ... /\ a_n = b_n 2018-01-12 18:18:56 -08:00
Leonardo de Moura
9eb22cd548 feat(library/constructions/injective): automatically generate auxiliary lemma *.inj_eq for constructors
We are going to use these lemmas in the simplifier.
2018-01-12 16:41:12 -08:00
Leonardo de Moura
58fce78282 feat(library/init/meta/interactive): add interactive tactic subst_vars 2018-01-12 14:37:11 -08:00
Leonardo de Moura
5bad6d5372 feat(library/init/meta/tactic): subst supports heterogeneous equalities that are actually homogeneous 2018-01-12 14:32:49 -08:00
Leonardo de Moura
4bd314f7bd feat(library/tactic/simplify): simp reduces c_1 ... = c_2 ... to false 2018-01-12 11:30:45 -08:00
Leonardo de Moura
56920639fa chore(library/init/meta/coinductive_predicates): remove old comment 2018-01-12 10:56:39 -08:00
Leonardo de Moura
c3d4a9456e feat(library/init/meta/interactive): add sorry interactive tactic (alias for admit). 2018-01-11 16:58:46 -08:00
Leonardo de Moura
587540f11b feat(frontends/lean): add abbreviation command
This command is not just a cosmetic feature.
We need it to defined `id_rhs` before the tactic framework is defined.
We want `id_rhs` to be used in all definitions generated by the equation
compiler. Right now, it is only used in definitions defined after the
tactic framework.
2018-01-05 15:40:59 -08:00
Leonardo de Moura
43d7bac49b feat(library/init/meta): add support for new unify at rw tactic 2018-01-04 13:05:55 -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
f0352d31a1 feat(library/type_context, library): inout ==> out modifier in type class declarations
@kha: I decided to implement this change before I start the
type_context modifications. The change did not affect the corelib and
test suite much. The only annoying problem is that `out` cannot be
used to name locals anymore.
2017-12-15 14:46:47 -08:00
Leonardo de Moura
746134d11c feat(library/init/meta/interactive): add goal tagging support for by_cases
This commit also incorporates changes suggested at commit 84a1911949dec94.
2017-12-13 15:17:13 -08:00
Leonardo de Moura
cb74ef1670 chore(library/init/meta/interactive): fix docstring 2017-12-11 16:27:04 -08:00
Leonardo de Moura
533ddc0279 fix(library/init/meta/interactive): remove buggy generalizing param from with_cases 2017-12-11 16:27:04 -08:00