Sebastian Ullrich
beec014890
feat(library/init/lean/{parser/term,expander}): remove (x : e) → f macro hack and replace with actual parser
2019-03-25 16:12:14 +01:00
Sebastian Ullrich
360a1476cc
chore(tests/playground/environment_ext): use nicer full name like in C++
2019-03-25 16:12:14 +01:00
Sebastian Ullrich
7c0912d41c
refactor(frontends/lean/lean_environment): move environment parts out of lean_elaborator.cpp
2019-03-25 16:12:14 +01:00
Leonardo de Moura
60f8d17942
refactor(library/init/data/string/basic): simplify String.Iterator
...
The `offset` field is problematic because it prevents us from having an
efficient way of moving back and forth between `String.Pos` and `String.Iterator`.
@kha I temporarily added `String.OldIterator` for making sure the
parser doesn't break. This is a temporary fix that will be eliminated
after we replace `parsec`.
2019-03-25 07:57:12 -07:00
Sebastian Ullrich
88af3c948a
fix(lean4-mode/lean4-flycheck): update lean4-bootstrapped-checker
2019-03-24 20:55:20 +01:00
Sebastian Ullrich
082b217928
fix(util/kvmap): adjust to Lean definition
2019-03-24 20:46:40 +01:00
Sebastian Ullrich
6ea5f5196e
feat(library/init/lean/expander): support Agda-like (a : b) → c syntax
2019-03-24 20:25:11 +01:00
Leonardo de Moura
5b08bf18c5
feat(library/init/lean): improving options
...
@kha It will be awesome to automate the following idiom with a macro :)
```
def defIndent := 4
def getIndent (o : Options) : Nat := o.get `format.indent defIndent
@[init] def indentOption : IO Unit :=
registerOption `format.indent { defValue := defIndent, group := "format", descr := "indentation" }
```
2019-03-24 09:30:20 -07:00
Leonardo de Moura
9d1f4a4f29
chore(library/init/control/state): indentation consistency
2019-03-23 19:03:26 -07:00
Leonardo de Moura
4d9150859b
chore(library/init/core): avoid {{x : A}} strict implicit arguments, and cleanup
2019-03-23 19:03:26 -07:00
Sebastian Ullrich
e3ea2e84d2
feat(frontends/lean/lean_elaborator): set position of #check output etc.
2019-03-23 23:13:09 +01:00
Sebastian Ullrich
07059fe2bf
fix(library/init/lean/frontend): naming style misrenamings
2019-03-23 23:09:55 +01:00
Sebastian Ullrich
e27bffabef
fix(lean4-mode/lean4-flycheck): allow changing lean4-extra-arguments without restart
2019-03-23 23:09:55 +01:00
Leonardo de Moura
8225146aa2
chore(library/init/core): HasLt => HasLess, HasLe => HasLessEq, ...
2019-03-23 10:07:46 -07:00
Leonardo de Moura
41f373cd0d
chore(library/init/lean/declaration): naming convention
2019-03-23 09:28:38 -07:00
Leonardo de Moura
d110a607fe
fix(runtime/io): bug at IO.Ref primitives in multi-threaded mode
2019-03-23 09:06:04 -07:00
Leonardo de Moura
df9ce10623
feat(library/compiler): special support for initialization functions of the form def initFn : IO Unit
...
We can now write
```
@[init] def initFn : IO Unit := ...
```
instead of
```
def initFn : IO Unit := ...
@[init initFn] constant execInitFn : Unit := ()
```
2019-03-23 08:46:38 -07:00
Leonardo de Moura
3b70e8785b
chore(tests/compiler/str): fix test
2019-03-22 17:26:43 -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
cc8ccae754
feat(library/init/data/string/basic): add String.foldl and String.foldr
2019-03-22 17:26:43 -07:00
Leonardo de Moura
d4aab31ada
feat(library/init/io): IO.userError
2019-03-22 17:26:43 -07:00
Leonardo de Moura
c10a99e96f
feat(library/init/lean/name): add String.toName
2019-03-22 17:26:43 -07:00
Leonardo de Moura
4f80e30574
feat(library/init/data/string/basic): add String.split
2019-03-22 17:26:43 -07:00
Leonardo de Moura
81f847a2d1
chore(stage0): update
2019-03-22 17:26:43 -07:00
Leonardo de Moura
98163e53ac
chore(library/init/data/string/basic): simplify UTF8 API names
...
@kha I am finding the UTF8 API super useful. So, I am giving nice names
to it. The API is safe for users and the runtime implementation should
match the reference one.
2019-03-22 17:26:43 -07:00
Leonardo de Moura
050985121d
chore(library/init/data/string/basic): utf8Pos => Pos
2019-03-22 17:26:43 -07:00
Leonardo de Moura
1c671965c5
feat(library/init/lean/options): add registerOption
2019-03-22 17:26:43 -07:00
Leonardo de Moura
dc73d5443d
refactor(library/init/lean): add MData abbreviation
2019-03-22 17:26:43 -07:00
Sebastian Ullrich
91b244f679
chore(tests/playground/environment_ext): style and minor changes
2019-03-22 22:51:21 +01:00
Sebastian Ullrich
dc93bc37cc
chore(tests/playground/environment_ext): fix
2019-03-22 22:51:21 +01:00
Leonardo de Moura
3d52298c69
chore(util/sexpr): preparing to port options to Lean
2019-03-22 13:58:16 -07:00
Leonardo de Moura
50207e2c5a
chore(library/constants.txt): remove dead variables
2019-03-22 13:26:48 -07:00
Leonardo de Moura
45c4a78f59
chore(tests/playground/environment_ext): revert accidental commit
2019-03-22 13:26:17 -07:00
Leonardo de Moura
2b76d79791
chore(library/init/core): remove more nonsense
2019-03-22 13:14:20 -07:00
Leonardo de Moura
930653f292
chore(library/init): Unit.star => Unit.unit
...
@kha Our stdlib is starting to match the names we used in our paper :)
2019-03-22 13:06:45 -07:00
Leonardo de Moura
3fe5cf1528
chore(library/init/core): remove another weirdness: the bs at bnot, band and bor
2019-03-22 12:57:31 -07:00
Leonardo de Moura
e1ea2b3948
chore(library/init): fix names and add HasEmptyc instances
2019-03-22 12:38:22 -07:00
Leonardo de Moura
e24ad8c0b5
feat(library/init/core): add HasBeq default instances for types that implement DecidableEq
...
@kha I think code looks less weird if we don't mix Booleans and
propositions in the same expression.
2019-03-22 11:23:45 -07:00
Leonardo de Moura
3202840959
fix(runtime/io): make IO.Ref thread-safe again
...
See new comment at `io.cpp`
2019-03-22 09:59:32 -07:00
Leonardo de Moura
9c9a30d834
chore(stage0): update
2019-03-22 09:39:42 -07:00
Leonardo de Moura
87b066b87e
refactor(library/init): move function.lean definitions to core.lean
2019-03-22 09:33:10 -07:00
Leonardo de Moura
e31c3fde56
chore(library/init): remove dead code, lemma => theorem
2019-03-22 09:27:30 -07:00
Leonardo de Moura
46cb2436d8
chore(library/init/core): remove dead code, and naming convention
2019-03-22 09:19:28 -07:00
Leonardo de Moura
7552b2e1e4
chore(library/init/data/list/basic): mem => Mem
2019-03-22 09:10:21 -07:00
Sebastian Ullrich
5f7a63b34b
feat(shell/lean): accept stand-alone files as input
...
@leodemoura
2019-03-22 14:05:10 +01:00
Sebastian Ullrich
fa0381cecf
fix(library/Makefile): clean STAGE1_OUT too
...
vanished during merge
2019-03-22 10:18:33 +01:00
Leonardo de Moura
548e7c5436
chore(tests/playground): fix playground tests
2019-03-21 18:30:58 -07:00
Leonardo de Moura
452d5107ac
chore(library/init/data/array): naming convention
...
The array read and write operations are now called:
- "Comfortable" version (with runtime bound checks):
`Array.get` and `Array.set` like OCaml.
It is also consistent with `Ref.get` and `Ref.put`,
and `get` and `set` for `MonadState`.
- `Fin` version (without runtime bound checks):
`Array.index` and `Array.update` like in F*.
- `USize` version (without runtime bound checks and unboxing):
`Array.idx` and `Array.updt`.
cc @kha
2019-03-21 18:03:29 -07:00
Leonardo de Moura
4a08d6715a
chore(library/init/data/array): add HasEmptyc instance
2019-03-21 17:06:56 -07:00
Leonardo de Moura
91204a52d6
chore(library/init/data/dlist): Dlist => DList
2019-03-21 17:03:22 -07:00