Commit graph

46 commits

Author SHA1 Message Date
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
0091cef9f2 feat(library/tactic): start algebraic normalizer 2017-05-15 21:46:19 -07:00
Leonardo de Moura
55fee26b36 feat(library/class): add attribute for tracking symbols occurring in instances of type classes
For more information see:
https://github.com/leanprover/lean/wiki/Refactoring-structures
The new attribute [algebra] implements the [algebraic_class] described
in the page above.
2017-05-01 18:02:30 -07:00
Leonardo de Moura
ba5eccdca8 refactor(library/init/core): rename out_param => inout_param
It is really input/output.
2017-05-01 14:01:41 -07:00
Leonardo de Moura
cabb4350d9 feat(library): instances are not reducible by default anymore
Motivation: see "Other goodies" section at
https://github.com/leanprover/lean/wiki/Refactoring-structures

We had to add a new transparency mode: Instances at type_context.
In this mode, instances and reducible definitions are considered
transparent.

The new mode is used in the defeq_canonizer, code generator,
and sizeof lemma generation at inductive_compiler.

We also use the new mode in the unfold tactics.
2017-04-26 14:10:11 -07:00
Leonardo de Moura
707cf45a26 refactor(library/type_context): rename whnf_pred => whnf_head_pred 2017-02-15 20:20:27 -08:00
Leonardo de Moura
5da8b205b9 feat(library/type_context, frontends/lean/elaborator): type classes with output parameters 2017-01-30 18:32:54 -08:00
Leonardo de Moura
93c8e69313 chore(frontends/lean, library): cleanup anonymous instance management 2017-01-06 14:37:44 -08:00
Leonardo de Moura
7c06306154 chore(library/type_context): reduce redundancy 2016-12-27 17:19:19 -08:00
Gabriel Ebner
a26e2c9108 feat(library/module): intermediary data structure for environment modifications 2016-12-20 10:15:19 -08:00
Leonardo de Moura
43aa6eb87f fix(library/class): bug in whnf_pred predicate 2016-11-05 11:44:05 -07:00
Leonardo de Moura
9631b70295 fix(library/class): attributes instance and class were not being registered in the attribute_manager when procedures add_instance and add_class were being used directly 2016-10-01 13:45:23 -07:00
Leonardo de Moura
89f62edaf0 refactor(library): reduce dependecies on old code, simplify normalize module 2016-09-19 22:12:34 -07:00
Sebastian Ullrich
ca8be3857c feat(library/user_attribute): add user-defined attributes and make attribute_manager environment-aware 2016-08-18 12:56:44 -07:00
Sebastian Ullrich
34e00cd5a2 refactor(library/attribute_manger): simplify: make every attribute prioritizable 2016-08-16 13:49:02 -07:00
Leonardo de Moura
0169989411 chore(library/class): remove transitive instance support
Conflicts:
	src/frontends/lean/structure_cmd.cpp
	src/library/class.cpp
	src/library/class.h
2016-07-29 23:32:10 -07:00
Leonardo de Moura
264c23a24f chore(library/class): disable [trans_instance] attribute
Conflicts:
	src/library/class.cpp
2016-07-29 23:28:36 -07:00
Sebastian Ullrich
31f599e088 refactor(library/attribute_manager): introduce hierarchy of attribute classes 2016-07-29 23:44:22 -04: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
Sebastian Ullrich
661fafc940 refactor(frontends/lean): replace different attribute classes with single scoped_ext 2016-07-29 18:51:23 -04:00
Leonardo de Moura
d8079aa16a refactor(library): create copy of the kernel type_checker in library
Motivation: it will allow us to simplify the kernel type_checker and
make sure it implements the same API provided by type_context
2016-03-18 14:34:10 -07:00
Leonardo de Moura
d7de521126 refactor(library/class): remove attribute [multiple_instances] and old type class resolution procedure 2016-03-03 13:58:22 -08:00
Leonardo de Moura
3c878ecd01 feat(kernel): add let-expressions to the kernel
The frontend is still using the old "let-expression macros".
We will use the new let-expressions to implement the new tactic framework.
2016-02-29 16:40:17 -08:00
Leonardo de Moura
5a4dd3f237 feat(library/reducible): remove [quasireducible] annotation 2016-02-25 17:42:44 -08:00
Leonardo de Moura
146edde5b3 feat(library/class): mark instances as quasireducible by default
quasireducible are also known as lazyreducible.

