Commit graph

63 commits

Author SHA1 Message Date
Leonardo de Moura
bb9e3ddae2 feat(library/init/meta/interactive): rw [-h] ==> rw [← h]
@Armael: this change may affect your project.

The file `doc/changes.md` explains the motivation for the change.
2017-07-05 11:42:55 -07:00
Sebastian Ullrich
c8d6b40991 refactor(frontends/lean/builtin_exprs,library): suppose ~> assume : 2017-07-05 11:20:10 -07:00
Sebastian Ullrich
f024ccd75d refactor(frontends/lean/token_table,library): take ~> assume 2017-07-05 11:20:10 -07:00
Sebastian Ullrich
ad97607307 fix(frontends/lean/tactic_notation): always use quote_scope for parsing interactive parameters
Replace now redundant `qexpr` parser with `parser.pexpr`
2017-07-04 12:20:38 -07:00
Leonardo de Moura
76799db032 feat(library/init/meta/interactive): simph ==> simp [*]
This modification was suggested by @kha.

TODO:
- Use `simp [-f]` instead of `simp without f`
- Allow users to remove hypothesis from `*`. Example: `simp [*, -h]`
  for simplify using all hypotheses but `h`.
2017-07-03 15:14:47 -07:00
Leonardo de Moura
70b27fb2d3 feat(library/init/meta/interactive): unfold is now based on the simp framework
See issue #1694.

There is an orthogonal issue. `simp` (and consequently `unfold`) cannot be used to
reduce projections (e.g., `has_add.add`). This issue has been
previously raised by @Armael, but it was not addressed yet.
2017-07-02 11:30:48 -07:00
Mario Carneiro
9f2980a524 feat(init/data/int): int lemmas, more bitwise theorems 2017-06-27 18:55:52 -07:00
Sebastian Ullrich
0a48809469 refactor(frontends/lean/tactic_notation): rename note/define tactics to have/let 2017-06-22 08:03:23 -07:00
Mario Carneiro
b775a01fba refactor(init/meta/interactive): merge assert -> note 2017-06-22 08:03:23 -07:00
Mario Carneiro
d82b8ed59e feat(init/data/int,init/data/nat,init/algebra): more algebra theorems 2017-06-01 15:15:40 -07:00
Mario Carneiro
a0503f964c feat(init/algebra, init/data/int): more ring theorems 2017-05-27 04:14:04 -04:00
Mario Carneiro
07f4055dc0 feat(init/data/int): some more basic int theorems 2017-05-27 04:14:02 -04:00
Leonardo de Moura
55fee26b36 feat(library/class): add attribute for tracking symbols occurring in instances of type classes
For more information see:
https://github.com/leanprover/lean/wiki/Refactoring-structures
The new attribute [algebra] implements the [algebraic_class] described
in the page above.
2017-05-01 18:02:30 -07:00
Leonardo de Moura
74550fbebc feat(library/init/core): add notation for out_param 2017-05-01 13:52:17 -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
08e094139d feat(library/init/meta): add by_contradiction and by_cases to tactic.interactive 2017-04-26 12:54:52 -07:00
Sebastian Ullrich
e9a6c544af refactor(frontends/lean/{elaborator,structure_cmd}): compile structure inheritance to nested fields 2017-04-24 19:35:15 +02:00
Leonardo de Moura
e7603df514 feat(library/init/algebra): add type classes for algebraic normalizer 2017-04-18 15:47:38 -07:00
Leonardo de Moura
35eba0107e chore(library/init/algebra/ring): use . notation 2017-03-28 18:49:35 -07:00
Johannes Hölzl
bc0dbf0809 feat(library/init/algebra): add zero_ne_one and one_ne_zero to default simp-set 2017-03-28 18:44:56 -07:00
Leonardo de Moura
71685e4dd6 feat(frontends/lean): add support for t.<id> and t.<idx> when t is a composite term
Replace `^.` with `.` in the stdlib
2017-03-28 17:47:49 -07:00
Leonardo de Moura
6183c7676e feat(frontends/lean): use . for field access 2017-03-28 15:29:54 -07:00
Rob Lewis
2e921dd533 fix(algebra): generalize theorem 2017-03-22 07:34:01 -07:00
Simon Hudon
b6889e91fe feat(lib/init/data/nat): add function pow and a Galois connection between div and mul 2017-03-12 09:38:19 -07:00
Leonardo de Moura
9d3c0497cb chore(frontends/lean): rename transient commands
See issue #1432
2017-03-09 18:41:19 -08:00
Leonardo de Moura
c58f61e925 feat(frontends/lean/elaborator): new encoding for structure updates {s with ...}
See discussion at #1438
https://github.com/leanprover/lean/pull/1438#discussion_r105007325

