Commit graph

13774 commits

Author SHA1 Message Date
Leonardo de Moura
ef9f9f1de0 fix(library/type_context): make sure local instances are not reset at set_env 2016-09-01 15:12:32 -07:00
Leonardo de Moura
9a2c95f35a test(tests/lean): add test for unset_attribute tactic 2016-09-01 14:50:03 -07:00
Leonardo de Moura
a38264439f fix(library/attribute_manager): get_instances returns deleted instances 2016-09-01 14:48:03 -07:00
Leonardo de Moura
39dc336310 feat(library/tactic/user_attribute): add set_basic_attribute and unset_attribute tactics 2016-09-01 14:17:05 -07:00
Leonardo de Moura
546f65b542 refactor(init/datatypes, init/logic): define sizeof instances and simp lemmas 2016-09-01 10:33:50 -07:00
Leonardo de Moura
49e368d49e refactor(library/init): merge datatypes and reserved_notation 2016-09-01 09:50:51 -07:00
Leonardo de Moura
4131b4168c refactor(library/init): define sizeof at init/datatypes 2016-09-01 09:47:46 -07:00
Leonardo de Moura
ff05f16caa fix(library/type_context): store instance fingerprint 2016-09-01 09:01:43 -07:00
Leonardo de Moura
e061e9acab refactor(frontends/lean/elaborator): remove elaborator::ctx()
The plan is to make `type_context` a transient object in the elaborator.
2016-09-01 08:28:30 -07:00
Leonardo de Moura
381f2dc434 chore(frontends/lean/elaborator): simplify mk_pp_ctx 2016-09-01 08:15:36 -07:00
Leonardo de Moura
cc6d764c6c refactor(library/tactic/defeq_simplifier): use new type_context 2016-08-31 17:52:47 -07:00
Leonardo de Moura
3384139d38 chore(library/tactic/defeq_simplifier): improve error messages 2016-08-31 17:52:36 -07:00
Leonardo de Moura
54fd9adb47 feat(library/equations_compiler): use defeq simplifier to cleanup types of automatically synthesized lemmas 2016-08-31 15:54:03 -07:00
Leonardo de Moura
4e33ca472d feat(library/tactic/defeq_simplifier): add helper function 2016-08-31 15:12:19 -07:00
Leonardo de Moura
51a338d9a1 fix(library/equations_compiler/structural_rec): support for reflexive inductive datatypes 2016-08-31 10:46:32 -07:00
Leonardo de Moura
924c98832b feat(library/equations_compiler/structural_rec): generate eqn lemmas at structural_rec 2016-08-31 09:07:17 -07:00
Leonardo de Moura
33514dd6ea feat(library/equations_compiler/structural_rec): process aux lemmas 2016-08-30 20:09:57 -07:00
Leonardo de Moura
3cc8b58433 feat(library/util): add get_constructor_rec_args 2016-08-30 20:09:41 -07:00
Leonardo de Moura
2fc0e5fa05 feat(library/equations_compiler/structural_rec): add aux definition 2016-08-30 18:33:24 -07:00
Leonardo de Moura
253fcdcc51 fix(library/equations_compiler/elim_match): equation lemma generation 2016-08-30 15:00:43 -07:00
Leonardo de Moura
001991dbeb feat(frontends/lean): use equations_header 2016-08-30 13:45:59 -07:00
Leonardo de Moura
a8690205c9 feat(library/type_context): improve on_is_def_eq_failure for stuck terms 2016-08-30 10:51:40 -07:00
Leonardo de Moura
08f4d87806 fix(library/type_context): complete_instance
The previous version was using typeclass inference to instantiate
arbitrary metavars in occurring in the input expression `e`.
This is incorrect. We should only use typeclass inference if the
metavariable is the argument of a function application (f ... ?m ...)
and the argument is marked and instance-implicit.
2016-08-30 10:50:40 -07:00
Leonardo de Moura
240a77c692 chore(library/type_context): replace auto with actual type 2016-08-30 08:31:35 -07:00
Leonardo de Moura
a1e8610e64 fix(library/type_context): take annotations into account at is_stuck 2016-08-30 08:29:15 -07:00
Leonardo de Moura
85cf20a5b4 fix(library/type_context): missing case: stuck projections
type_context only unfolds projections when they reduce.
2016-08-30 08:13:58 -07:00
Leonardo de Moura
bd99de9bf8 fix(frontends/lean/pp): remove unnecessary parenthesis when pretty printing (A -> (Pi (b : B), C b)) 2016-08-29 16:36:04 -07:00
Leonardo de Moura
230db1bc92 feat(library/equations_compiler/structural_rec): generate brec_on-based function
We still need to generate lemmas and induction principle.
2016-08-29 15:58:13 -07:00
Leonardo de Moura
f1f45cc2b7 feat(library/equations_compiler/structural_rec): better support for structural recursion (based on brec_on)
For example, before this commit, structural_rec would not support the
function to_nat defined below.

