Commit graph

290 commits

Author SHA1 Message Date
Sebastian Ullrich
9fdf11fa54 fix(frontends/lean/pp): shadowing shortened const
Fixes #1584
2017-05-18 09:35:14 -07:00
Sebastian Ullrich
75786e9a6e feat(frontends/lean/pp): hide (some) defaulted arguments on pp.implicit true 2017-05-17 10:38:12 -07:00
Leonardo de Moura
4575c9e038 feat(frontends/lean): swap (t) and ``(t) semantics 2017-05-15 09:41:31 -07:00
Sebastian Ullrich
8c0394b294 refactor(library,frontends/lean): separate expr and pexpr macros 2017-05-09 16:02:41 -07:00
Sebastian Ullrich
3c525bef6a fix(frontends/lean/pp): parenthesize Type u where necessary 2017-05-03 13:27:35 -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
Gabriel Ebner
8554b8eac1 fix(frontends/lean/pp): insert line breaks in notations 2017-05-01 13:13:07 +02:00
Sebastian Ullrich
e9a6c544af refactor(frontends/lean/{elaborator,structure_cmd}): compile structure inheritance to nested fields 2017-04-24 19:35:15 +02:00
Sebastian Ullrich
3f87755a2a fix(frontends/lean/pp): qualify constant shadowed by local 2017-03-31 09:40:49 -07:00
Sebastian Ullrich
cd013f22c0 chore(*): replace "'^.' notation" with "field notation", pretty print using "." 2017-03-31 09:40:49 -07:00
Leonardo de Moura
b6f6126075 feat(frontends/lean/pp): add attribute [pp_using_anonymous_constructor] for marking structures we should use the anonymous constructor notation when pretty printing instances 2017-03-09 15:17:18 -08:00
Sebastian Ullrich
5d68938a9c feat(frontends/lean): expr literals ```(...) 2017-03-05 08:37:16 -08:00
Leonardo de Moura
10c881266b refactor(frontends/lean): add parse_lparen 2017-02-17 21:46:39 -08:00
Leonardo de Moura
9210e45da0 feat(frontends/lean): add notation for ';' and '<|>' in the tactic interactive mode 2017-02-10 22:53:30 -08:00
Leonardo de Moura
3d603ec28e feat(kernel,library,frontends/lean,api): remove global universe levels from kernel and APIs 2017-02-08 17:41:44 -08:00
Leonardo de Moura
323db5a530 feat(frontends/lean/pp): pretty print structure instances and field projections 2017-02-05 14:01:53 -08:00
Gabriel Ebner
95068e4e79 feat(library/sorry): make sorry a macro 2017-02-05 14:01:03 +01:00
Gabriel Ebner
61804eb8e9 chore(util/sexpr): remove mpz and mpq cases 2017-01-31 09:39:31 +01:00
Leonardo de Moura
3b38f71f11 fix(library,tests/lean): fix run/interactive tests, and problems in the standard library due to the new interpretation for Type
We had to change subtype to use Sort since the axiom
strong_indefinite_description uses it.

see #1341
2017-01-30 11:54:00 -08:00
Leonardo de Moura
bf9f7560f7 feat(frontends/lean): (Type u) can't be a proposition
(Type u)  is the old (Type (u+1))
(PType u) is the old (Type u)
Type*     is the old (Type (_+1))
PType*    is the old Type*

The stdlib can be compiled, but we still have > 70 broken tests

See discussion at #1341
2017-01-30 11:54:00 -08:00
Leonardo de Moura
acef1efb86 fix(frontends/lean/pp,library/equations_compiler,library/tactic/smt/congruence_closure): bug at to_char function 2017-01-11 23:44:25 -08:00
Leonardo de Moura
9c069a3eda refactor(library/tactic/congruence): rename directory to smt 2016-12-30 13:15:19 -08:00
Leonardo de Moura
cf32e25f68 fix(frontends/lean/pp): pretty print pattern hints 2016-12-26 16:13:41 -08:00
Leonardo de Moura
66c781cce6 fix(frontends/lean/pp): bug when pretty printing partially applied polymorphic zero 2016-12-22 16:37:47 -08:00
Leonardo de Moura
6e57e70d04 fix(frontends/lean/pp): pretty print issue, and fix broken tests output
Remark: we do not allow user to access abstracted version anymore inside
of a section.
2016-12-15 15:42:54 -08:00
Leonardo de Moura
384cf04efd refactor(library/aliases,frontends/lean/local_ref_info): merge aliases and local_ref_info modules 2016-12-15 13:24:30 -08:00
Leonardo de Moura
ffe9b3c5d6 fix(frontends/lean/pp): char literals 2016-11-23 11:58:11 -08:00
Gabriel Ebner
15e2950834 core(frontends/lean/pp): bring back removed pp and pp_detail functions 2016-11-07 14:55:32 -08:00
Gabriel Ebner
b05b514cc2 refactor(*): structured message objects 2016-10-13 18:49:10 -07:00
Leonardo de Moura
d0d75c0923 refactor(kernel): reduce number of configurations supported in the kernel
Now, eta and impredicativity are assumed to be always true.

Motivation: the rest of the system assumes eta.
Regarding impredicativity, we decided to support only the standard library.
2016-09-27 17:07:01 -07:00
Leonardo de Moura
d7c3fce8a3 feat(library/init/coe,frontends/lean): more general coercions to fun
The new test dep_coe_to_fn.lean motivates the change.
2016-09-27 15:41:06 -07:00
Leonardo de Moura
6207dd0346 refactor(library/init): simplify has_emptyc type class 2016-09-27 10:03:57 -07:00
Leonardo de Moura
c6609543d0 chore(library/init): minor changes 2016-09-27 07:23:51 -07:00
Leonardo de Moura
451cd177f0 feat(frontends/lean/pp): pretty print set_of notation 2016-09-24 13:55:02 -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
Leonardo de Moura
89f62edaf0 refactor(library): reduce dependecies on old code, simplify normalize module 2016-09-19 22:12:34 -07:00
Leonardo de Moura
90bfd84a07 feat(frontends/lean): Type is now (Type 1)
In the standard library, we should use explicit universe variables for
universe polymorphic definitions.

Users that want to declare universe polymorphic definitions but do not
want to provide universe level parameters should use
  Type _
or
  Type*
2016-09-17 14:30:54 -07:00
Daniel Selsam
b0c5744eea feat(inductive_compiler): support for mutually inductive types 2016-09-10 14:22:27 -07:00
Leonardo de Moura
1afd81384f chore(library/let): delete let-macro hack 2016-09-10 13:06:07 -07:00
Leonardo de Moura
a74f02546b refactor(*): remove abbreviation command 2016-09-03 17:11:29 -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
e99eb6d47e feat(frontends/lean): revising inaccessible terms syntax again :( 2016-08-19 13:57:12 -07:00
Leonardo de Moura
20276f9b93 feat(frontends/lean/pp): pretty print character literals 2016-08-18 17:14:50 -07:00
Leonardo de Moura
b0abea78b6 fix(frontends/lean/pp): bug when pretty printing foldr/foldl notation 2016-08-16 10:34:04 -07:00
Leonardo de Moura
100a15cb0d feat(frontends/lean/pp): pretty print equations macro 2016-08-16 10:00:53 -07:00
Leonardo de Moura
fc4e304b27 refactor(library): move equations to equations_compiler 2016-08-11 10:08:30 -07:00
Leonardo de Moura
f056f0f2cb refactor(library): definitional ==> constructions 2016-08-11 10:08:22 -07:00
Leonardo de Moura
5c0a69657d feat(frontends/lean/pp,library/local_context): nicer pp for fresh names 2016-08-05 19:06:26 -07:00