Commit graph

3310 commits

Author SHA1 Message Date
Leonardo de Moura
7d9cf74007 feat(frontends/lean/definition_cmds): basic xdefinition_cmd_core 2016-08-13 15:08:32 -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
f3dbd0c69a chore(library): disable stdlib but init and systems folder 2016-08-11 18:42:10 -07:00
Leonardo de Moura
0fcbcb4cce chore(tests/lean): make sure tests only use init and systems.IO 2016-08-11 18:31:33 -07:00
Leonardo de Moura
f6df7fb4d1 chore(tests/lean/run): make sure tests only use init and system.IO 2016-08-11 18:13:00 -07:00
Leonardo de Moura
e38be05717 chore(tests/lean): remove tests with 'exit' 2016-08-11 16:24:33 -07:00
Leonardo de Moura
f003bd8df8 chore(tests/lean): erase old blast tests 2016-08-11 16:18:20 -07:00
Leonardo de Moura
8ba17af50b fix(frontends/lean/builtin_cmds): non-determinism 2016-08-11 08:01:44 -07:00
Leonardo de Moura
ac57fb9d2a fix(frontends/lean/match_expr): nary match revision 2016-08-10 07:24:10 -07:00
Leonardo de Moura
4e307f906f fix(library/init/function): '$' notation should be left-associative 2016-08-09 16:50:36 -07:00
Leonardo de Moura
8c36cd04a3 feat(library/init/sigma_lex): add skip_left relation for sigma 2016-08-09 11:17:12 -07:00
Leonardo de Moura
9ac7ee1624 refactor(library/init): well_founded is not a type class anymore 2016-08-08 14:28:45 -07:00
Leonardo de Moura
1d6b1d381b refactor(library/init): rename measurable to has_sizeof 2016-08-08 13:58:10 -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
5a38e15c2e test(tests/lean/run/match_expr2): match example with abstract structures 2016-08-06 14:18:08 -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
1041f6d9d8 feat(frontends/lean/structure_cmd): private structures 2016-08-06 00:03:06 -07:00
Leonardo de Moura
46570bd51d fix(frontends/lean/structure_cmd): bug when generating alias for S.induction_on in the structure command 2016-08-05 23:13:39 -07:00
Leonardo de Moura
61554f920e test(tests/lean/run/assoc1): mul.assoc example 2016-08-05 18:35:13 -07:00
Leonardo de Moura
b6420904f5 feat(frontends/lean): resolved quoted names 2016-08-05 17:04:36 -07:00
Leonardo de Moura
7bb6ccc089 refactor(library/init/meta): qexpr ==> pexpr 2016-08-05 17:04:36 -07: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
f9b90913a8 chore(tests/lean): fix tests 2016-08-04 19:17:08 -07:00
Leonardo de Moura
befe2d96e1 feat(frontends/lean/elaborator): chaining for anonymous constructors 2016-08-04 15:08:25 -07:00
Leonardo de Moura
8b05fba6ef feat(frontends/lean/elaborator): propagate expected type to arguments when elaborating constructors 2016-08-04 14:07:15 -07:00
Leonardo de Moura
6a0d9dab40 feat(frontends/lean/elaborator): anonymous constructors 2016-08-04 13:03:49 -07:00
Leonardo de Moura
22612cff8c chore(library): disable sigma.mk notation 2016-08-04 10:44:48 -07:00
Leonardo de Moura
52b66a1573 chore(frontends/lean/pp, library/pp_options): pp.lazy_abstraction ==> pp.delayed_abstraction 2016-08-03 18:45:47 -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
594c7ca4c5 chore(frontends/lean/find_cmd): remove find_decl command 2016-08-03 17:32:47 -07:00
Leonardo de Moura
f4e1e92807 feat(frontends/lean/decl_cmds): use new elaborator for variable, parameter and constant commands 2016-08-03 17:10:45 -07:00
Leonardo de Moura
d473622352 refactor(frontends/lean/structure_cmd): remove unnecessary options 2016-08-03 15:48:58 -07:00
Leonardo de Moura
bf730d992c chore(tests/lean): fix test output 2016-08-03 14:17:29 -07:00
Leonardo de Moura
2c8e484aa3 feat(frontends/lean/elaborator): universe parameter name sanitizer 2016-08-03 13:13:44 -07:00
Leonardo de Moura
4e80094927 feat(frontends/lean/inductive_cmd): use new elaborator in the inductive command 2016-08-03 13:13:12 -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
8993d0738a feat(frontends/lean): remove #elab command
The check command is now using the new elaborator.
2016-08-02 15:05:24 -07:00
Leonardo de Moura
dc44edfd41 feat(frontends/lean): use new elaborator in the 'check' command 2016-08-02 14:57:49 -07:00
Leonardo de Moura
0b1f0de7d2 chore(tests/lean/inst_error.lean.expected.out): fix output 2016-08-02 13:55:08 -07:00
Leonardo de Moura
babc8906b3 fix(library/metavar_util): but in instantiate_mvars 2016-08-02 13:16:17 -07:00
Leonardo de Moura
860d333b5e fix(src/library/type_context): unifier first-order approximation 2016-08-02 09:51:18 -07:00
Leonardo de Moura
90f5dabf28 fix(frontends/lean/elaborator): order type class instances are synthesized 2016-08-01 23:59:22 -07:00
Leonardo de Moura
a1854df9fa test(tests/lean/run/elab_crash1): add new test 2016-08-01 17:26:47 -07:00
Leonardo de Moura
d46e9b411c fix(frontends/lean/elaborator): spurious universe parameters being generated 2016-08-01 08:10:15 -07:00
Leonardo de Moura
5b33c0384d test(tests/lean/run/qexpr1): add test for nested quotes 2016-08-01 07:42:06 -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
fefa5ad3b8 fix(library/tactic/elaborate): new subgoals must be inserted after main goal 2016-07-31 21:16:29 -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