Commit graph

172 commits

Author SHA1 Message Date
Leonardo de Moura
c9475774f4 feat(library/tactic/tactic_state): add is_def_eq and is_def_eq_core tactics 2016-08-16 11:08:03 -07:00
Leonardo de Moura
f8e5753a13 feat(library/type_context, library/tactic): add eta-expansion method and tactic 2016-08-14 16:15:12 -07:00
Leonardo de Moura
2354b63099 feat(library/tactic/tactic_state): add whnf_core 2016-08-14 16:02:40 -07:00
Sebastian Ullrich
fd2c42a8bf chore(library, tests): switch to new attribute declaration syntax
sed -Ei 's/^(\s*)((private |protected )?(noncomputable )?(abbreviation|definition|meta_definition|theorem|lemma|proposition|corollary)\s+\S+\s*)((\s*\[(\S+(\s+[0-9]+)*|priority.*)\])+)\s*/\1attribute \6\n\1\2/' library/**/*.lean tests/**/*.lean
sed -Ei 's/\s+$//' library/**/*.lean  # remove trailing whitespace
2016-08-12 15:36:12 -07:00
Leonardo de Moura
1d6b1d381b refactor(library/init): rename measurable to has_sizeof 2016-08-08 13:58:10 -07:00
Sebastian Ullrich
82657b3b64 refactor(library/compiler/inliner, library): replace inline command with attribute
sed -Ei 's/inline (protected )?(meta_)?definition (\S+)/\1\2definition \3 [inline]/' library/**/*.lean
2016-08-08 12:45:22 -07:00
Leonardo de Moura
1602a53336 feat(frontends/lean): nary match 2016-08-08 10:04:58 -07:00
Leonardo de Moura
1e6b3614ab feat(frontends/lean): new pattern matching validation
@Kha, we now support variable/constant shadowing in patterns.
A constant may occur in a pattern if it is a constructor or tagged with
the new [pattern] attribute. In the standard library, I have tagged
'add', 'zero', 'one', 'bit0', 'bit1' and 'rfl' with this new attribute.
BTW, arbitrary constants and variables may occur nested in type ascriptions and
inaccessible terms.

Here is an example:

     meta_definition tactic_result_to_string {A : Type} : tactic_result A → string
     | (success a s)   := to_string a
     | (exception ⌞A⌟ e s) := "Exception: " ++ to_string (e ())

I had to use the inaccessible ⌞A⌟ in the example above, otherwise, we would be shadowing the parameter
{A : Type}, and we would get a type error.

