Commit graph

18 commits

Author SHA1 Message Date
Sebastian Ullrich
39cdae50ee feat(library,frontends/lean): use mdata instead of hacky cache for position information in preterms 2018-09-02 18:08:41 -07:00
Leonardo de Moura
ddf1c89e76 chore(kernel/abstract): remove mk_binding cache 2018-06-07 16:28:54 -07:00
Sebastian Ullrich
0aacccd8c9 feat(frontends/lean): change structure update notation
`{s with ...}` is now `{..., ..s}`, which more clearly expresses that the
result type is not necessarily equal to the type of `s` (in absence of an
expected type and a structure name, we still default to the type of `s`).

Multiple fallback sources can be given: `{..., ..s, ..t}` will fall back to
searching a field in `s`, then in `t`. The last component can also be `..`,
which will replace any missing fields with a placeholder.

The old notation will be removed in the future.
2017-11-17 16:40:47 -08:00
Leonardo de Moura
f0bf1624fe feat(frontends/lean/brackets): closes #1820 2017-09-15 12:54:21 -07:00
Leonardo de Moura
f339f97975 fix(frontends/lean/brackets): fixes #1703 2017-06-26 12:52:52 -07:00
Gabriel Ebner
47629e9da3 feat(frontends/lean): make most parser_errors recoverable 2017-05-23 11:14:31 -07:00
Gabriel Ebner
33c737fc53 feat(frontends/lean/brackets): allow trailing commas in brackets 2017-05-23 11:14:30 -07:00
Leonardo de Moura
5cef84709f refactor(library): avoid auxiliary definitions such as add/mul/le/etc
See Section "Other goodies" at
https://github.com/leanprover/lean/wiki/Refactoring-structures

This commit also improves the support for projections in the
unifier/matcher.

Now, we consider the extra case-split for projections.
Given a projection `proj`, and the constraint `proj s =?= proj t`, we need to try first `s =?= t` and if it fails, then try to reduce.
This is needed in the standard library because we now have constraints such as:
```
@has_le.le ?A ?s ?a ?b  =?=  @has_le.le nat nat.has_add x y
```
If we reduce the right hand side, we get the unsolvable constraint
```
@has_le.le ?A ?s ?a ?b  =?=  nat.le x y
```
Before this change, the constraint was `@le ?A ?s ?a ?b  =?=  @le nat nat.has_add x y`, and we already perform a case-split in this case.
Moreover, projections were eagerly reduced whenever possible.
The extra case-split generates a performance problem in several tests. For example `fib 8 = 34` was timing out.
I worked around this issue by performing the case-split only when the constraint contains meta-variables.
There are also minor issues. Example. `<` is notation for `has_lt.lt`, but `>` is for `gt`.
2017-05-01 08:52:19 -07:00
Leonardo de Moura
71a7a7f466 feat(frontends/lean): add default field values 2017-01-22 21:25:49 -08:00
Leonardo de Moura
9b84db083d fix(frontends/lean): error localization bugs 2016-10-15 13:40:57 -07:00
Leonardo de Moura
c6609543d0 chore(library/init): minor changes 2016-09-27 07:23:51 -07:00
Leonardo de Moura
9ee553945c feat(frontends/lean/brackets): set_of notation 2016-09-24 13:47:41 -07:00
Leonardo de Moura
47b66b640f fix(frontends/lean/structure_instance): incorrect assertions 2016-09-23 10:30:30 -07:00
Leonardo de Moura
96fe057d87 chore(frontends/lean/brackets): warnings 2016-09-23 10:19:33 -07:00
Leonardo de Moura
b55a17614a feat(frontends/lean): structure instances 2016-09-21 22:52:43 -07:00
Leonardo de Moura
b7abd61579 feat(frontends/lean): change subtype notation (again)
We had conflicts with the set notation.
2016-09-21 17:02:18 -07:00
Leonardo de Moura
973bc5f1d6 feat(frontends/lean): add notation for 'sep' 2016-09-21 16:29:59 -07:00
Leonardo de Moura
c0ff9967af feat(frontends/lean): add basic notation for collections 2016-09-21 16:20:57 -07:00