Commit graph

3873 commits

Author SHA1 Message Date
Leonardo de Moura
8b659ae679 fix(util/lean_path): change the default LEAN_PATH, a file in the current directory cannot shadow a library file, fixes #321 2014-11-14 17:23:09 -08:00
Leonardo de Moura
7685516d1e feat(frontends/lean): better default for atomic notation 2014-11-14 16:25:13 -08:00
Leonardo de Moura
67de3b06f3 feat(kernel/level): improve universe level pretty printer
Example: produce `l+2` instead of `succ (succ l)`.
2014-11-14 14:51:03 -08:00
Leonardo de Moura
00df34a1c4 feat(library/unifier): generalize method process_succ_eq_max_core 2014-11-14 14:25:41 -08:00
Leonardo de Moura
ffffabad95 feat(kernel/level): improve is_geq procedure for universe levels
Now, it also returns true for

          (succ^k1 a)  =?=  k2

where k1 >= k2
2014-11-14 14:20:35 -08:00
Leonardo de Moura
488f989c46 fix(frontends/lean/inductive_cmd): generate error for inductive datatype declarations that will produce an eliminator that can only eliminate to Prop 2014-11-14 13:57:42 -08:00
Leonardo de Moura
58525905d0 fix(frontends/lean/notation_cmd): bugs in 'reserve notation' command 2014-11-13 22:05:55 -08:00
Leonardo de Moura
51719145f9 feat(library/unifier): solved universe constraints of the form succ^k1 a = max k2 ?m (when k1 >= k2) 2014-11-12 17:28:33 -08:00
Leonardo de Moura
6bc89f0916 feat(library/definitional): define ibelow and below
These are helper definitions for brec_on and binduction_on
2014-11-12 16:38:46 -08:00
Leonardo de Moura
b07b82cf43 fix(library/definitional): marking cases_on and rec_on as reducible
The idea is to avoid counter-intuitive behavior
2014-11-12 15:03:30 -08:00
Leonardo de Moura
858538a329 refactor(library/definitional): add new to_telescope procedure, and remove code duplication in no_confusion.cpp 2014-11-12 13:31:31 -08:00
Leonardo de Moura
a3066e3eaa fix(frontends/lean/inductive_cmd): bug in inductive datatype elaborator 2014-11-12 13:10:19 -08:00
Leonardo de Moura
b4c37d180b refactor(library/definitional): add some helper functions 2014-11-12 12:24:22 -08:00
Leonardo de Moura
5312afa7ec feat(frontends/lean/inductive_cmd): improve resulting universe level inference for inductive datatypes
The new test contains examples that required explicit levels.
2014-11-12 10:52:32 -08:00
Leonardo de Moura
e2bfe6ee36 refactor(library/definitional/no_confusion): cleanup API 2014-11-11 16:12:44 -08:00
Leonardo de Moura
f6889951c6 fix(library/definitional/cases_on): bug in inductive datatypes with higher-order recursion 2014-11-11 15:14:08 -08:00
Leonardo de Moura
902a551048 feat(definitional/brec_on): add 'mk_below' skeleton 2014-11-11 14:55:21 -08:00
Leonardo de Moura
5fbf9ee964 refactor(library/definitional/util): remove code duplication 2014-11-11 13:53:41 -08:00
Leonardo de Moura
1079d6b320 refactor(library/definitional): combine auxiliary functions used by definitional package in a single module 2014-11-11 13:46:36 -08:00
Leonardo de Moura
b4be96c980 feat(library/definitional/util): add is_inductive_predicate auxiliary predicate 2014-11-11 13:32:56 -08:00
Leonardo de Moura
4fd1ee7619 feat(library/definitional/util): add is_recursive_datatype auxiliary function 2014-11-11 12:26:26 -08:00
Leonardo de Moura
50973bb4f3 feat(frontends/lean): default 'eval' command ignores opaque/irreducible annotations
To retrieve the previous behavior, we should use [strict] modifier
2014-11-10 12:46:04 -08:00
Leonardo de Moura
bd5f3ec572 feat(emacs/lean-syntax): highlight [decls] modifier 2014-11-10 10:35:42 -08:00
Leonardo de Moura
363d4a7577 fix(library/definitional/no_confusion): assertion violation 2014-11-10 10:32:03 -08:00
Leonardo de Moura
95554a527c feat(frontends/lean/placeholder_elaborator): display instance trace header once per class-instance resolution problem 2014-11-09 15:00:13 -08:00
Leonardo de Moura
fa26c2301c fix(frontends/lean): fix pretty-printing spacing problem 2014-11-09 14:49:43 -08:00
Leonardo de Moura
3aac26d658 fix(frontends/lean): tactic + variables bug, fixes #315 2014-11-09 14:43:22 -08:00
Leonardo de Moura
eff3c6b774 feat(frontends/lean): add variation of the foldl/foldr notation where initial element is suppressed, closes #314
See tests/lean/fold.lean for examples
2014-11-09 14:08:33 -08:00
Leonardo de Moura
ce889ddf60 feat(frontends/lean/scanner): disallow hierarchical names such as 'x.1' 2014-11-09 12:55:13 -08:00
Leonardo de Moura
df5a17cdce feat(frontends/lean/placeholder_elaborator): include type in class-instance resolution trace 2014-11-09 12:06:16 -08:00
Leonardo de Moura
1d9a0a6265 feat(frontends/lean/placeholder_elaborator): add option 'elaborator.instance_max_depth' 2014-11-09 11:59:44 -08:00
Leonardo de Moura
9b9ae128d5 feat(frontends/lean): include file-name and line/col numbers when displaying class-instance resolution trace 2014-11-09 11:47:01 -08:00
Leonardo de Moura
6362610411 fix(frontends/lean): include position information 2014-11-09 11:43:44 -08:00
Leonardo de Moura
76fb6893e1 feat(frontends/lean): add elaborator.trace_instances option
When on this option allows us to visualize "class-instance resolution"
2014-11-09 11:24:19 -08:00
Leonardo de Moura
0b8c44a94a feat(frontends/lean): add option pp.purify_metavars
It is true by default. If the user sets it to false, then
the internal metavariable names are used in the pretty printer
2014-11-09 11:04:22 -08:00
Soonho Kong
d25e74b921 fix(emacs/lean-mode): remove whitespace-cleanup-mode dependency
- When customization variable 'lean-delete-trailing-whitespace' is
   non-nil, trailing-whitespaces are removed before save.

 - It doesn't change TABs.

