Commit graph

598 commits

Author SHA1 Message Date
Leonardo de Moura
2ddc797f65 feat(library/init/system/filepath): add dirName 2019-07-26 14:53:54 -07:00
Leonardo de Moura
ff88c35fc1 refactor(library/init): move io and platform to system subdir 2019-07-25 17:29:33 -07:00
Leonardo de Moura
f6d3fc881d feat(library/init): add platform.cpp 2019-07-25 17:19:50 -07:00
Leonardo de Moura
8b0730ef7d feat(library/init/data/list/basic): eraseDups 2019-07-22 18:12:03 -07:00
Leonardo de Moura
86d7904ea7 chore(library/init/data/nat/basic): avoid empty set of equations 2019-07-16 13:13:04 -07:00
Leonardo de Moura
ec49741ebc feat(library/init/data/option/basic): add HasBeq (Option a) instance 2019-07-16 07:50:10 -07:00
Leonardo de Moura
b2e1ff8b3e feat(library/init): use new "empty match" syntax 2019-07-15 16:25:14 -07:00
Rob Dockins
a9ebf23fab fix(libraray/init/data): generalize universe variables in array and persistent array operations
This change allows the monadic traversal operations on arrays to use monads that
are defined to raise universe levels.  This happens, for example, when defining
monads using certain continuation-passing idioms.
2019-07-11 17:52:04 -07:00
Leonardo de Moura
7c53be5df7 chore(library/init): remove remaining set notation 2019-07-11 10:31:25 -07:00
Leonardo de Moura
295cabed2e chore(library/init): remove unnecessary notations 2019-07-11 10:27:16 -07:00
Leonardo de Moura
1a81d60820 chore(frontends/lean/parser): simplify binder notation
The `<ident> : <expr>` now requires explicit brackets.
2019-07-08 08:54:19 -07:00
Leonardo de Moura
9d5b0fd309 feat(library/init/data/array/basic): add findRev 2019-07-05 15:51:25 -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
07cff06b6e chore(library): Π ==> 2019-07-02 17:35:15 -07:00
Leonardo de Moura
0bee94886e feat(frontends/lean/builtin_exprs): , from ==> from, and cleanup suffices 2019-07-02 17:22:50 -07:00
Leonardo de Moura
7ba9a5012a chore(frontends/lean/builtin_exprs): make sure have-expression is consistent with let-expression 2019-07-02 16:46:51 -07:00
Leonardo de Moura
a02443d23d chore(frontends/lean): fun x, e ==> fun x => e 2019-07-02 13:22:11 -07:00
Leonardo de Moura
e29bf35d15 chore(frontends/lean/builtin_exprs): remove hard coded (::) notation 2019-07-02 11:01:05 -07:00
Leonardo de Moura
39221adcd6 chore(frontends/lean/builtin_exprs): remove assume notation 2019-07-02 10:40:07 -07:00
Leonardo de Moura
300414e6e4 chore(frontends/lean): change explicit universe parameter notation in declarations 2019-07-02 08:57:08 -07:00
Leonardo de Moura
6841e47aa4 chore(frontends/lean/builtin_exprs): remove support for (<infix>) and (<infix> <expr>) notations
In Lean 4, we will support the more general

