Commit graph

4837 commits

Author SHA1 Message Date
Leonardo de Moura
0f714e36b0 feat(library/tactic): add 'location' macro 2015-07-13 17:56:42 -04:00
Leonardo de Moura
58291024a9 fix(library/simplifier/ceqv): polish conditional rewrite internalization procedure 2015-07-13 16:40:18 -04:00
Leonardo de Moura
3cb8568fb5 feat(library/simplifier): we can "rewrite" with transitive relations
The simplifier does not really need the relation to be an equivalence.
Transitivity is the main required property (we need to chain rewrites
together).
2015-07-12 14:24:05 -04:00
Leonardo de Moura
f8d472c9f1 feat(frontends/lean/parse_rewrite_tactic): change the semantics of rewrite[↑f] when f is recursive
After this commit it behaves like 'unfold f'.
That is, it will unfold f even if it fails to fold recursive
applications. Now, only 'esimp[f]' will not unfold f-applications when
it cannot fold the recursive applications.

This commit also closes #692. It is part of a series of commits that
addresses this issue.

closes #692
2015-07-12 13:20:21 -04:00
Leonardo de Moura
4c0a656ecc fix(library/tactic/unfold_rec): support indexed families + brec_on at unfold_rec
see issue #692
2015-07-12 12:45:05 -04:00
Leonardo de Moura
584f9e3f49 fix(library/tactic/unfold_rec): support indexed families at unfold_rec
This commit also removes many (now unnecessary) folds from the HoTT
library.

See issue #692