Close #226
2014-11-09 00:21:43 -05:00
Soonho Kong
36476b9115 fix(lean-util): handle case where incomplete hierarchical name ends with "."
Close #311
2014-11-08 23:46:59 -05:00
Leonardo de Moura
e8bc0f8249 feat(library/defitional): add no_confusion construction for inductive datatypes that are not propositions 2014-11-08 18:56:52 -08:00
Leonardo de Moura
b5da143fc0 feat(library/defitional): add no_confusion_type construction for inductive datatypes that are not propositions 2014-11-08 15:20:19 -08:00
Leonardo de Moura
c7992f2cac feat(frontends/lean): add [whnf] modifier to eval command 2014-11-08 10:19:29 -08:00
Soonho Kong
d861c78072 fix(emacs/lean-syntax): change comment symbols to be considered as punctuations
Please read the documentation of "modify-syntax-entry":

"The first character of NEWENTRY should be one of the following:
  _           symbol constituent
  .           punctuation
"

Close: #306
2014-11-07 17:48:21 -05:00
Soonho Kong
18a41eb962 feat(emacs/lean-mode): bind "C-c C-k" to quail-show-key
- Use this to see how to type a unicode character
2014-11-07 17:28:21 -05:00
Leonardo de Moura
b5e0ded163 feat(frontends/lean): max precedence used by Lean is not max_uint anymore
The motivation is to allow users to define notation with higher
precedence than function application.
2014-11-07 07:57:11 -08:00
Leonardo de Moura
85d0521d48 feat(frontends/lean): add '[parsing-only]' modifier to notation declarations, closes #305 2014-11-06 21:34:05 -08:00
Leonardo de Moura
8d05238533 fix(kernel/error_msgs): ignore binder information when comparing type mismatches, fixes #304 2014-11-06 21:03:51 -08:00
Leonardo de Moura
ed83b7ff2a fix(emacs/lean-syntax): syntax highlight, issue #306
1- FIXED     structure foo := (bar : Type) -- the name of structures is not highlighted
2- NOT FIXED check foo-- this comment is not highlighted
3- FIXED     check Type.{5} -- Type is not highlighted
4- FIXED     definition bar{thisishighlighted : Type} := foo
5- FIXED     definition bar2 {thetypeofthisvariableisnothighlighted :Type} := foo

Have no idea what is going on with 2. I'm not sure if this is our bug,
or Emacs code we depend on.
2014-11-06 20:59:31 -08:00
Leonardo de Moura
af88e34588 fix(kernel/inductive): bug in eliminator for recursive datatypes in Prop 2014-11-06 14:03:28 -08:00
Leonardo de Moura
be52d950f0 fix(frontends/lean): improve error message, addresses issue #299 2014-11-06 12:19:40 -08:00
Leonardo de Moura
e499f8e20a feat(kernel/inductive): relax conditions for an inductive datatype in Prop to be able to eliminate into Type
The new relaxed version allows us to define the "accessability"
proposition and have an eliminator into Type.