@digama0 With this commit, the original `array_list.write` will also
perform a destructive update when the reference counter for `l` is 1.

```lean def write {α} (l : array_list α) : fin l^.length → α → array_list α :=
λ ⟨n, h⟩ v, { l with data := l^.data^.write ⟨n, l^.lt_capacity h⟩ h v }
```
2017-03-09 00:11:51 -08:00
Johannes Hölzl
4c88e2c5b0 feat(library/init/data/int): use relators for proof of int is a ring 2017-03-07 19:30:51 -08:00
Leonardo de Moura
59c0cbd2e4 chore(library): test new '^.' notation in the standard library, and cleanup definitions using it 2017-03-05 21:21:50 -08:00
Leonardo de Moura
19cf5e916b chore(script/gen_constants_cpp): generates a warning if automatically generated C++ function is not used in the source code 2017-02-21 12:05:41 -08:00
Leonardo de Moura
0a99910c52 feat(library/init/meta): add exception set to rsimp attributes, use iff lemmas 2017-02-18 19:43:21 -08:00
Sebastian Ullrich
d15591a2d8 feat(library,frontends/lean): expose parser to Lean and use for parsing tactic parameters 2017-02-17 13:45:56 +01:00
Rob Lewis
46a46c9ee0 feat(norm_num): handle nat subtraction as a special case 2017-02-12 17:15:08 -08:00
Leonardo de Moura
32e6442d0a feat(frontends/lean): no global universes in the frontend 2017-02-08 17:23:04 -08:00
Leonardo de Moura
8ef21040d6 chore(library/init/algebra/order): remove leftover 2017-01-22 21:31:04 -08:00
Leonardo de Moura
71a7a7f466 feat(frontends/lean): add default field values 2017-01-22 21:25:49 -08:00
Gabriel Ebner
03e09db70e refactor(library/data/bitvec,library/data/tuple): use automation 2017-01-21 09:48:35 +01:00
Leonardo de Moura
0795acaf6a refactor(library/init/algebra): new transport from multiplicative to additive
The motivation is to avoid the problems produced by the "declare as
structure and then tag as class idiom" described in the file ring.lean.
2017-01-18 19:39:53 -08:00
Leonardo de Moura
04fb7b88e7 feat(library/init/algebra): mark basic facts as [ematch] until we have support for arithmetic 2017-01-13 10:36:08 -08:00
Leonardo de Moura
fa4d47edd8 chore(library/init/algebra/ring): document messy problem in the algebraic hierarchy 2017-01-08 23:35:39 -08:00
Leonardo de Moura
5d825483c4 refactor(library/init/meta/interactive): tactic.interactive.types ==> interactive.types
Motivation: we will use auto-quotation for other tactic monads
2016-12-30 18:06:41 -08:00
Leonardo de Moura
aa23ba8714 chore(library/init/algebra): remove unnecessary generality
We can add it back if we find a compelling use case.
2016-12-27 17:40:34 -08:00
Leonardo de Moura
8fcfe0bbd4 feat(library/init/algebra/ac): add helper classes for AC 2016-12-27 16:54:00 -08:00
Leonardo de Moura
ca2095f2dd feat(library/init/algebra): add discrete_linear_ordered_field 2016-12-17 21:18:59 -08:00
Leonardo de Moura
37209d45a5 feat(library/init/algebra/norm_num): add missing norm_num lemmas 2016-12-17 20:20:55 -08:00
Leonardo de Moura
c99f25dbf5 feat(library/init/algebra/ordered_ring): add linear_ordered_comm_ring 2016-12-17 19:48:21 -08:00
Leonardo de Moura
303696e693 feat(library/init/algebra): add ordered_field 2016-12-17 19:34:10 -08:00
Leonardo de Moura
97fe22b20e feat(library/init/algebra/ordered_ring): ordered semiring/ring lemmas 2016-12-17 17:49:25 -08:00
Leonardo de Moura
060a554db1 feat(library/tactic): add norm_num_tactic 2016-12-17 16:48:40 -08:00
Leonardo de Moura
b84d5811d1 feat(library/init/algebra): add missing min/max/abs lemmas 2016-12-17 15:22:12 -08:00
Leonardo de Moura
1726d37d4e fix(library/algebra/order): decidable_linear_order
Add fields for decidable_eq and decidable_le.
We need this because a concrete instance may have its own
implementation that is not definitionally equal to
the old ones defined at library/algebra/order.lean.
Without this change, types such as nat and int would
have multiple definitions for decidable_eq and decidable_le
which are not definitionally equal.
2016-12-17 14:01:43 -08:00