Commit graph

314 commits

Author SHA1 Message Date
Leonardo de Moura
a2f0bf7c1b chore(*): disable SMT tactic framework and backward chaining 2018-04-10 12:05:51 -07:00
Leonardo de Moura
c08a3bc557 refactor(library/typed_expr): move typed_expr to frontends/lean 2018-04-09 15:25:40 -07:00
Sebastian Ullrich
d6d44a1994 fix(frontends/lean/pp): fix #1922
Fixes #1922
2018-03-02 13:02:48 -08:00
Leonardo de Moura
11e87545be chore(frontends/lean): remove dead variables 2018-02-21 15:04:19 -08:00
Leonardo de Moura
058520d6e4 feat(frontends/lean/pp,library/local_context): use sanitize_name_generator_name
Remark: we should remove `sanitize_if_fresh` as soon as we delete `::lean::mk_fresh_name`
2018-02-21 15:04:19 -08:00
Nuno Lopes
7b45d28e77 chore(unicode): use utf8 chars directly in strings 2018-02-13 10:42:08 -08:00
Nuno Lopes
c43ebd8bf7 fix(msvc): remove another \uXX char that was causing an infinite loop 2018-02-13 10:42:08 -08:00
Nuno Lopes
977e11f9be fix(warnings): fix warnings on VS. its now /W2 clean 2018-02-13 10:42:08 -08:00
Sebastian Ullrich
be61ab4213 chore(frontends/lean/pp): document binding power intricacies 2018-02-02 08:58:52 -08:00
Sebastian Ullrich
e427068081 fix(frontends/lean/pp): missing parentheses around notation 2018-02-02 08:58:52 -08:00
Leonardo de Moura
fa6697ffa8 feat(frontends/lean/pp): add option pp.annotations for debugging purposes 2018-01-30 12:48:48 -08:00
Sebastian Ullrich
e7e05a3ad0 feat(frontends/lean): add aliasing patterns id@pat 2017-11-17 16:35:21 -08:00
Leonardo de Moura
1f757ba84e fix(frontends/lean/pp): fixes #1817 2017-09-07 15:23:58 -07:00
Gabriel Ebner
2804a0ea27 fix(util/name): escape empty name components using french quotes 2017-07-31 16:01:46 +01:00
Leonardo de Moura
9afb53fad5 feat(kernel/expr): allow metavariables to have user-facing names
We need this feature for:
1) Defining nonlinear search patterns. Example: (?m <= ?m + 1)
2) Preprocessing recursive equations and support the pattern
refinement approach used in Agda. Example: in Agda, they accept
```
def append {A : Type} : Π (m n : nat), Vec A m -> Vec A n -> Vec A (m + n)
| m n nil            ys := ys
| m n (cons m' x xs) ys := cons x (append m' n xs ys)
```
These equations have to be refined. For example, `m` has to be
replaced with `0` (in the first equation), and `succ m'` in the
second. To implement this kind of refinement, we need to convert
the pattern variables (local constants) into metavariables during
elaboration. Then, the unassigned metavariables become local constants
again. This preprocessing step will fix some of the issues on #1594.
To completely fix #1594, we will need yet another preprocessing step
which will implement "complete transition" used in the equation
compiler before we start elim_match.cpp
2017-07-16 07:16:41 -07:00
Gabriel Ebner
9367e94900 fix(frontends/lean/pp): hide proof terms in non-proofs by default
This is mainly to reduce clutter.  Proof term printing can still be
forced using the `pp.proofs` option.
2017-07-15 22:21:22 +01:00
Gabriel Ebner
37d9e03cc1 feat(frontends/lean/pp): show substituted expressions for delayed abstractions
@leodemoura I tried to look up the unique names in the local context,
but this pretty much always fails.  AFAICT we never remember the local
context when pretty-printing expression texts.
2017-07-15 21:34:05 +01:00
Sebastian Ullrich
3cdf502c58 fix(frontends/lean/pp): escape keyword-like identifiers 2017-07-01 10:38:15 -07:00
Sebastian Ullrich
f53fa97c4a feat(frontends/lean): escape identifiers when pretty-printing 2017-06-28 10:43:19 -07:00
Leonardo de Moura
5cb96c7fa3 feat(frontends/lean): add option for pretty printing metavars, sorry and delayed abstractions as holes
This option is false by default, but true when executing hole commands
2017-06-15 10:24:26 -07:00
Leonardo de Moura
62c24f9bb5 chore(*): remove pos_num and num from stdlib 2017-05-25 18:24:16 -07:00
Gabriel Ebner
00ac867ddf feat(frontends/lean/elaborator,library/sorry): suppress error message that mention synthetic sorrys 2017-05-23 11:14:30 -07:00
Leonardo de Moura
2f301d5fc7 fix(frontends/lean/pp): fix previous commit 2017-05-18 14:24:19 -07:00
Leonardo de Moura
323060df26 fix(frontends/lean/pp): pp for mutual definitions
missing line break
2017-05-18 11:46:14 -07:00
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