Gabriel Ebner
b05b514cc2
refactor(*): structured message objects
2016-10-13 18:49:10 -07:00
Daniel Selsam
1644e52c47
fix(frontends/lean/decl_cmds): allow noncomputable meta
2016-10-08 22:21:56 -07:00
Leonardo de Moura
572751c56e
feat(frontends/lean): force user to use meta keyword on meta inductive/structure/class
...
Before this commit, we were inferring whether an
inductive/structure/class were meta or not. This was bad since the user
had no clue whether the type was trusted (non meta) or not.
Moreover, users could get confused by this behavior and assume the
kernel was allowing trusted code to rely on untrusted one.
2016-09-29 17:56:35 -07:00
Gabriel Ebner
d0ab6065c3
fix(frontends/lean): type check examples
2016-09-27 14:39:55 -07:00
Leonardo de Moura
d944d78b1d
feat(frontends/lean/decl_cmds): attribute list must occur immediately after 'attribute' keyword
2016-09-24 18:40:57 -07:00
Leonardo de Moura
49cffc0b20
feat(frontends/lean): add compact notation for setting attributes suggested by Sebastian
2016-09-24 15:45:06 -07:00
Leonardo de Moura
03e4fd1038
feat(frontends/lean,library): cleanup instance cmd, and use 'meta instance'
2016-09-24 12:33:25 -07:00
Leonardo de Moura
148da46481
feat(frontends/lean): 'mutual' and 'meta' are now keywords
2016-09-24 10:44:40 -07:00
Leonardo de Moura
6d9a9b46f3
chore(frontends/lean): cleanup
2016-09-23 16:26:21 -07:00
Leonardo de Moura
f00e6c0a96
feat(frontends/lean): anonymous instances
...
The instance name is synthesized automatically.
2016-09-23 13:34:34 -07:00
Leonardo de Moura
6bfd4eb9cf
feat(frontends/lean): add 'instance' keyword
2016-09-23 12:19:05 -07:00
Leonardo de Moura
b2e1e920a9
chore(frontends/lean,library,linja): remove .ilean files
2016-09-20 08:43:45 -07:00
Leonardo de Moura
9f1a576e98
chore(frontends/lean): remove dead code from parser
2016-09-19 17:04:59 -07:00
Leonardo de Moura
5e4e1ba88a
chore(frontends/lean): delete old definition command
2016-09-19 16:50:25 -07:00
Leonardo de Moura
6c84a0a7b1
feat(frontends/lean): use new notation for declaring universes in constant and structure decls
2016-09-13 21:45:16 -07:00
Leonardo de Moura
d5aae42b7c
feat(frontends/lean): use new elaborator to elaborate examples when set_option new_elaborator true
2016-09-05 09:52:01 -07:00
Leonardo de Moura
f7df7dc9a7
refactor(kernel): add reducibility_hints
2016-09-04 16:30:02 -07:00
Leonardo de Moura
a74f02546b
refactor(*): remove abbreviation command
2016-09-03 17:11:29 -07:00
Leonardo de Moura
48786b6afe
feat(frontends/lean/decl_cmds): register attributes after bytecode has been generated
2016-08-17 08:46:26 -07:00
Daniel Selsam
a9b01991c2
feat(frontends/lean/inductive_cmd): new frontend for the inductive cmd
...
Conflicts:
src/frontends/lean/CMakeLists.txt
src/frontends/lean/structure_cmd.h
2016-08-17 07:34:03 -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
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
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
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
8f33269286
feat(frontends/lean): add decl_util module for definition/inductive commands
2016-08-10 17:04:12 -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
371dd9d1e1
refactor(frontends/lean): move match-expr parser to different module
2016-08-08 09:05:22 -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
1041f6d9d8
feat(frontends/lean/structure_cmd): private structures
2016-08-06 00:03:06 -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
Sebastian Ullrich
c4edad0372
feat(frontends/lean, library): remove attribute and metaclass scoping
...
All data is now part of either a global, permanent scope or a local,
temporary one
2016-07-29 23:44:21 -04:00
Leonardo de Moura
6234d0d830
fix(frontends/lean/decl_cmds): the function name does not need to be atomic
2016-06-29 07:55:11 +01:00
Leonardo de Moura
e433417e49
feat(frontends/lean/decl_cmds): pattern variables must be atomic
2016-06-29 07:34:36 +01:00
Leonardo de Moura
5d225b7056
feat(frontends/lean): 'example's don't need to be trusted
2016-06-28 10:06:15 +01:00
Leonardo de Moura
c624c2d932
feat(frontends/lean): allow patterns in 'do' notation
2016-06-24 19:28:48 -07:00
Leonardo de Moura
51b3ddb274
chore(frontends/lean/decl_cmds): use 'pattern' instead of recursive equation
2016-06-24 16:31:06 -07:00
Leonardo de Moura
5459e9ad8a
chore(frontends/lean): remove dead code
2016-06-13 10:42:38 -07:00
Leonardo de Moura
09255e9a4c
fix(frontends/lean/decl_cmds): generate code for inline definitions
...
Reason: we only unfold inline definitions when they are fully applied.
2016-06-03 16:08:13 -07:00
Leonardo de Moura
2c4935148c
fix(frontends/lean/decl_cmds): recursive equations for meta-definitions
2016-06-02 17:12:21 -07:00
Leonardo de Moura
5382a5a556
feat(frontends/lean): allow unbounded recursion in meta_definitions
2016-06-01 09:55:07 -07:00
Leonardo de Moura
e7b47a504e
feat(frontends/lean): add meta_definition and meta_constant commands
2016-06-01 09:12:41 -07:00
Leonardo de Moura
af1908be94
feat(frontends/lean/decl_cmds): do not generate warning for definitions that are implemented in the VM
2016-05-13 18:17:20 -07:00
Leonardo de Moura
65b9cab9b4
feat(frontends/lean/decl_cmds): generate bytecode when adding definitions
...
Remark: when the code generator fails we just generate a warning.
Reason: code generator does not support wellfounded recursion yet.
2016-05-13 18:05:47 -07:00