There is a lot of work to be done.
We still need to revise blast, and add a normalizer for type class
instances. This commit worksaround that by eagerly unfolding
quasireducible.
2016-02-25 12:11:29 -08:00
Leonardo de Moura
c9e9fee76a refactor(*): remove name_generator and use simpler mk_fresh_name 2016-02-11 18:05:57 -08:00
Leonardo de Moura
155df48665 feat(library): remove decl_stats
We are not using (and will not use) this module in the blast proof procedures
2016-01-02 13:00:43 -08:00
Leonardo de Moura
26d0a62052 refactor(*): make sure we use LEAN_DEFAULT_PRIORITY
We recently implemented the attribute manager.
2015-12-28 10:47:56 -08:00
Leonardo de Moura
f177082c3b refactor(*): normalize metaclass names
@avigad and @fpvandoorn, I changed the metaclasses names. They
were not uniform:
- The plural was used in some cases (e.g., [coercions]).
- In other cases a cryptic name was used (e.g., [brs]).

Now, I tried to use the attribute name as the metaclass name whenever
possible. For example, we write

   definition foo [coercion] ...
   definition bla [forward] ...

and

  open [coercion] nat
  open [forward] nat

It is easier to remember and is uniform.
2015-12-28 10:39:15 -08:00
Leonardo de Moura
45dbf76df9 refactor(library): add attribute manager 2015-12-17 20:58:15 -08:00
Leonardo de Moura
3057dde885 fix(library/class,library/coercion): fixes #852 2015-12-10 22:52:02 -08:00
Leonardo de Moura
e5aab3fd63 feat(library/scoped_ext,frontends/lean): add support for setting attributes into different namespaces 2015-12-05 11:15:02 -08:00
Leonardo de Moura
4c573380b2 feat(library/class): add auxiliary methods 2015-11-08 14:05:00 -08:00
Leonardo de Moura
ee347772d7 feat(library/meng_paulson): ignore class and class-instances when computing set of relevant theorems 2015-11-08 14:04:56 -08:00
Leonardo de Moura
fe26c37fcb refactor(library/tc_multigraph): improve tc_multigraph API 2015-07-01 16:01:40 -07:00
Leonardo de Moura
880f212494 feat(library/class): allow transitive instances that have instances arguments 2015-06-30 14:54:12 -07:00
Leonardo de Moura
d20f831602 feat(library/class): add is_derived_trans_instance predicate 2015-06-30 13:59:02 -07:00
Leonardo de Moura
b5444c1314 refactor(frontends/lean/builtin_cmds): allow "constant" edges in the instance transitive closure graph 2015-06-29 18:57:05 -07:00
Leonardo de Moura
859ef441a0 feat(library/class): transitive instances
see issue #666
2015-06-27 14:06:56 -07:00
Leonardo de Moura
ce8f2a1674 feat(library/class): allow any constant to be marked as a class
closes #679
2015-06-17 16:26:45 -07:00
Leonardo de Moura
f830bf54c2 refactor(*): clarify name_generator ownership 2015-05-21 14:32:36 -07:00
Leonardo de Moura
57ea660963 refactor(*): start process for eliminating of opaque definitions from the kernel
see issue #576
2015-05-08 16:06:04 -07:00
Leonardo de Moura
fa79b214b8 fix(frontends/lean): allow 'attribute <id> [priority ...]' 2015-03-03 16:17:32 -08:00
Leonardo de Moura
d2958044fd feat(frontends/lean): add multiple_instances command
After this commit, Lean "cuts" the search after the first instance is
computed. To obtain the previous behavior, we must use the new command

          multiple_instances <class-name>

closes #370
2014-12-21 17:28:44 -08:00
Leonardo de Moura
6f78315aa4 refactor(*): add uniform names for "meta-objects" 2014-12-17 11:42:14 -08:00
Leonardo de Moura
ac664505e6 refactor(library): move class management to library module 2014-12-09 21:38:55 -08:00