We still have to implement support for recursive definitions based on
brec_on that recurse over inductive families.
2015-07-12 12:32:58 -04:00
Leonardo de Moura
7fa5c3e5da feat(library/tactic/unfold_rec): take '[recursor]' annotations into account at unfold_rec 2015-07-12 11:33:40 -04:00
Leonardo de Moura
b0ac78c2cb feat(library/user_recursors): add is_user_defined_recursor predicate 2015-07-12 11:25:50 -04:00
Leonardo de Moura
8e8e08cfe7 feat(library/tactic): use occurrence object in unfold tactic family 2015-07-11 18:53:45 -04:00
Leonardo de Moura
554a42b407 fix(library/tactic/unfold_rec): add annother brec pattern that should be checked in the unfold recursive definition tactic 2015-07-10 22:16:23 -04:00
Leonardo de Moura
a9515ac7a4 feat(library/tactic/rewrite_tactic): try to fold nested recursive applications after unfolding a recursive function
See issue #692.
The implementation still has some rough spots.
It is not clear what the right semantic is.
Moreover, the folds in e_closure could not be eliminated automatically.
2015-07-08 21:19:18 -04:00
Leonardo de Moura
967f9ece8e fix(frontends/lean/notation_cmd): workaround incorrect warning produced by clang++ on OSX 2015-07-07 21:01:48 -07:00
Leonardo de Moura
6ffbb05118 feat(library/definitional/no_confusion): add [unfold] hint to no_confusion 2015-07-07 20:07:13 -07:00
Leonardo de Moura
26574e29a9 feat(library/normalize,frontends/lean): allow multiple arguments in [unfold] hint
closes #693
2015-07-07 18:01:57 -07:00
Leonardo de Moura
a27b20cd9c feat(frontends/lean/notation_cmd): allow local notation to override reserved notation
closes #712
2015-07-07 17:30:46 -07:00
Leonardo de Moura
4b1b3e277f feat(frontends/lean): rename '[unfold-c]' to '[unfold]' and '[unfold-f]' to '[unfold-full]'
see issue #693
2015-07-07 16:37:06 -07:00
Leonardo de Moura
991ff67b45 refactor(library/relation_manager): cleanup and add API for declaring a relation that may not be reflexive, symmetric nor transitive 2015-07-07 15:58:24 -07:00
Leonardo de Moura
fb833a724b fix(src/frontends/lean/parser): add extra annotations to workaround with clang 6.0.0 2015-07-06 16:39:47 -07:00
Leonardo de Moura
b0c56273e2 fix(frontends/lean/elaborator): fixes #724 2015-07-06 15:19:19 -07:00
Leonardo de Moura
c843690d27 fix(frontends/lean/elaborator): fixes #719 2015-07-03 12:37:28 -07:00
Leonardo de Moura
7de7c5b73d feat(library/definitional/projection): define projections using auxiliary macro 2015-07-02 10:49:49 -07:00
Leonardo de Moura
c15bcf1354 refactor(library/projection): remove projection macro from library 2015-07-02 08:48:13 -07:00
Leonardo de Moura
dd145926a2 fix(library/coercion): compilation warning 2015-07-02 07:26:00 -07:00
Leonardo de Moura
4ae9f3ea81 feat(library/coercion): new coercion manager
closes #668
2015-07-01 16:32:34 -07:00
Leonardo de Moura
fe26c37fcb refactor(library/tc_multigraph): improve tc_multigraph API 2015-07-01 16:01:40 -07:00
Leonardo de Moura
765865ed41 chore(library/tc_multigraph): remove dead code 2015-07-01 15:48:55 -07:00
Leonardo de Moura
d44d576194 refactor(library/coercion): simplify coercion module API 2015-07-01 14:40:12 -07:00
Leonardo de Moura
d5c38777af refactor(library/coercion): simplify coercion_class 2015-07-01 14:29:23 -07:00
Leonardo de Moura
0f5b7a36f5 chore(library/coercion): remove lua bindings for coercion module
Reason: we will refactor the coercion module.
See issue #668
2015-07-01 14:08:49 -07:00
Leonardo de Moura
667f647b27 feat(kernel/expr_eq_fn): add small optimization 2015-07-01 09:19:36 -07:00
Leonardo de Moura
cabe30ba71 feat(frontends/lean): allow user to assign priorities to notation declarations 2015-06-30 17:10:27 -07:00
Leonardo de Moura
a1d1a8272a refactor(frontends/lean): move parse_priority to util 2015-06-30 16:22:52 -07:00
Leonardo de Moura
4ea57196ff chore(frontends/lean/parser_config): remove dead code 2015-06-30 16:04:00 -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
9a9e975bc8 feat(frontends/lean/migrate_cmd): ignore derived transitive instances in the migrate command 2015-06-30 14:00:41 -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
e7c3c887b6 feat(kernel/type_checker): add 'check' procedure that uses 'opaque_hints'
The hints only affect performance. If a declaration type checks assuming
some constants are opaque, it should also type check without this
assumption. Of course, it may be much slower.
2015-06-30 13:12:34 -07:00
Leonardo de Moura
772ed111e5 refactor(kernel): move extra_opaque_converter to kernel, and rename it to hint_converter 2015-06-30 12:59:28 -07:00
Leonardo de Moura
e635d9be9f refactor(kernel): rename get_weight to get_height at declaration
Motivation:
- It is the standard name for the concept: declaration height
- Avoid confusion with the expression weight
2015-06-30 12:59:10 -07:00
Leonardo de Moura
1e6550eda6 feat(kernel/default_converter): take into account the 'theorem' annotations in the converability checker
The idea is that we should seldon need to unfold theorems.
The convertability checker should use that.
When the convertability checker was implemented, theorems were opaque in
Lean. So, this hint was not needed.

This modification is another workaround for the performance problem with
the migrate command at library/data/real/division.lean.
This solution is better than applying proof irrelevance eagerly because
it also addresses similar problems in the HoTT library which does not
support proof irrelevance.