```
set_option new_elaborator true

inductive foo : bool → Type
| Z  : foo ff
| O  : foo ff → foo tt
| E  : foo tt → foo ff

definition to_nat : ∀ {b}, foo b → nat
| .ff Z     := 0
| .tt (O n) := to_nat n + 1
| .ff (E n) := to_nat n + 1
```
2016-08-29 10:51:09 -07:00
Leonardo de Moura
b08af16d5f refactor(library/equations_compiler): remove unnecessary abstraction
We changed how we are going to process derived inductive datatypes.
2016-08-29 09:25:01 -07:00
Leonardo de Moura
78f81034c6 feat(library): add helper methods 2016-08-29 08:31:33 -07:00
Leonardo de Moura
b317d4bc58 refactor(library/tactic): add hsubstitution module 2016-08-29 08:19:05 -07:00
Leonardo de Moura
71916acbf0 test(tests/lean): another test for bad annotations 2016-08-28 14:54:35 -07:00
Leonardo de Moura
204d950a5f test(tests/lean/run/def13): add map-like test for dependent patter matching 2016-08-28 14:45:39 -07:00
Leonardo de Moura
cb7c82fdd5 feat(library/type_context): make sure annotations are ignored at is_def_eq 2016-08-28 14:42:50 -07:00
Leonardo de Moura
1a675d69fc refactor(library/tactic/induction_tactic,library/tactic/cases_tactic): replace name_map<name> with substitutions at induction_tactic
This commit also removes dead code from cases_tactic
2016-08-28 14:09:22 -07:00
Leonardo de Moura
206bf613d5 feat(library/tactic/subst_tactic): use substitutions instead of name_map<name> in the subst_tactic (low level) API 2016-08-28 13:29:44 -07:00
Leonardo de Moura
f0f9880ece refactor(library/equations_compiler/elim_match,library/tactic/cases_tactic):
new design for elim_match

I still need to fix lemma generation, and refactor induction/subst tactics
2016-08-28 13:15:10 -07:00
Leonardo de Moura
f52be8c96f fix(tests/lean/bad_inaccessible): expected output 2016-08-28 08:34:39 -07:00
Leonardo de Moura
16a99436b4 fix(frontends/lean/elaborator): make sure all inductive datatype parameters in constructor applications are marked as inaccessible 2016-08-28 07:58:18 -07:00
Leonardo de Moura
b37b4f3dc8 fix(frontends/lean/elaborator): implicit terms are marked as inaccessible in patterns 2016-08-28 07:58:06 -07:00
Leonardo de Moura
0ed61c97c9 test(tests/lean/inaccessible2): add more invalid pattern tests 2016-08-28 07:57:55 -07:00
Leonardo de Moura
ae63821cdb fix(frontends/lean/elaborator): reject inaccessible annotation inside inaccessible annotation 2016-08-28 07:57:44 -07:00
Leonardo de Moura
7b37762231 fix(frontends/lean/elaborator): make sure elaborated term is based on what the user wrote 2016-08-28 07:57:34 -07:00
Leonardo de Moura
af7060b46e chore(library/tactic/cases_tactic): add trace 2016-08-28 07:57:20 -07:00
Leonardo de Moura
3cfd0f435a fix(frontends/lean/definition_cmds): make sure rec-functions have the ref_info flag turned on 2016-08-28 07:56:45 -07:00
Leonardo de Moura
19a6005f7e refactor(library): move user_attribute to tactic folder
It depends on tactic_state.
2016-08-26 09:28:42 -07:00
Leonardo de Moura
95e8228e8a refactor(library/tactic/cases_tactic): improve low-level API 2016-08-25 16:34:40 -07:00
Leonardo de Moura
98aefca014 fix(library/local_context): depends_on should take into account assigned metavariables 2016-08-25 13:49:54 -07:00
Leonardo de Moura
c032505023 chore(library/tactic/subst_tactic): missing '\n' in trace msg 2016-08-25 13:45:04 -07:00