Commit graph

2094 commits

Author SHA1 Message Date
Leonardo de Moura
7059609f57 feat(library/equations_compiler): equations_compiler stub, add helper equations_editor, add preprocessing
The first preprocessing step packs nary functions into unary using sigma types
2016-08-14 17:02:36 -07:00
Leonardo de Moura
5a0f3ca320 fix(frontends/lean/definition_cmds): user must provide implicit arguments or the function being defined 2016-08-13 22:17:06 -07:00
Leonardo de Moura
323701bef1 feat(frontends/lean/parser): simplify pattern semantics '_' in a pattern is always a anonymous variable 2016-08-13 22:14:40 -07:00
Leonardo de Moura
ed2a63ae89 feat(frontends/lean/elaborator): elaborate equations 2016-08-13 21:37:25 -07:00
Leonardo de Moura
150ad5d292 feat(frontends/lean/elaborator): elaborate convoy idiom 2016-08-13 20:51:42 -07:00
Leonardo de Moura
f7f564a00a feat(frontends/lean/definition_cmds): postprocessing for parameters 2016-08-13 17:41:05 -07:00
Leonardo de Moura
8ff2876074 fix(frontends/lean/definition_cmds): collect implicit args in the type 2016-08-13 16:54:17 -07:00
Leonardo de Moura
2de3d40910 feat(frontends/lean/definition_cmds): invoke compiler 2016-08-13 16:45:32 -07:00
Leonardo de Moura
0312b84273 feat(frontends/lean/definition_cmds): check noncomputable annotation 2016-08-13 16:33:02 -07:00
Leonardo de Moura
940382c3bc feat(frontends/lean/definition_cmds): add support for 'sorry' 2016-08-13 16:25:29 -07:00
Leonardo de Moura
9e3bf4bd8d fix(frontends/lean/elaborator): improve error message for eliminator elaborator 2016-08-13 15:43:44 -07:00
Leonardo de Moura
7d9cf74007 feat(frontends/lean/definition_cmds): basic xdefinition_cmd_core 2016-08-13 15:08:32 -07:00
Leonardo de Moura
cc5a59a61b feat(frontends/lean/decl_util): do not add constant being defined to scope
It should only be added if recursive equations are being used or
in inductive datatype declarations.
2016-08-13 13:34:11 -07:00
Leonardo de Moura
527ce72d2f feat(frontends/lean/elaborator): add elaborate_with_type 2016-08-13 13:33:37 -07:00
Leonardo de Moura
24bc999c77 feat(frontends/lean): add mutual_meta_definition 2016-08-12 20:00:10 -07:00
Sebastian Ullrich
f0b3bd3c85 chore(frontends/lean/decl_cmds): disable old attribute declaration syntax 2016-08-12 15:36:12 -07:00
Sebastian Ullrich
47e104311c feat(frontentds/lean/decl_attributes): implement attribute [...] definition ... syntax 2016-08-12 15:36:12 -07:00
Sebastian Ullrich
b27ba6288d feat(frontends/lean/print_cmd): implement 'print attributes' 2016-08-12 15:36:12 -07:00
Sebastian Ullrich
e0e8a3aff2 refactor(library/abbreviation): make parsing_only a real attribute 2016-08-12 15:36:12 -07:00
Leonardo de Moura
a641f9dfc0 feat(frontends/lean): add new definition command skeleton 2016-08-11 14:38:35 -07:00
Daniel Selsam
8aebea558a feat(frontends/lean/inductive_cmds): scaffold for new inductive commands 2016-08-11 13:48:54 -07:00
Leonardo de Moura
80b6bb47f8 feat(frontends/lean): parse mutual_definition 2016-08-11 13:47:52 -07:00
Leonardo de Moura
09459c0d84 refactor(library/equations_compiler): isolate old equations compiler 2016-08-11 10:08:30 -07:00
Leonardo de Moura
fc4e304b27 refactor(library): move equations to equations_compiler 2016-08-11 10:08:30 -07:00
Leonardo de Moura
f056f0f2cb refactor(library): definitional ==> constructions 2016-08-11 10:08:22 -07:00
Leonardo de Moura
fd0b593fba feat(frontends/lean): add definition_cmds files 2016-08-11 09:40:24 -07:00
Leonardo de Moura
11043bc888 chore(frontends/lean/builtin_cmds): remove dead code 2016-08-11 08:38:39 -07:00
Leonardo de Moura
8ba17af50b fix(frontends/lean/builtin_cmds): non-determinism 2016-08-11 08:01:44 -07:00
Leonardo de Moura
f5c35f8d76 chore(*): fix compilation warnings 2016-08-10 18:03:13 -07:00
Leonardo de Moura
8f33269286 feat(frontends/lean): add decl_util module for definition/inductive commands 2016-08-10 17:04:12 -07:00
Leonardo de Moura
ae6219ba28 refactor(frontends/lean/elaborator): improve API 2016-08-10 14:34:54 -07:00
Leonardo de Moura
8498bbaeff refactor(frontends/lean/elaborator): allow elaborator to add auxiliary definitions 2016-08-10 08:31:00 -07:00
Leonardo de Moura
e5cf12e2ad refactor(frontends/lean/elaborator): cleanup interface 2016-08-10 08:20:10 -07:00
Leonardo de Moura
a0a72b5b82 refactor(frontends/lean): move local_context_adapter to separate folder 2016-08-10 07:52:38 -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
f75de2e950 chore(library/definitional,frontends/lean): remove decreasing macro 2016-08-09 16:27:33 -07:00
Leonardo de Moura
53aa89f1e1 fix(frontends/lean/structure_cmd): generate code for automatically generated coercions 2016-08-08 13:58:34 -07:00
Leonardo de Moura
139c15878d chore(frontends/lean/decl_cmds): change syntax for specifying custom well-founded relations 2016-08-08 13:30:09 -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
Sebastian Ullrich
c3ea0c1852 refactor(frontends/decl_cmds): simplify definition parsing logic
Also restrict syntax to `inline? (private|protected)? noncomputable?`
2016-08-08 12:44:37 -07:00
Leonardo de Moura
1602a53336 feat(frontends/lean): nary match 2016-08-08 10:04:58 -07:00
Leonardo de Moura
371dd9d1e1 refactor(frontends/lean): move match-expr parser to different module 2016-08-08 09:05:22 -07:00
Leonardo de Moura
325d590bd0 fix(frontends/lean): add missing files 2016-08-08 08:16:31 -07:00
Leonardo de Moura
b9c62af37d feat(frontends/lean/parser): remove unnecessary restriction 2016-08-07 11:40:39 -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
d36280f74f refactor(frontends/lean): id_behavior 2016-08-07 08:07:24 -07:00
Leonardo de Moura
5eddff44ab fix(frontends/lean/builtin_exprs): better error position 2016-08-06 13:43:09 -07:00
Leonardo de Moura
fb8ae7f411 chore(frontends/lean/parser): add comment 2016-08-06 13:24:10 -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