This commit also enables the conv_opt for all theorems.
2015-06-30 10:42:26 -07:00
Leonardo de Moura
acc0832928 feat(kernel/default_converter): add "eager" proof irrelevance optimization 2015-06-29 19:10:39 -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
9cefe708ee feat(frontends/lean/builtin_cmds): display derived instances 2015-06-29 11:06:59 -07:00
Leonardo de Moura
0fc2efe88e fix(library/tactic/rewrite_tactic): fixes #702 2015-06-28 20:37:17 -07:00
Leonardo de Moura
95720b1670 fix(frontends/lean/elaborator): fixes #687 2015-06-28 19:58:57 -07:00
Leonardo de Moura
1b864a838f fix(library/tactic/induction_tactic.cpp): condition for checking whether 'induction' tatic is applicable or not
fixes #690
2015-06-28 13:07:02 -07:00
Leonardo de Moura
88844f6261 chore(src/library/user_recursors): add missing include 2015-06-28 12:53:48 -07:00
Leonardo de Moura
2f75768243 feat(library/tactic/rewrite_tactic): fail when nothing is rewritten
fixes #686
2015-06-28 12:05:00 -07:00
Leonardo de Moura
d1eaa7bcda feat(frontends/lean/parse_rewrite_tactic): accept trailing comman in rewrite tactic
see issue #695
2015-06-28 11:45:30 -07:00
Leonardo de Moura
4a4ef48344 fix(frontends/lean/parse_rewrite_tactic): fixes #691 2015-06-28 11:28:05 -07:00
Leonardo de Moura
869ad261c5 fix(frontends/lean/elaborator): fixes #689 2015-06-27 16:19:38 -07:00
Leonardo de Moura
8616ed096e fix(library/composition_manager): typo 2015-06-27 14:12:26 -07:00
Leonardo de Moura
ca0aa4eb47 feat(library/composition_manager): simplify compositions of the form (mk ... (proj (mk ...)) ...)
closes #666
2015-06-27 14:07:32 -07:00
Leonardo de Moura
3fa1829b22 feat(frontends/lean/migrate_cmd): add profile for migrate command 2015-06-27 14:07:32 -07:00
Leonardo de Moura
3215af3926 feat(frontends/lean): add '[trans-instance]' attribute
see issue #666
2015-06-27 14:07:29 -07:00
Leonardo de Moura
430dc21a28 feat(library/composition_manager): disable conversion optimization for automatically generated compositions
see issue #666
2015-06-27 14:07:22 -07:00
Leonardo de Moura
bd0e9d958d feat(library/tc_multigraph): shorter names for transitive edges
see issue #666
2015-06-27 14:07:15 -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
68785b8bed fix(library/tactic/generalize_tactic): fixes #711 2015-06-26 19:35:30 -07:00
Leonardo de Moura
6da49b1d56 fix(shell/lean): fixes #710 2015-06-26 19:15:47 -07:00
Leonardo de Moura
1886b71c17 fix(library/unifier): fixes #705 2015-06-26 19:10:46 -07:00
Leonardo de Moura
e3e9220ab9 fix(library/tactic/rewrite_tactic): fixes #708 2015-06-26 18:41:08 -07:00
Leonardo de Moura
c61e6f6595 feat(library/unifier): add new rule for constraints of the form (pr ...) =?= t, where (pr ...) is a "stuck" projection application 2015-06-26 17:18:29 -07:00
Leonardo de Moura
0b7859f387 feat(library,frontends/lean): add support for projections in the elaborator
The idea is to simulate the computation rules such as

    pr1 (mk a b) ==> a

in the elaborator
2015-06-26 17:18:29 -07:00
Leonardo de Moura
31a4ee2ac3 fix(library/inductive_unifier_plugin): avoid potential assertion violation 2015-06-26 17:18:29 -07:00
Leonardo de Moura
a680114fd8 fix(library/tactic/rewrite_tactic): potential crash in the rewrite tactic 2015-06-26 17:18:29 -07:00
Floris van Doorn
c8eee66c5b feat(hott/relation): add equivalence closure of a relation 2015-06-25 22:31:41 -04:00
Floris van Doorn
ea0f57aef5 feat(hott): various clean-up and small additions 2015-06-25 22:31:40 -04:00
Leonardo de Moura
5581b735f4 feat(library/constants.txt): add poly_unit and poly_unit.star 2015-06-25 17:36:34 -07:00
Floris van Doorn
fa1979c128 feat(datatypes): let the type of unit be the lowest non-Prop universe
The definitional package (brec_on and cases_on) now use poly_unit instead of unit

