Commit graph

26011 commits

Author SHA1 Message Date
Leonardo de Moura
28785bd8f1 chore: update stage0 2020-11-19 08:08:53 -08:00
Leonardo de Moura
5cc110dd77 feat: add Array.appendCore for quotations
We need it before we can define the more efficient `Array.append`
2020-11-19 08:07:53 -08:00
Leonardo de Moura
c305c2691f chore: use := 2020-11-19 07:22:31 -08:00
Leonardo de Moura
bd6265b484 chore: update stage0 2020-11-19 06:49:48 -08:00
Leonardo de Moura
0fcf6217ec feat: optional := before constructors in the inductive command
@Kha In the documentation, I will always use `:=`. The idea is to
avoid the issue: why does `structure` have a `:=` but `inductive`
doesn't.
2020-11-19 06:43:14 -08:00
Leonardo de Moura
7ccb996df5 doc: add tour.md 2020-11-18 19:06:21 -08:00
Leonardo de Moura
519922eaf4 doc: basic documentation 2020-11-18 18:47:22 -08:00
Leonardo de Moura
91dca53274 refactor: remove MonadIO
There is no reason for having `MonadIO` anymore. The `MonadLift` type
class is well behaved in the new frontend, the `MonadFinally` solves
the problem at monad stacks such as `ExcepT e IO`.

This commit also changes the type of the IO printing functions.
For example, the type of `IO.println` was
```
def IO.println {m} [MonadIO m] {α} [ToString α] (s : α) : m Unit
```
and now it is just
```
def IO.println {α} [ToString α] (s : α) : IO Unit
```
We rely on the new frontend auto-lifting feature.
That is, if there is an instance `[MonadLiftT IO m]`, then
a term of type `IO a` is automatically coerced to `m a`

We also want a simpler `IO.println` for writing tests.
For example,
```
```
doesn't work because there isn't sufficient information for inferring
the parameter `m` in the previous `IO.println`.
The shortest workaround looked very weird
```
```

I considered adding `IO` as a default value for `m` when we have
`MonadIO m`, as we use `Nat` as the default for `ofNat a`, but it felt
like uncessary complexity.

@Kha The commit seems to work well. The auto-lifting featuring has
been working great for me. There is still room for improvement.
For example, given `MonadLiftT m n`, it doesn't automatically lift
`a -> m b` into `a -> n b`. So, code such as
`foo >>= IO.println`
had to be rewritten as
`foo >>= fun x => IO.println x`
I will add this feature later.
If you have time, please try to play with this feature and figure out
if it is stable enough for making it the default.
That is, if it roboust enough, we can stop using the following idiom
for writing functions that can be lifted automatically.
```
def instantiateLevelMVarsImp (u : Level) : MetaM Level :=
  ...

def instantiateLevelMVars {m} [MonadLiftT MetaM m] (u : Level) : m Level :=
  liftMetaM $ instantiateLevelMVarsImp u
```
I think we only need this idiom when using `MonadControlT` which is
not as common as `MonadLiftT`.
2020-11-18 18:47:22 -08:00
Leonardo de Moura
bebca44773 feat: add println! macro for rewriting examples 2020-11-18 18:47:22 -08:00
Leonardo de Moura
e991f1993f feat: add Delta.lean 2020-11-18 18:47:22 -08:00
Leonardo de Moura
45cd9fe725 feat: add Core.transform 2020-11-18 18:47:22 -08:00
Leonardo de Moura
83deff4cde feat: add transform 2020-11-18 18:47:22 -08:00
Leonardo de Moura
590932584c chore: update stage0 2020-11-18 18:47:22 -08:00
Leonardo de Moura
a056332c03 fix: registerLetRecsToLift 2020-11-18 18:47:22 -08:00
Leonardo de Moura
35b193ebc0 chore: helper instances 2020-11-18 18:47:22 -08:00
Sebastian Ullrich
8c11905cd5 chore: update GitHub Actions actions 2020-11-18 12:05:21 +01:00
Leonardo de Moura
2c06ba577e chore: fix test 2020-11-17 17:14:06 -08:00
Leonardo de Moura
8ff204e067 chore: update stage0 2020-11-17 17:07:12 -08:00
Leonardo de Moura
7e533b4650 refactor: use Lists for Array reference implementation
Motivation: better reduction in the kernel.

