Commit graph

13774 commits

Author SHA1 Message Date
Floris van Doorn
da1fc03d15 doc(CONTRIBUTING): add instructions to run test suite 2017-10-30 16:20:36 +01:00
Sebastian Ullrich
1a80ea9c8e fix(util/utf8): UTF8 decoding 2017-10-27 09:48:09 -07:00
Sebastian Ullrich
734ee66514 fix(library/string): unicode char literals 2017-10-27 09:48:09 -07:00
Leonardo de Moura
ce4e316e09 fix(library/equations_compiler/util): fixes #1841 2017-10-26 11:25:16 -07:00
Leonardo de Moura
d2497d554f feat(frontends/lean): add support for unicode char literals and escape sequences
TODO: we are not checking if the unicode escape values provide by the
user correspond to valud unicode scalar values. We should check how
other languanges handle this case.
2017-10-23 13:46:57 -07:00
Mario Carneiro
0f7fdae33e refactor(algebra/ordered_group): remove redundant axioms
for ordered_cancel_comm_monoid. The change to partial_order, with a derived lt relation, makes the lt axioms of ordered groups derivable with no additional assumptions.
2017-10-23 12:20:42 -07:00
Sebastian Ullrich
032e0701e0 fix(frontends/lean/elaborator): non-recursive local shouldn't shadow projection 2017-10-23 12:12:06 -07:00
Sebastian Ullrich
716c730c38 fix(frontends/lean/structure_cmd): allow extending structures in the current context 2017-10-23 11:12:14 -07:00
Leonardo de Moura
e53f8021ec feat(library/vm/vm_string): add builtin VM implementation for string.cmp 2017-10-23 10:55:26 -07:00
Leonardo de Moura
10184315fb feat(library/vm/vm_string): add builtin VM implementation for string.has_decidable_eq 2017-10-23 10:55:26 -07:00
Leonardo de Moura
a9e884cc1d fix(library/vm/vm_string): bug at string.iterator.remove VM builtin implementation 2017-10-23 10:55:26 -07:00
Leonardo de Moura
f8ce142da7 fix(library/vm/vm_string): bug at string.iterator.insert VM builtin implementation 2017-10-23 10:55:26 -07:00
Leonardo de Moura
e30f2f6604 fix(library/vm/vm): bug at update_vm_constructor 2017-10-23 10:55:26 -07:00
Leonardo de Moura
47a8c2baef fix(library/vm/vm_string): missing VM builtin for string_imp projections 2017-10-23 10:55:26 -07:00
Leonardo de Moura
ffb2464f1f fix(library/vm/vm_string): missing VM builtin for string.iterator_imp projections 2017-10-23 10:55:26 -07:00
Leonardo de Moura
7cba1c6753 fix(library/vm/vm_string): bug at string.fold VM builtin implementation 2017-10-23 10:55:26 -07:00
Leonardo de Moura
9399ce8346 feat(library/vm/vm_string): provide native implementation of type string in the VM
closes #1175

The types `string_imp` and `string.iterator_imp` were supposed to be
marked private, but we cannot do it because we need to provide
`string_imp.mk`, `string_imp.cases_on`, `string.iterator_imp.mk` and
`string.iterator_imp.cases_on` in the VM since we use a different
internal representation. Note that marking them as private does not
work since users can still access `string_imp.cases_on` using
meta-programming.
So, we need better support for private declarations.

Missing feature, char literals do not support non ASCII values.
That is, in the current implementation, we cannot write 'α'.
This will be implemented in the future.

The VM native implementation does not behave correctly for huge
strings (i.e., strings with more than 4G characters).
The problem is that the current implementation relies on
```
size_t force_to_size_t(vm_obj const & o, size_t def)
```
We may also have overflow problems in the string.iterator implementation
code. This is not a big deal right now, since I doubt we will try
to process string with more than 2^32 characters.

