Commit graph

13199 commits

Author SHA1 Message Date
Leonardo de Moura
d9322b16ca feat(library): add has_equiv type class 2017-12-03 15:03:58 -08:00
Leonardo de Moura
b6c8551753 feat(library): add to_bool lemmas 2017-12-03 15:03:58 -08:00
Leonardo de Moura
8032d2eefd feat(library/init/algebra/order): add instance 2017-12-03 15:03:58 -08:00
Sebastian Ullrich
450ca5834c fix(frontends/lean/parser): fix debug build 2017-11-30 17:47:49 +01:00
Sebastian Ullrich
1e1cd7378e chore(bin/lean-gdb): add pretty printer for lean::level 2017-11-30 17:47:49 +01:00
Sebastian Ullrich
0ca9eb16c1 fix(library/type_context): preprocess_class: always solve universe mvars in inout 2017-11-29 17:21:02 -08:00
Leonardo de Moura
4fdf452b17 fix(library/type_context): make sure all assigned metavariables are substituted 2017-11-29 17:19:15 -08:00
Leonardo de Moura
04f3684681 fix(library/tactic/cases_tactic): debug build 2017-11-29 15:05:19 -08:00
Sebastian Ullrich
c521a2d3c7 fix(library/type_context): do not cache queries containing tmp mvars 2017-11-29 14:43:33 -08:00
Leonardo de Moura
960832045f fix(library/type_context): failure condition 2017-11-29 14:35:58 -08:00
Leonardo de Moura
a411e6337c chore(library/type_context): typo 2017-11-29 14:35:36 -08:00
Leonardo de Moura
49b5fbe2c2 fix(library/type_context): add missing update
We also improved the comments, and documented alternative designs that
have been considered.
2017-11-28 08:07:11 -08:00
Sebastian Ullrich
f6b113849b fix(init/category/monad): bind_pure: remove stray parameter 2017-11-28 17:00:22 +01:00
Leonardo de Moura
641a4548b6 fix(library/tactic/cases_tactic): use inj_arrow instead no_confusion when index is a nested and/or mutually recursive datatype
The `no_confusion` construction is only generated for inductive
datatypes supported in the kernel.
Before this commit, given `h : T`, `cases h` could leak the internal encoding
used by the inductive compiler WHEN a nested and/or mutual inductive
datatype is used to index the inductive datatype `T`.
The new test exposes the problem.

The solution implemented in this commit uses inj_arrow lemmas
generated by the inductive compiler. We only use the lemmas
if the target is a proposition. If it is not, we sign an error.
The reason for this limitation is documented in the source code.

cc @jroesch @dselsam