See justification in the new comments at inductive.cpp
2014-11-06 09:36:54 -08:00
Leonardo de Moura
8723f5b613 fix(frontends/lean/inductive_cmd): inductive datatype elaborator was 'fixing' parameter mismatches.
Given a datatype C with parameters As, if the declaration contained
(C Bs), the elaborator would silently replace it with (C As).

This bug would confuse users and make them believe they define something
different.
2014-11-05 23:12:00 -08:00
Leonardo de Moura
b3ad8c704a feat(frontends/lean/structure_cmd): allow inheritance from two identical structures, closes #296 2014-11-05 15:01:05 -08:00
Leonardo de Moura
4650791108 feat(frontends/lean): add 'print fields' command 2014-11-05 14:06:54 -08:00
Leonardo de Moura
677e0aeef6 fix(frontends/lean/structure_cmd): accept ': Type' when universe levels are not specified 2014-11-05 12:02:52 -08:00
Leonardo de Moura
d6dc624ca8 fix(frontends/lean/structure_cmd): error parsing structure without parameters followed by ': Type' 2014-11-05 12:02:52 -08:00
Leonardo de Moura
defc2478b5 feat(frontends/lean): add 'record' as an alias for 'structure' command 2014-11-05 12:02:52 -08:00
Soonho Kong
e71db7109d fix(emacs/lean-mode.el): remove quotation marks in lean-execute
Close #294
2014-11-05 09:20:14 -05:00
Leonardo de Moura
5b87d060cf fix(frontends/lean/structure_cmd): universe level validation 2014-11-04 22:19:23 -08:00
Leonardo de Moura
6944c7d902 fix(frontends/lean/placeholder_elaborator): local context must be adjusted when performing class-instance resolution modulo Pi-abstraction, fixes #293 2014-11-04 18:41:27 -08:00
Leonardo de Moura
b5ad0fb504 refactor(frontends/lean/local_context): add 'const' modifier 2014-11-04 18:37:31 -08:00
Leonardo de Moura
3bfe5b0b7e fix(frontends/lean): type information for "atomic" notation declaration, fixes #292 2014-11-04 18:01:20 -08:00
Leonardo de Moura
fa405d7884 refactor(frontends/lean): combine info annotations in a single module 2014-11-04 18:01:20 -08:00
Leonardo de Moura
c6c090eda6 feat(src/emacs/lean-mode): add shortcut for restarting lean server 2014-11-04 18:01:20 -08:00
Soonho Kong
2273f75e9b fix(emacs/lean-mode): handle when there is spaces in filenames 2014-11-04 19:22:35 -05:00
Soonho Kong
53e18d0e39 chore(src/CMakeLists.txt): copy linja and ltag to bin when install 2014-11-04 18:16:04 -05:00
Leonardo de Moura
60eac0195d feat(frontends/lean/structure_cmd): generate projection over constructor theorems for structures 2014-11-04 09:10:25 -08:00
Leonardo de Moura
d58c3e498d feat(frontends/lean/builtin_cmds): add 'print prefix' command 2014-11-04 08:40:32 -08:00
Leonardo de Moura
3454e70017 fix(frontends/lean/inductive_cmd): bug in expression position propagation, fixes #289
Fix incorrect line/column number information in error messages produced
during inductive datatype elaboration.
2014-11-04 07:44:47 -08:00
Leonardo de Moura
b6722a5d33 feat(frontends/lean/structure_cmd): add 'private' modifier for parent structures
When it is used coercions/instances to parent structure are to registered
2014-11-03 23:16:49 -08:00
Leonardo de Moura
b24165dc7b feat(frontends/lean/structure_cmd): remove 'cases_on' for structures since it may confuse users, add 'destruct' as alternative name for 'rec_on' 2014-11-03 23:06:33 -08:00
Leonardo de Moura
7897e21a14 feat(frontends/lean/structure_cmd): allow fields to be suppresed, but constructor to be provided 2014-11-03 22:55:51 -08:00
Leonardo de Moura
08b4ce2db9 feat(frontends/lean/structure_cmd): use 'mk' as constructor name when it is not provided 2014-11-03 22:40:08 -08:00
Leonardo de Moura
8f3139231b feat(frontends/lean/structure_cmd): allow structure declarations that contains only a header 2014-11-03 22:17:43 -08:00
Leonardo de Moura
91749d2364 fix(frontends/lean/structure_cmd): modify coercion generation
The previous coercion was more efficient, but the computation was
getting stuck when processing algebraic structures
2014-11-03 19:37:11 -08:00
Leonardo de Moura
edd94c00df fix(library/definitional): add missing files 2014-11-03 18:36:25 -08:00
Leonardo de Moura
c306bfa83c feat(frontends/lean/structure_cmd): add 'eta' theorem for structures 2014-11-03 18:33:44 -08:00
Leonardo de Moura
101e9966fd fix(emacs/lean-syntax): bug in syntax highlight, examples do not have names 2014-11-03 18:32:18 -08:00
Leonardo de Moura
186d910d0b feat(frontends/lean/structure_cmd): mark coercion to parents as coercions and instances (when both structures as classes) 2014-11-03 17:55:59 -08:00
Leonardo de Moura
9531203d9d feat(frontends/lean/structure_cmd): mark structure as 'class' when [class] modifier is used 2014-11-03 17:47:08 -08:00
Leonardo de Moura
b112f3c582 feat(frontends/lean/structure_cmd): add coercions to parent structures 2014-11-03 17:39:52 -08:00
Leonardo de Moura
922e66c42f fix(frontends/lean/decl_cmds): do not save 'examples' in .ilean file 2014-11-03 16:13:46 -08:00
Leonardo de Moura
7afa69577e feat(frontends/lean/structure_cmd): add aliases for structure decls 2014-11-03 15:50:41 -08:00
Leonardo de Moura
efe1105eb9 fix(frontends/lean): alias generation for composite names was not working
This is an issue for declarations that generate composite names such as
the inductive datatype packacke.