`a + ·` ==> `fun x, a + x`
`· + b` ==> `fun x, x + b`
`· + ·` ==> `fun x y, x + y`
`f · y` ==> `fun x, f a y`
`g · · b` ==> `fun x y, g x y b`
2019-07-02 08:06:06 -07:00
Leonardo de Moura
91e1d30cf8 feat(frontends/lean/builtin_exprs): use ; in do-notation 2019-06-27 18:00:43 -07:00
Leonardo de Moura
ab487ea4ac feat(frontends/lean): allow ; instead of in in let-decls 2019-06-27 17:12:03 -07:00
Leonardo de Moura
315851c4e4 chore(library/init/data): style 2019-06-27 16:45:27 -07:00
Leonardo de Moura
e00dc873a8 chore(library/pattern_attribute): [pattern] ==> [matchPattern] 2019-06-26 11:26:49 -07:00
Leonardo de Moura
af2d6dbd45 chore(library/init): avoid local attribute 2019-06-24 15:48:11 -07:00
Leonardo de Moura
94bca2b9d8 chore(library/init): mimize use of notations 2019-06-24 15:48:11 -07:00
Leonardo de Moura
dda0e38802 chore(library/init): avoid local notation 2019-06-24 15:48:11 -07:00
Leonardo de Moura
9e73d92e42 chore(library/init): remove instances of scoped notation 2019-06-20 14:08:35 -07:00
Leonardo de Moura
1e30f76511 chore(frontends/lean/pp): remove ppAsAnonymousCtor attribute 2019-06-20 11:03:20 -07:00
Leonardo de Moura
1658be20f1 feat(library/init/data/string): add String.isPrefixOf 2019-06-06 14:20:50 -07:00
Leonardo de Moura
67a4ebbde6 feat(library/init/lean/attributes): low level attribute registration, and frontend attribute actions
Remark: the attribute actions used by the frontend are all in IO.
These actions access attributes by name, and need access to the IO.ref
that contains all registered attributes in the system.
2019-06-05 09:15:35 -07:00
Leonardo de Moura
83e4c63d27 feat(library/init/data/persistentarray/basic): add PersistentArray.modify 2019-06-04 10:40:46 -07:00
Leonardo de Moura
30a6a2ade8 feat(library/init/data, runtime): remove parray support from runtime, and implement them in Lean using Scala/Clojure Radix trees
The Scala/Clojure approach for persistent arrays works great with our
`reset/reuse`. We seem to be much more efficient than their
implementations because of `reset/reuse`. The new approach also seems
better than the old one implemented in the runtime, and has a few
advantages:
1- The reroot procedure used in the old approach required
synchronization for multi-threaded code, or we would need to perform
deep copies when sending `parray` objects between threads.
2- We don't need any runtime extension for the new approach.
3- The old approach used "trail lists" for undoing array updates.
This works well for bactracking search use cases, but it is bad
in use cases where we are simultaneously updating the persistent
arrays that have shared nodes.
2019-06-02 09:18:19 -07:00
Leonardo de Moura
3251f1c75b feat(library/init/data/uint): add shift_left and shift_right 2019-06-01 10:57:08 -07:00
Leonardo de Moura
d2d2c32c81 feat(library/init/data/nat/bitwise): use lean::nat_land and lean::nat_lor 2019-05-31 21:55:57 -07:00
Leonardo de Moura
0f43c2e2d9 feat(library/init/data/array/basic): efficient heterogeneous Array.map
This commit also removes Array.hmap.
Motivation: I wanted to use Array.hmap as an example in the paper, but
I found it would be too distracting to explain why we had `Array.hmap`
and `Array.map`.

cc @kha
2019-05-25 16:32:59 -07:00
Leonardo de Moura
ef89945ea0 fix(library/init/lean/compiler/ir/emitcpp): tail call
Implement fix used at 4d2837430a in the new IR compiler.
2019-05-22 07:58:33 -07:00
Leonardo de Moura
40ecbb7cbc feat(library/init/control/monad): mark monadInhabited as an instance 2019-05-20 09:33:17 -07:00
Leonardo de Moura
83692eef6d feat(library/init/lean/compiler/ir): explicit RC 2019-05-19 16:46:51 -07:00
Leonardo de Moura
70dce4b775 feat(library/init/lean/environment): show rbmap depth and hashmap bucket size 2019-05-15 11:01:25 -07:00
Leonardo de Moura
3193e91aff feat(library/init/lean/environment): add Environment.displayStats and --stats command line argument 2019-05-15 11:01:25 -07:00
Leonardo de Moura
8ab15536a7 perf(library/init/data/array/binsearch): add binSearchContains 2019-05-14 20:52:57 -07:00
Leonardo de Moura
dc71fafac1 feat(library/init/data/array): add Array.binSearch 2019-05-14 18:25:54 -07:00
Leonardo de Moura
2e4f5951e3 feat(library/init/data/array/qsort): simple quicksort
@kha I added `qsort` for sorting environment extension entries, but I am
wondering if we could use it as a benchmark in our paper. It is a pure implementation; it is
fast; it implements the real quick sort algorithm with in-place updates if the
input array is not shared. If the array is shared it performs
a single copy and then switches to in-place updates.
2019-05-14 17:46:34 -07:00
Leonardo de Moura
f5725abb57 refactor(library/init/lean/environment): cleanup and improve 2019-05-10 15:54:29 -07:00
Leonardo de Moura
251890b490 feat(library/init/control/combinators): add Nat.mfold and rename Nat.for => Nat.fold 2019-05-10 10:47:57 -07:00
Leonardo de Moura
18aa7de408 feat(library/init/data): add ByteArray 2019-05-08 16:43:00 -07:00
Leonardo de Moura
b717177a1a chore(library/init/data/array/basic): make sure Array.*foldl and List.*foldl have similar signatures 2019-05-07 15:23:03 -07:00
Leonardo de Moura
4e5121fb5b chore(library/init/data/array/basic): more general miterate2 mfold2 iterate2 fold2 2019-05-07 15:06:11 -07:00