cc @Kha
2020-11-17 17:05:53 -08:00
Leonardo de Moura
160a263049 chore: cleanup parsers 2020-11-17 14:29:32 -08:00
Leonardo de Moura
07149e6b75 chore: update stage0 2020-11-17 13:55:08 -08:00
Leonardo de Moura
df0e4808ec feat: define tactic parsers using syntax command 2020-11-17 13:52:36 -08:00
Leonardo de Moura
4da5cdb13d chore: declare tactic parsers using syntax command 2020-11-17 13:35:21 -08:00
Leonardo de Moura
c64cc0f662 chore: update stage0 2020-11-17 13:35:01 -08:00
Leonardo de Moura
a13c036181 chore: remove tactic builtin parsers 2020-11-17 13:34:05 -08:00
Leonardo de Moura
64669f4562 chore: refine heuristic for automatically marking the first symbol in tactic notation as non-reserved 2020-11-17 13:32:00 -08:00
Leonardo de Moura
4a9c69c7f5 chore: add parser alias matchDiscr 2020-11-17 13:31:56 -08:00
Leonardo de Moura
f17193e162 chore: update stage0 2020-11-17 11:49:53 -08:00
Leonardo de Moura
e737de3384 chore: cleanup induction/cases notation 2020-11-17 11:48:55 -08:00
Leonardo de Moura
8751bbe2a8 fix: notation for non reserved symbols 2020-11-17 11:25:04 -08:00
Leonardo de Moura
8fa5c0ddb9 chore: update stage0 2020-11-17 11:16:54 -08:00
Leonardo de Moura
3ad2d6c4e1 chore: add parser aliases 2020-11-17 11:15:17 -08:00
Leonardo de Moura
1d93eefada feat: add ! x notation for notFollowedBy(x) in the syntax command 2020-11-17 10:57:15 -08:00
Leonardo de Moura
f7dbfe6e1f chore: update stage0 2020-11-17 10:49:18 -08:00
Leonardo de Moura
96db4985eb feat: allow anonymous antiquotations at ParserDescr.nodeWithAntiquot 2020-11-17 10:48:22 -08:00
Leonardo de Moura
dfa0b97916 chore: remove notSymbol hacks 2020-11-17 10:45:55 -08:00
Leonardo de Moura
da23b96b43 feat: improve error messages for syntax command 2020-11-17 10:33:53 -08:00
Leonardo de Moura
af8d616d5a feath: improve unary and binary parsers 2020-11-17 08:39:56 -08:00
Leonardo de Moura
360fa1638f chore: rename Parser.try to Parser.atomic
Reason: `try` is a keyword.

cc @Kha
2020-11-17 08:25:01 -08:00
Leonardo de Moura
178b3e5b52 chore: remove workaround 2020-11-16 16:25:58 -08:00
Leonardo de Moura
28d6058f8a chore: update stage0 2020-11-16 15:47:18 -08:00
Leonardo de Moura
57670b633a feat: improve smart unfolding 2020-11-16 15:44:52 -08:00
Leonardo de Moura
b8bf8184c5 chore: update stage0 2020-11-15 17:36:42 -08:00
Leonardo de Moura
c81dbeb53c feat: improve smart unfolding 2020-11-15 17:34:37 -08:00
Leonardo de Moura
f1b88e1304 feat: add option for disabling smart unfolding and fix tests 2020-11-15 17:00:51 -08:00
Leonardo de Moura
bb06fbaa8a test: smart unfolding 2020-11-15 16:36:22 -08:00
Leonardo de Moura
717178392c chore: update stage0 2020-11-15 16:35:46 -08:00
Leonardo de Moura
461c0786fd feat: generate auxiliary declaration for "smart unfolding" 2020-11-15 16:31:40 -08:00
Leonardo de Moura
0ca7dabb2a chore: update stage0 2020-11-15 15:08:26 -08:00
Leonardo de Moura
f5ba036d8f chore: add support for reducing matchers 2020-11-15 15:07:53 -08:00