@Kha the `core_lib` and tests seem to be working correctly, but
we need more tests.
2017-10-23 10:55:26 -07:00
Leonardo de Moura
28501a0e0e feat(library/init/data/string): string as a list of unicode scalar values, and iterator abstraction
TODO:
- Implement string primitives in the VM.
- Support for unicode char literals.
2017-10-23 10:55:26 -07:00
Leonardo de Moura
bdc8e1ced8 feat(library/init/data/char): char as an unicode scalar value
TODO: this is the first step to have better unicode support.
2017-10-23 10:55:26 -07:00
Sebastian Ullrich
87e1a88d01 feat(init/meta/pexpr): allow creating structure instance pre-terms 2017-10-11 16:13:34 +02:00
Sebastian Ullrich
5efa1b829c chore(src/emacs): move lean-mode to https://github.com/leanprover/lean-mode
Closes #410
2017-10-06 10:46:43 -07:00
Jeremy Avigad
bcad5309d9 fix(library/init/meta/interactive): implement docstring fixes from kha 2017-09-22 16:53:22 -04:00
Jeremy Avigad
57f9cbeb78 fix(tests/lean/interactive/*): fix tests 2017-09-21 21:16:20 -04:00
Jeremy Avigad
41b94ed3a2 refactor/feat(library/init/meta/interactive): revise and add docstrings 2017-09-21 21:15:41 -04:00
Mario Carneiro
d83b9ef3ef fix(init/algebra/ordered_ring): theorem has two instances 2017-09-18 13:04:59 -07:00
Sebastian Ullrich
d54c4e11c2 feat(emacs): highlight flycheck and eldoc output 2017-09-18 13:02:06 -07:00
Leonardo de Moura
f0bf1624fe feat(frontends/lean/brackets): closes #1820 2017-09-15 12:54:21 -07:00
Sebastian Ullrich
650b4ab3dc chore(.travis.yml): undo Travis update
The test_registry test is failing because `python3` seems to have reverted to Python 3.4 in a Travis upgrade. Probably related to https://github.com/travis-ci/travis-ci/issues/8315#issuecomment-327537437.
2017-09-15 12:33:46 -07:00
Mario Carneiro
983328806b chore(init/algebra/group): generalize to noncomm groups 2017-09-15 12:33:46 -07:00
Mario Carneiro
9e34ee94eb chore(init/algebra/ordered_ring): generalize thm to noncommutative rings 2017-09-15 12:33:46 -07:00
Mario Carneiro
5c8409b1a0 chore(init/data/nat/lemmas): pred_le_pred: remove superfluous assumption 2017-09-15 12:33:46 -07:00
Leonardo de Moura
f36fca875c feag(frontends/lean): explicit delimiters in declaration parameters
Comment from parser.h

This commit makes sure that all declaration parameters must be surrounded with some kind of bracket. (e.g., '()', '{}', '[]').
The goal is to avoid counter-intuitive declarations such as:

              example p : false := trivial
              def main proof : false := trivial

which would be parsed as

              example (p : false) : _ := trivial

              def main (proof : false) : _ := trivial

where `_` in both cases is elaborated into `true`. This issue was raised by @gebner in the slack channel.

Remark: we still want implicit delimiters for lambda/pi expressions. That is, we want to write

               fun x : t, s
           or
               fun x, s

instead of

               fun (x : t), s
2017-09-15 10:07:09 -07:00
Gabriel Ebner
3d711b37c3 chore(*): development version 3.3.1 2017-09-14 18:55:03 +02:00
Gabriel Ebner
fa9c868ed2 chore(*): version 3.3.0 2017-09-14 18:53:38 +02:00
Sebastian Ullrich
7ff06b2184 chore(init/meta/attribute): rename user_attribute.set_param to user_attribute.set
Setting the parameter value really is a side effect of setting the whole attribute
2017-09-14 18:48:18 +02:00
Sebastian Ullrich
928e982565 chore(init/meta/mk_has_reflect_instance): disallow indexed families for now
We need to adapt the recursion code to pass `reflected` instances for indices
2017-09-14 18:48:18 +02:00
Sebastian Ullrich
6549643d39 chore(init/meta/derive): remove inhabited derive handler for now
The generated instances were unnecessarily restrictive
2017-09-14 18:48:18 +02:00
Sebastian Ullrich
8d9c0ac806 fix(frontends/lean/tactic_notation): by tactic: accept non-atomic proof 2017-09-14 18:48:18 +02:00
Sebastian Ullrich
3c68f6fa00 fix(leanpkg): fix error message 2017-09-14 18:48:18 +02:00
Sebastian Ullrich
87b39bd1c3 fix(init/meta/derive): handle indexed families 2017-09-14 18:48:18 +02:00
Sebastian Ullrich
2faad5114a chore(frontends/lean): enforce and document applying attributes last 2017-09-14 18:48:18 +02:00
Sebastian Ullrich
aa3c707ab4 chore(init/meta/derive): document 2017-09-14 18:48:18 +02:00
Gabriel Ebner
341cf71fb9 fix(frontends/lean/structure_cmd): check parent expression after elaboration as well 2017-09-14 09:36:40 +02:00
Leonardo de Moura
6781681ae5 feat(frontends/lean/definition_cmds): when the kernel fails to type check a declaration include the fully elaborated term in the error message 2017-09-13 16:43:54 -07:00
Leonardo de Moura
dbe1033427 fix(library/init/meta/mk_has_sizeof_instance): indexed families
see #1818
2017-09-12 15:17:34 -07:00
Gabriel Ebner
9118079f7f fix(library/module_mgr): error handling in cyclic imports
Fixes #1807
2017-09-12 17:22:47 +02:00
Sebastian Ullrich
5410178203 chore(init/meta/mk_has_reflect_instance): document 2017-09-11 16:56:03 -07:00
Sebastian Ullrich
4d1c4aee03 feat(init/meta/mk_has_reflect_instance): add derive_handler for has_reflect 2017-09-11 16:56:03 -07:00
Sebastian Ullrich
e18a14d6e0 fix(init/meta/expr): reflected.subst should always return an expr of the correct type 2017-09-11 16:56:03 -07:00
Sebastian Ullrich
f2c5342aaa feat(init/meta/derive): handle parameters, parameter instances, universes 2017-09-11 16:56:03 -07:00