Leonardo de Moura
b0641ba770
feat(frontends/lean/elaborator): add support for definitions such as monad_run.run
...
cc @Kha
2018-05-08 17:14:52 -07:00
Leonardo de Moura
b77cd740a8
test(tests/lean/run/display_hw_term_hack_deps): add helper function for displaying functions that use wf_term_hack
2018-05-08 16:28:42 -07:00
Leonardo de Moura
ab39ef261d
refactor(library/init/lean/ir/ssa_check): use format instead of blockid_error
2018-05-08 15:47:02 -07:00
Leonardo de Moura
60a275a464
chore(library/init/lean/ir/elim_phi): use idiom: define run for every monad
2018-05-08 15:46:30 -07:00
Leonardo de Moura
7f85f0893c
refactor(library/init/lean/ir): cleanup
2018-05-08 15:38:43 -07:00
Leonardo de Moura
4f75e49da8
feat(library/init/control/except): add monad_except _ except instance
2018-05-08 15:38:20 -07:00
Leonardo de Moura
00147df082
chore(library/init/lean/ir/ssa_check): use format for error messages
2018-05-08 14:50:58 -07:00
Leonardo de Moura
9373133800
chore(library/init/lean/ir/type_check): cleanup
2018-05-08 14:50:28 -07:00
Sebastian Ullrich
4ed7b57903
test(tests/lean/run/ext_eff): add IO exception handling example
2018-05-08 17:29:12 +02:00
Leonardo de Moura
50f883a946
chore(tests/lean/parser1): fix test
2018-05-07 18:11:41 -07:00
Leonardo de Moura
e40f37b08e
feat(library/init/lean/ir): add type checker
2018-05-07 18:07:04 -07:00
Leonardo de Moura
d85c30fde1
perf(library/init/data): mark usize, uint16, uint32 and uint64 as [irreducible]
...
Without these annotations, Lean will timeout when trying to synthesize
the type class instance `decidable_eq uint32`. The type class resolution
problem will produce the unification problem:
```
decidable (@eq uint32 a b) =?= decidable (@eq usize ?x ?y)
```
which Lean tries to solve by assigning `?x := a`.
During the assignment, the types of `?x` and `a` are unified with "full
force". Thus, we get the constraint
```
usize_sz =?= uint32_sz
```
which will take forever to be solved when peforming the computation in
unary arithmetic.
Remark: this commit also makes sure that `type_context` will not unfold
irreducible definitions when trying to unify/match the types.
The new test `type_class_performance1.lean` exposes the problem fixed
by this commit.
2018-05-07 18:07:04 -07:00
Leonardo de Moura
f7c4134452
refactor(library/init/lean/ir): we can use the cast instruction for boxing/unboxing
2018-05-07 18:07:04 -07:00
Leonardo de Moura
5b89f69e36
chore(library/init/data/dlist): add @[inline]
2018-05-07 18:07:04 -07:00
Leonardo de Moura
79f351d177
fix(library/init/lean/ir): parser and test
2018-05-07 18:07:04 -07:00
Leonardo de Moura
0a9bd8caa8
chore(library/init/lean/ir): improve sizet syntax
2018-05-07 18:07:04 -07:00
Leonardo de Moura
e6b509781f
feat(library/init/lean/ir/ir): platform independent object size and offset
2018-05-07 18:07:04 -07:00
Sebastian Ullrich
91e3e2435a
test(tests/lean/run/ext_eff): document quadratic run time issue and implement solution from paper
...
~3x slowdown on right-associated binds
2018-05-07 23:58:17 +02:00
Leonardo de Moura
883f6923e2
chore(library/init/lean/ir/elim_phi): fix typo
2018-05-06 10:15:17 -07:00
Leonardo de Moura
88082cd16d
fix(library/init/lean/ir/parser): case
2018-05-06 10:11:58 -07:00
Leonardo de Moura
e2e124626f
feat(library/init/lean/ir): add elim_phi function
2018-05-06 10:07:44 -07:00
Leonardo de Moura
89b4bb7210
feat(library/init/data/hashable): add hashable nat instance
2018-05-06 07:53:29 -07:00
Leonardo de Moura
3079d2d007
feat(library/init/lean/name): add hashable instance
2018-05-06 07:49:17 -07:00
Leonardo de Moura
162f817fa3
feat(library/init/data/hashable): add builtin string hash
2018-05-06 07:28:05 -07:00
Leonardo de Moura
e64cb10ded
feat(library/init): add hashable type class
2018-05-05 20:48:57 -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
752e0a134e
chore(library/init/data/nat/basic): cleanup
2018-05-04 11:30:06 -07:00
Sebastian Ullrich
7da6d5c50d
test(tests/lean/run/ext_eff): add extensible effects monad example
2018-05-04 19:44:33 +02:00
Leonardo de Moura
11a8a7c4f3
feat(library/init): use usize instead of uint32 in the low level array access primitives
2018-05-04 10:40:14 -07:00
Leonardo de Moura
af4f831a9f
feat(library/init/data/hashmap): hash function produces an uint32 instead of nat
...
Most efficient hash functions use uint32/uint64 and produce values
that do not fit in out small nat representation. Thus, GMP big numbers
would have to be created.
2018-05-03 17:56:10 -07:00
Leonardo de Moura
7aeae54522
chore(tests/lean/trust0/basic): fix test
2018-05-03 15:57:59 -07:00
Leonardo de Moura
ff7e691d66
feat(library/vm): add support for system.platform.nbits in the VM
2018-05-03 15:54:54 -07:00
Leonardo de Moura
acade175b6
feat(library/init/data/array): store dimension in the array
...
The array dimension is now stored inside the array.
The main motivation is that it reflects the actual runtime implementation.
We need to store the array size to be able to GC it.
So, it feels silly to have the array size stored in each array object,
but we cannot use this information.
For example, in the `hashmap` we implemented the bucket array using
`array`, and we store the `size` of the array.
Same for the Lean3 `buffer` object.
The `buffer` object doesn't even need to exist.
The actual `array` implementation is the `buffer`
2018-05-03 15:43:03 -07:00
Leonardo de Moura
668d198991
feat(library/init/data/usize): add usize
2018-05-03 15:43:00 -07:00
Leonardo de Moura
732d638bb8
chore(library/init/data/array/lemmas): remove array theorems
2018-05-03 15:38:42 -07:00
Leonardo de Moura
9aa459c7e1
feat(library/init/data/nat/basic): add auxiliary power theorems
2018-05-03 11:23:59 -07:00
Leonardo de Moura
c135d0ae61
chore(library/init/data/uint): cleanup
2018-05-03 10:42:50 -07:00
Leonardo de Moura
dde79a8783
fix(library/vm/vm_io): compilation warning
2018-05-03 10:30:39 -07:00
Sebastian Ullrich
bd7109dc02
chore(library/init/core): cleanup matches
2018-05-03 10:35:39 +02:00
Sebastian Ullrich
16190610dc
feat(frontends/lean/match_expr): make end after match optional, remove eventually
2018-05-03 10:35:39 +02:00
Leonardo de Moura
82bf618972
feat(library/init/lean/disjoint_set): disjoint sets
...
We need this datastructure to eliminate phi nodes from the IR.
The phi nodes need to be eliminated when mapping to C++ and/or
interpreting the IR.
2018-05-02 22:24:33 -07:00
Leonardo de Moura
d9101cb950
chore(tests/lean/parser1): fix test
2018-05-02 17:37:55 -07:00
Leonardo de Moura
48ba4370d5
feat(library/system/io): implement io using string instead of char_buffer
2018-05-02 17:31:51 -07:00
Leonardo de Moura
bf71068b14
feat(library/init/lean/ir): parse IR definitions
2018-05-02 16:59:50 -07:00
Leonardo de Moura
0d49ae3f69
feat(library/init/lean/parser): add not_followed_by and not_followed_by_sat
...
The new parsers are useful to implement the longest match rule.
2018-05-02 15:55:57 -07:00
Leonardo de Moura
beae2d936b
chore(library/init/lean/ir/parser): remove leftover
2018-05-02 12:44:23 -07:00
Leonardo de Moura
f44bfb3e59
feat(library/init/lean/parser/parser): use dlist to implement expected messages
...
The idiom `p1 <|> p2 <|> ... <|> pn` generates many append operations.
`dlist` provides an O(1) append.
2018-05-02 12:43:21 -07:00
Leonardo de Moura
f2df67053f
feat(library/init/data/dlist): add dlist back without tactic framework dependency
2018-05-02 12:36:31 -07:00
Leonardo de Moura
4d6cbf62a2
refactor(library/init/lean/parser/parser): we don't need to store the whole message in ok_eps
...
In the original parsec paper, they store messages in OK silent/epsilon
results too. This is not necessary, we only need the "expected" field
for the `ok_eps` constructor.
2018-05-02 11:37:57 -07:00
Leonardo de Moura
6e2ebb5fab
feat(library/init/lean/ir): add IR instruction parser
2018-05-01 17:45:50 -07:00