Leonardo de Moura
128acd3b47
chore(library/init): remove @[extern cpp ...]
2019-08-24 07:40:38 -07:00
Leonardo de Moura
98e6e0c09a
feat(library/init): add "extern c" attributes
2019-08-20 11:53:46 -07:00
Leonardo de Moura
d00019f57e
chore(library/init): fix whitspaces before =>
2019-08-09 09:13:49 -07:00
Leonardo de Moura
4d913370a7
chore(library/init): eliminate whitespaces using another patch script
2019-08-09 09:01:39 -07:00
Sebastian Ullrich
3ed67138d5
chore(*): update equation syntax in files and old parser
...
for f in ../../**/*.lean; do echo $f; ./patch.lean.out $f > tmp && cat tmp > $f; done
2019-08-09 11:11:34 +02:00
Leonardo de Moura
b2e1ff8b3e
feat(library/init): use new "empty match" syntax
2019-07-15 16:25:14 -07:00
Leonardo de Moura
ea6eee516b
chore(frontends/lean): use => instead of := in match-expressions
...
Motivation: use same separator used in lambda expressions as in
other programming languages.
2019-07-04 11:38:38 -07:00
Leonardo de Moura
a02443d23d
chore(frontends/lean): fun x, e ==> fun x => e
2019-07-02 13:22:11 -07:00
Sebastian Ullrich
c77970a00f
refactor(library): remove now-redundant parentheses
2019-05-03 13:57:21 +02:00
Leonardo de Moura
beb946d132
chore(library/init/data/int/basic): remove weird notation, dead code, and fix camelCase conversion issues
2019-04-03 02:54:34 -07:00
Leonardo de Moura
79b6a144d5
feat(library/init/data/string/basic): improve and cleanup String/Substring API
2019-03-25 14:19:10 -07:00
Leonardo de Moura
8225146aa2
chore(library/init/core): HasLt => HasLess, HasLe => HasLessEq, ...
2019-03-23 10:07:46 -07:00
Leonardo de Moura
412d0ea578
feat(library/init/lean/options): add setOptionFromString
...
We can use this primitive to process command line arguments of the form
`-D <key> = <value>`
TODO: allow users to attach `[init]` to definitions of the form
```
@[init] def foo : IO Unit := ...
```
and avoid the awkward auxiliary constant.
2019-03-22 17:26:43 -07:00
Leonardo de Moura
2ea0baeb99
chore(library): use lowercase in imports
2019-03-21 15:06:44 -07:00
Leonardo de Moura
675003318e
chore(*): small fixes
2019-03-21 15:06:44 -07:00
Sebastian Ullrich
beda5f5f43
chore(library): capitalize types and namespaces
2019-03-21 15:06:43 -07:00
Sebastian Ullrich
f7aeeaf237
exclude export/extern, translate constants.txt
2019-03-21 15:06:43 -07:00
Sebastian Ullrich
b939162168
chore(library): switch from snake_case to camelCase
2019-03-21 15:06:43 -07:00
Leonardo de Moura
52db59eb87
fix(library/init/data/int/basic): nasty bug at int.repr
2019-02-12 15:58:59 -08:00
Leonardo de Moura
425a4b70d1
feat(library/init/data/int/basic): use extern attribute, and fix div/mod mess
...
Now, int.div and int.mod behave like C++ `/` and `%` for int,
moreover, they satisfy
(a/b)*b + (a%b) = a
2019-02-12 11:41:46 -08:00
Leonardo de Moura
835b3a10cc
chore(library/init): consistent names
2018-11-14 13:08:57 -08:00
Leonardo de Moura
3ee863da68
feat(library/compiler/erase_irrelevant): eliminate cases_on for builtin types
2018-10-23 14:58:38 -07:00
Leonardo de Moura
71dd8653bc
feat(library/init/core): decidable_eq is a proper class
...
We need this to take advantage of the new indexing structure we are
going to add to improve performance.
2018-09-07 16:38:11 -07:00
Leonardo de Moura
e9b4b811de
chore(library/equations_compiler/util): disable generation of equational lemmas
...
@kha, `eqn_compiler.lemmas` is false by default.
I will keep them disabled until I remove the inductive compiler.
I'm building the new inductive datatype module (to replace the inductive
compiler), and the lemmas will fail to be proved in the next commits
until the transition is complete.
2018-06-12 13:03:25 -07:00
Leonardo de Moura
032a101262
chore(*): remove more files
...
@kha I'm trying to remove as much as possible before I start
modifying `expr`
2018-05-21 06:42:58 -07:00
Leonardo de Moura
d5fe509c36
chore(*): remove end after each match-expression
...
`end` is not optional anymore
2018-05-04 11:30:06 -07:00
Leonardo de Moura
1289037e56
chore(library/init): cleanup
2018-04-30 09:25:25 -07:00
Leonardo de Moura
c9e4c89d9c
chore(library/init/meta): remove mk_dec_eq_instance
...
The tactic mk_dec_eq_instance constructs a function using the brec_on
recursor. The compiler generates horrible code for this kind of
definition. It creates a closure for each recursive call.
Moreover, `brec_on` accumulates all intermediate results.
To generate efficient code, we need to generate a collection of
recursive equations, and then invoke the equation compiler.
cc @kha
2018-04-27 16:13:10 -07:00
Leonardo de Moura
7aaac31e35
chore(library/init/data/nat): remove dependency
2018-04-10 15:48:13 -07:00
Leonardo de Moura
b0e49535fa
chore(*): remove transfer and coinductive predicates
2018-04-10 13:38:18 -07:00
Leonardo de Moura
c03d351744
chore(library/init/data/int): keep only definitions
2018-04-10 13:29:06 -07:00
Leonardo de Moura
6ab792733d
feat(library/type_context): smart unfolding
...
closes #1794
2018-01-09 15:09:08 -08:00
Leonardo de Moura
7b97e82fb3
chore(library): remove unnecessary repeat applications
2017-12-04 12:16:11 -08:00
Leonardo de Moura
b7322e28c1
feat(library): do not using simp lemmas for sorting arguments of AC operators by default
2017-12-03 15:03:58 -08:00
Sebastian Ullrich
52a9f82bc2
feat(init/meta/derive): implement [derive] attribute
2017-09-05 23:14:34 +02:00
Sebastian Ullrich
f255513fdc
fix(frontends/lean/definition_cmds): apply attributes after declaring equational lemmas
...
Fixes `@[simp] def ...`
2017-09-01 13:36:53 +02:00
Mario Carneiro
1b28b9f5bd
chore(init/data/int/basic): define nat_abs using equation compiler
2017-07-28 16:47:53 +01:00
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
f024ccd75d
refactor(frontends/lean/token_table,library): take ~> assume
2017-07-05 11:20:10 -07:00
Mario Carneiro
9f2980a524
feat(init/data/int): int lemmas, more bitwise theorems
2017-06-27 18:55:52 -07:00
Mario Carneiro
e705d89490
feat(init/data/int): bitwise ops for integers
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
Gabriel Ebner
82bb37422d
fix(library/init/data/int): add to_string instance for integers
2017-06-19 14:30:58 +02:00
Leonardo de Moura
dc1a1c8540
refactor(library): has_to_string ==> has_repr
...
See issue #1664
This is just the first step to implement proposal described at issue #1664 .
2017-06-18 18:29:19 -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
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
Johannes Hölzl
c4c2d703f6
feat(library/init/data): simplify int.transfer; add int and nat to zero_ne_one_class
2017-03-28 18:44:56 -07:00