closes #698
2015-06-25 17:33:46 -07:00
Leonardo de Moura
919c4ea8ee feat(frontends/lean/calc_proof_elaborator): cleanup communication between unifier and calc_proof_elaborator 2015-06-24 14:14:44 -07:00
Leonardo de Moura
a2389fb664 refactor(kernel/default_converter): move delay_check code to postpone_is_def_eq method 2015-06-22 13:59:32 -07:00
Leonardo de Moura
76477aedd1 refactor(kernel): move is_stuck predicate to converter 2015-06-22 11:37:14 -07:00
Leonardo de Moura
5687c24944 refactor(library/tactic/induction_tactic): cleanup 2015-06-22 10:23:54 -07:00
Leonardo de Moura
54496709a2 refactor(kernel/default_converter): add virtual method reduce_def_eq
The idea is to allow us to customize the default converter outside of
the kernel.
2015-06-22 10:04:19 -07:00
Leonardo de Moura
a518a45239 refactor(kernel/default_converter): separate lazy_delta_reduction procedure 2015-06-22 08:45:05 -07:00
Leonardo de Moura
1c70514231 feat(frontends/lean/structure_cmd): disable conversion optimization for automatically generated coercions 2015-06-21 16:57:37 -07:00
Leonardo de Moura
aeea8f83c4 feat(library/composition_manager): check if existing definition is definitionally equal 2015-06-21 16:53:08 -07:00
Leonardo de Moura
e3062c64e2 feat(util/timeit): avoid scientific notation when displaying runtimes 2015-06-21 14:52:27 -07:00
Leonardo de Moura
b8243934de feat(library/tc_multigraph): finish transitive closed multigraph 2015-06-20 20:25:20 -07:00
Leonardo de Moura
3626bd83bf refactor(util/sexpr/format): remove format constructors using std::initializer_list
For some reason lean.js (Lean compiled using emscripten) crashes when
this kind of constructor is used.
2015-06-20 14:02:18 -07:00
Leonardo de Moura
d28c26b6eb feat(util/sexpr/format): small change
The idea is to avoid unnecessary memory allocations.
It may also help with the lean.js problem we are fighting with.
2015-06-19 21:21:28 -07:00
Leonardo de Moura
c6ad37a651 chore(src/library/tc_multigraph): fix typo 2015-06-19 21:12:11 -07:00
Leonardo de Moura
38394d85dd fix(util/sexpr/format): potential access memory violation 2015-06-19 20:26:35 -07:00
Leonardo de Moura
accc9dc38b chore(util/sexpr/format): remove unnecessary method 2015-06-19 20:11:42 -07:00
Leonardo de Moura
6872761c67 fix(library/tc_multigraph): typos 2015-06-19 20:11:31 -07:00
Leonardo de Moura
1f753aeccb feat(library): add tc_multigraph skeleton 2015-06-19 20:05:05 -07:00
Leonardo de Moura
70fc05294b refactor(library/local_context): avoid hack in local_context 2015-06-18 15:41:00 -07:00
Leonardo de Moura
694eef7f6a fix(util/sexpr/format): retract change that may be creating problems for emscripten 2015-06-18 10:49:13 -07:00
Leonardo de Moura
42c236eb2e chore(shell/emscripten): fix style 2015-06-18 10:23:49 -07:00
Leonardo de Moura
a24b06254b test(tests/shell): add unit test for emscripten_shell 2015-06-18 10:20:26 -07:00
Leonardo de Moura
a6fe4cbce6 refactor(shell): move emscripten_shell to a separate file 2015-06-18 09:53:23 -07:00
Leonardo de Moura
a4c0699e81 feat(library/tactic/constructor_tactic): restore 'constructor' tactic old semantics, add 'fconstructor' tactic
See issue #676

Add new test demonstrating why it is useful to have the old semantics
for 'constructor'
2015-06-17 23:48:54 -07:00
Leonardo de Moura
bf71d9f342 fix(library/tactic/rewrite_tactic): fixes #682 2015-06-17 18:49:02 -07:00
Leonardo de Moura
2109dff46a feat(frontends/lean): remove unnecessary flag 2015-06-17 17:23:20 -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
9e6e406f73 feat(frontends/lean): add '#compose' command for testing composition manager 2015-06-17 14:42:25 -07:00
Leonardo de Moura
c59e1f49db feat(library): add composition manager 2015-06-17 14:41:50 -07:00
Leonardo de Moura
14c33c4e01 feat(kernel/error_msgs): add workaround for issue #669
This issue should fix the new problem reported at #669.
It only disables beta-reduction in the pretty printer for application
type mismatch at (f n) when f is a lambda expression.
2015-06-17 12:00:25 -07:00
Leonardo de Moura
f60cdee14b fix(library/tactic/rewrite_tactic): memory leak 2015-06-16 15:47:21 -07:00