The commit also fix a bug in the generate of aliases for recursors
2014-11-03 15:43:58 -08:00
Leonardo de Moura
594e3ea8fc fix(frontends/lean/structure_cmd): 'rec' must be marked as protected 2014-11-03 14:50:12 -08:00
Leonardo de Moura
5872c93eaf feat(frontends/lean/structure_cmd): add structure_cmd core 2014-11-03 14:14:40 -08:00
Leonardo de Moura
a2e75159c8 fix(frontends/lean): process choice-exprs at check_constant_next 2014-11-02 19:42:30 -08:00
Leonardo de Moura
c7406d6ce8 fix(library/scoped_ext): bug when declaring nested namespaces 2014-11-02 15:35:49 -08:00
Leonardo de Moura
df008dc3c3 feat(frontends/lean/inductive_cmd): create a namespace for each declared datatype 2014-11-01 19:15:46 -07:00
Leonardo de Moura
ea55ec4090 feat(frontends/lean/decl_cmds): remove useless name from 'example' commad 2014-11-01 16:12:23 -07:00
Leonardo de Moura
1e6f7cdbb4 chore(frontends/lean/decl_cmds): add 'example' command
It is like a theorem, but it is discarded after checking
2014-11-01 11:37:39 -07:00
Leonardo de Moura
b1c2efecbb chore(frontends/lean/decl_cmds): add missing static 2014-11-01 11:18:10 -07:00
Leonardo de Moura
94cf10284a fix(frontends/lean/calc_proof_elaborator): bug when inserting symmetry proofs for heq, fixes #286
The problem was that heq type is
    Pi {A : Type} (a : A) {B : Type} (b : B), Prop

The calc_proof_elaborator was assuming that (a : A) (b : B) were the
last two arguments in any relation supported by calc.

The fix is to remove this assumption.
2014-11-01 07:30:04 -07:00
Leonardo de Moura
2688ca38bf feat(frontends/lean/inductive_cmd): notation for enumeration types 2014-10-31 19:01:32 -07:00
Leonardo de Moura
aaad9a3c43 feat(library/definitional/projection): add option for marking main premise as instance implicit (i.e., [] binder decorator) 2014-10-31 19:01:32 -07:00
Soonho Kong
cae543e665 chore(emacs): remove unnecessary requires 2014-10-31 16:01:10 -07:00
Soonho Kong
96f620adf6 doc(README.md): add Aquamacs case, ask to update lean-rootdir
[skip ci]
2014-10-31 09:58:15 -07:00
Leonardo de Moura
57b19b787b feat(frontends/lean/calc_proof_elaborator): when 'elaborator.calc_assistant' is on, generate same info that is generated if ! was used 2014-10-31 09:49:45 -07:00
Leonardo de Moura
dc7ab17d2a feat(frontends/lean/calc_proof_elaborator): add 'elaborator.calc_assistant' option 2014-10-31 09:49:45 -07:00
Leonardo de Moura
d7beabe91c fix(frontends/lean/calc_proof_elaborator): improve calc proof assistant 2014-10-31 09:49:45 -07:00
Leonardo de Moura
8a4d4409cd feat(frontends/lean/calc_proof_elaborator): add '{...⁻¹}' if needed in calc proofs, closes #268
This commit also simplifies library/data/nat/basic.lean
2014-10-31 01:02:49 -07:00
Leonardo de Moura
17df85f592 feat(frontends/lean/calc_proof_elaborator): add '{...}' if needed in calc proof steps
This is part of #268
2014-10-31 00:55:19 -07:00