Jared: the information leakage has been fixed. So, students will not be
confused by the internal encoding used in the inductive compiler.
I added the example I posted on slack as a new test.
Note that, the workaround I used has been removed.
2017-11-27 21:56:35 -08:00
Sebastian Ullrich
7c63b2f046 fix(frontends/lean/parser): unicode pattern aliases 2017-11-27 12:43:15 +01:00
Sebastian Ullrich
18cf63e37f fix(frontends/lean/elaborator): avoid assertion error on delayed abstraction in structure notation 2017-11-24 21:27:55 +01:00
Leonardo de Moura
e12275a925 perf(library/equations_compiler/elim_match): use max_sharing 2017-11-22 16:41:42 -08:00
Leonardo de Moura
47994fe14e chore(library): remove id_locked 2017-11-22 16:29:04 -08:00
Leonardo de Moura
64f575a2d5 perf(library/equations_compiler): performance problem for definitions that produce many equational lemmas
The new test and comment at src/library/equations_compiler/util.cpp
explains the issue.
2017-11-22 16:16:11 -08:00
Leonardo de Moura
dd9d8e9552 chore(library/equations_compiler): improve comments 2017-11-22 14:55:40 -08:00
Leonardo de Moura
01bbf27fb0 fix(library/equations_compiler/util): typo 2017-11-22 12:50:23 -08:00
Leonardo de Moura
7c35a25169 fix(frontends/lean): do not generate equation lemma for match expressions occurring in by tac nested in regular definitions 2017-11-22 12:49:32 -08:00
Leonardo de Moura
7d3133a845 fix(frontends/lean/structure_cmd): do not generate equation lemma for _default meta definitions 2017-11-22 12:24:51 -08:00
Sebastian Ullrich
30cfc6cf0b feat(frontends/lean/{parser,elaborator}): structure instance patterns 2017-11-22 12:16:28 -08:00
Sebastian Ullrich
511bf69dd4 chore(tests): forgot to commit structure instance test 2017-11-22 12:16:28 -08:00
Sebastian Ullrich
b3587e15a3 fix(library/tactic/user_attribute): persist user attribute parameters
Fixes #1871
2017-11-22 19:19:05 +01:00
Leonardo de Moura
c98c39e4b9 chore(library/init/data/rbtree/basic): remove unnecessary equation 2017-11-22 08:22:42 -08:00
Leonardo de Moura
0a1d2908aa feat(library/data/rbtree/main): rbtrees are balanced 2017-11-22 08:02:13 -08:00
Leonardo de Moura
b95b260706 fix(library/data/rbtree): insert 2017-11-22 07:52:18 -08:00
Leonardo de Moura
0208755c82 fix(library/vm/vm_string): bug at VM string < 2017-11-21 16:26:36 -08:00
Leonardo de Moura
96f8ecbdcb feat(library/data/rbmap): add find_insert lemmas for rbmap 2017-11-21 14:29:04 -08:00
Leonardo de Moura
f8fb92e431 feat(library/data/rbtree/insert): finish find_insert_of_not_eqv lemmas 2017-11-21 13:16:19 -08:00
Leonardo de Moura
cdb724b092 feat(library/init/meta/interactive): add shorthand for any_goals { assumption } 2017-11-21 13:02:57 -08:00
Leonardo de Moura
5f99056c1a feat(library/init/meta): basic support for ignoring auto and opt params 2017-11-21 11:52:40 -08:00
Leonardo de Moura
b3e429a1b8 chore(library/data/rbtree/insert): reduce proofs size 2017-11-21 10:37:10 -08:00
Leonardo de Moura
ae0f5642d3 feat(library/data/rbtree): find_insert_of_not_eqv lemmas
Remark: the balance2 case (dual of balance1) is still missing.
2017-11-20 21:27:19 -08:00
Leonardo de Moura
02545cb941 feat(library/data/rbmap): find_insert lemmas 2017-11-20 12:14:05 -08:00
Leonardo de Moura
319faca00a feat(library/data/rbtree): add mem_exact predicate and find_insert lemmas 2017-11-20 11:52:36 -08:00
Leonardo de Moura
a666c7f04e chore(library/init/data/rbmap): add missing file 2017-11-19 19:49:36 -08:00
Leonardo de Moura
1033836953 feat(library/data/rbmap): add rbmap lemmas 2017-11-19 19:49:36 -08:00
Leonardo de Moura
902c1219b0 feat(library/data/rbtree): more find lemmas 2017-11-19 19:49:36 -08:00
Leonardo de Moura
2354338287 feat(library/init/data/rbmap): add rbmap module 2017-11-19 19:49:36 -08:00
Sebastian Ullrich
06a316ad30 fix(frontends/lean/elaborator): type of '..' placeholders
Fixes #1870
2017-11-19 18:57:18 +01:00
Leonardo de Moura
50797c1d05 feat(library/data/rbtree): add specialized lemmas (for strict total orders) 2017-11-18 16:36:58 -08:00
Leonardo de Moura
320b33f305 feat(library/data/rbtree): add find and define contains using it 2017-11-18 16:06:16 -08:00
Leonardo de Moura
8ffff9e48b feat(library/data/rbtree): cleanup and add min max 2017-11-18 12:22:10 -08:00
Leonardo de Moura
effa90e884 refactor(library/init/data/rbtree): rbtree does not need (decidable_rel lt) parameter 2017-11-17 22:59:50 -08:00
Leonardo de Moura
9ea454af13 chore(tests/lean/notation2): fix test 2017-11-17 17:25:10 -08:00
Leonardo de Moura
dec5b7c806 feat(library/data/rbtree/lemmas): add mem_insert_of_incomp 2017-11-17 17:21:03 -08:00
Leonardo de Moura
3134e00341 fix(library/init/algebra/classes): strict_weak_order.equiv should not depend on type class 2017-11-17 17:19:00 -08:00