The new validation is performed at to_pattern_fn (parser.cpp).
2016-08-07 11:31:11 -07:00
Leonardo de Moura
e52cffd04d feat(library/init/meta/match_tactic): add helper tactics on top of match tactic 2016-08-06 14:13:41 -07:00
Leonardo de Moura
7bb6ccc089 refactor(library/init/meta): qexpr ==> pexpr 2016-08-05 17:04:36 -07:00
Leonardo de Moura
38b81f2656 refactor(library/init/meta): remove base_tactic
We don't need it.
2016-08-04 19:17:08 -07:00
Leonardo de Moura
5cc5880a77 refactor(library/init/meta/base_tactic): remove unnecessary option 2016-08-04 19:17:08 -07:00
Daniel Selsam
70a1e53ba8 feat(simplifier/simp_lemmas): take arbitrary list of attributes and cache 2016-08-03 18:04:28 -07:00
Leonardo de Moura
53da866935 feat(library/init/meta/simp_tactic): add tactic for creating empty simp_lemmas 2016-08-02 09:00:49 -07:00
Leonardo de Moura
c1793cd620 feat(library/init/meta/tactic): add 'refine' tactic 2016-07-31 21:17:19 -07:00
Leonardo de Moura
6d0fa806d8 feat(library/tactic/elaborate): convert unassigned metavars into new goals 2016-07-31 20:38:57 -07:00
Leonardo de Moura
12fa52c77d feat(library/tactic, frontends/lean/elaborator): add to_expr tactic 2016-07-31 20:21:17 -07:00
Leonardo de Moura
2ad5c2ab73 feat(library/init): add has_lift has_coe has_coe_to_fun type classes 2016-07-30 10:11:30 -07:00
Sebastian Ullrich
e090326f98 fix(library): remove classical instances from global scope 2016-07-29 23:44:23 -04:00
Leonardo de Moura
de237fa6e4 chore(library/coercion): disable coercion attribute 2016-07-29 13:15:10 -07:00
Leonardo de Moura
7ddf1e817b chore(frontends/lean): coercions are disabled by default 2016-07-29 13:03:23 -07:00
Daniel Selsam
1b7f70dde9 feat(simplifier): expose simp_lemmas data structure 2016-07-29 10:44:44 -07:00
Leonardo de Moura
14ac5fb25a fix(library/init/meta/mk_measurable_instance) : add 1 for each constructor 2016-07-23 13:01:09 -07:00
Leonardo de Moura
b5cddede6b feat(library/init/meta): add mk_measurable_instance tactic 2016-07-23 12:30:41 -07:00
Leonardo de Moura
85e3f51fd5 feat(library/bin_app): uniform foldr, add helper methods for synthesizing recursive functions
foldr combinator is used to define brec_on recursor.
It is easier to access the brec_on "dictionary" if the representation is
uniform.
2016-07-23 12:11:18 -07:00
Leonardo de Moura
0db1f3a9d1 feat(library/init/meta): add helper functions 2016-07-23 11:39:11 -07:00
Leonardo de Moura
212d222047 feat(frontends/lean): quoted names 2016-07-22 19:06:57 -07:00
Leonardo de Moura
fa04e5f36f refactor(library/init/meta): move set/get option tactics to separate file 2016-07-21 17:10:38 -07:00
Leonardo de Moura
ada260309e refactor(library/init/meta): move defeq simplifier related tactics to separate file 2016-07-21 17:07:09 -07:00
Leonardo de Moura
d70bf2f04e refactor(library/init/meta): move simplifier related tactics to separate file 2016-07-21 17:03:19 -07:00
Leonardo de Moura
1b55507971 refactor(library/init/meta): rename C++ intro to intro_core, and define smarter intro in C++ 2016-07-21 16:54:23 -07:00
Leonardo de Moura
90eb79a295 feat(library/init/meta): add mk_inhabited_instance tactic 2016-07-20 21:01:50 -04:00
Leonardo de Moura
9beacebf33 doc(library/init/meta/mk_dec_eq_instance): missing documentation 2016-07-20 20:30:02 -04:00
Leonardo de Moura
0163c1aa5b feat(library/init): use mk_dec_eq_instance in the init folder
We cannot mk_dec_eq_instance everywhere in the init folder because some
dec_eq instances are used to define the tactic mk_dec_eq_instance.
2016-07-20 20:21:58 -04:00
Leonardo de Moura
40b3410ede feat(library/init/meta): add tactic mk_dec_eq_instance 2016-07-20 19:57:12 -04:00
Leonardo de Moura
2580b40dc1 feat(library/init/meta/tactic): add helper tactic whnf_target 2016-07-20 19:29:22 -04:00
Leonardo de Moura
f0f927919d feat(library/init/meta/expr): add get_app_args 2016-07-20 19:28:36 -04:00
Leonardo de Moura
7f0b4b4573 feat(library/init/meta/environment): add is_recursive API 2016-07-20 19:27:43 -04:00
Leonardo de Moura
3dccaa8e39 feat(library/init/string): add utf8_length 2016-07-19 14:22:37 -04:00
Leonardo de Moura
7597952bad fix(library/tactic/unfold_tactic): should use type_context locals 2016-07-18 19:08:31 -04:00
Leonardo de Moura
0d8213cf92 feat(library/tactic): add unfold tactic 2016-07-18 15:46:56 -04:00
Leonardo de Moura
a20abd61e8 feat(library/tactic): implement rewrite and kabstract using occurrences object 2016-07-18 10:10:37 -04:00
Leonardo de Moura
3e6b4577e2 feat(library/tactic): add occurrences object 2016-07-18 09:49:49 -04:00
Leonardo de Moura
7f0276f592 feat(library/tactic): add 'rewrite' tactic and variants 2016-07-17 16:08:11 -04:00
Leonardo de Moura
26177995c2 feat(library/tactic): add 'generalize' tactic 2016-07-16 15:41:32 -04:00
Leonardo de Moura
a5307a34bc feat(library/tactic): add 'cases' tactic skeleton 2016-07-12 14:05:03 -04:00
Leonardo de Moura
5f2591b3a3 feat(library/init/meta/backward): expose back_lemmas (index)
Motivation: the user can create the index once and use it many times.
2016-07-10 17:11:24 -07:00
Leonardo de Moura
e48fa15b71 feat(library/tactic/backward/backward_chaining): add 'pre_tactic' to backward_chaining_core 2016-07-10 16:11:13 -07:00
Leonardo de Moura
7c8d0f444f feat(library/tactic/backward): finish backward chaining tactic 2016-07-10 13:49:28 -07:00
Leonardo de Moura
af9c7148b3 feat(library/tactic/backward): add backward_chaining skeleton tactic 2016-07-10 11:45:25 -07:00