Commit graph

26011 commits

Author SHA1 Message Date
Leonardo de Moura
92b39e7161 chore(library/init): add findD variants
@cc @dselsam
2019-09-30 17:26:27 -07:00
Leonardo de Moura
18f461bb37 chore(stage0): update 2019-09-30 17:17:58 -07:00
Leonardo de Moura
261c0b9c24 feat(frontends/lean): add panic! macro
cc @dselsam
2019-09-30 17:16:19 -07:00
Leonardo de Moura
97419f5cc5 feat(library/init/util): add panicWithPos
It will be used by the macro `panic!`.

@kha @dselsam: I think the attribute `@[effectful]` is a bad name.
It is quite misleading. Any suggestions for a new name?
2019-09-30 17:06:07 -07:00
Leonardo de Moura
75bdc8712e feat(library/compiler): disable a few optimizations for declarations tagged with @[effectful]
@kha @dselsam:
The main motivation for this change are functions such as `panic`.
I marked `panic` with the attribute `@[effectful]`.
Here is the summary of the changes. If `f` is marked as `@[effectful]`
1- Compiler will not perform common subexpression elimination on terms of the form `f ...`.
2- Compiler will not extract closed terms of the form `f ...`.
3- Compiler will throw an error if `f` is partially applied.
2019-09-30 16:53:11 -07:00
Leonardo de Moura
3d7a7c7e91 feat(library/init/util): add panic primitive 2019-09-30 16:23:18 -07:00
Leonardo de Moura
282f531f54 chore(stage0): update 2019-09-30 16:14:11 -07:00
Leonardo de Moura
e451c4dc78 feat(library/init/lean/compiler): add @[effectful]
This attribute is used for low-level primitives like unsafeIO
2019-09-30 16:12:41 -07:00
Leonardo de Moura
2b252a441e feat(library/init/lean/declaration): add ConstantInfo.instantiateTypeUnivParams and ConstantInfo.instantiateValueUnivParams
cc @dselsam

See new test for an example.
2019-09-30 15:46:19 -07:00
Leonardo de Moura
864b9c730c feat(library/init/lean/expr): helper functions
cc @dselsam

Notes:
- x.isAppOrConst => x.isApp || x.isConst
- x.isPi => x.isForall
2019-09-30 15:16:40 -07:00
Leonardo de Moura
faebe15a7f feat(library/init/lean/expr): add efficient instantiate1
cc: @dselsam
2019-09-30 14:33:32 -07:00
Sebastian Ullrich
522cf13449 chore(tests/bench): update GHC and ocaml 2019-09-25 14:09:22 +02:00
Sebastian Ullrich
4b4f5c9832 test(tests/bench): further updates 2019-09-25 11:03:14 +02:00
Sebastian Ullrich
d3aa6488da chore(tests/bench): update cross suite 2019-09-24 22:42:25 +02:00
Leonardo de Moura
d6ea1d1a3f feat(frontends/lean/builtin_cmds): add #synth command 2019-09-24 11:32:43 +08:00
Leonardo de Moura
e9d16511c1 chore(stage0): update 2019-09-24 11:20:04 +08:00
Leonardo de Moura
28c905f684 chore(library/init/lean): add typeclass skelethon 2019-09-24 11:19:02 +08:00
Leonardo de Moura
345cc22f79 feat(frontends/lean/elaborator): do not create checkpoint at let x := v; 2019-09-21 10:27:30 -07:00
Leonardo de Moura
1ecb234a9f test(elabissues): document some of the known problems 2019-09-21 10:17:26 -07:00
Leonardo de Moura
097a127c69 feat(util/map_foreach): add phashmap_foreach, fix smap_foreach, update stage0 2019-09-20 14:22:03 -07:00
Leonardo de Moura
18e6a106f4 feat(library/init/lean/smap): implement SMap using PHashMap instead of RBMap 2019-09-20 14:22:03 -07:00
Sebastian Ullrich
ce558b6a9e doc(library/compiler/ir_interpreter): update docs 2019-09-20 10:46:33 +02:00
Leonardo de Moura
4db4b26de6 test(tests): use #eval and move tests 2019-09-19 14:38:52 -07:00
Leonardo de Moura
ac2871e15c chore(stage0): update 2019-09-19 10:48:37 -07:00
Leonardo de Moura
b147ebad67 chore(tests/lean/run/array1): remove #exit 2019-09-19 10:47:40 -07:00
Leonardo de Moura
0bd268fc96 fix(library/compiler/erase_irrelevant): add elim_array_cases 2019-09-19 10:47:05 -07:00
Leonardo de Moura
a4b860b92a fix(runtime): missing Array.data primitive 2019-09-19 10:27:10 -07:00
Leonardo de Moura
a7d616605a fix(runtime/lean): missing primitive 2019-09-19 09:54:03 -07:00
Sebastian Ullrich
f22c17e94b chore(library/init/data/string/basic): remove broken lineColumn obsoleted by FileMap 2019-09-19 18:12:51 +02:00
Sebastian Ullrich
8cb387e599 chore(tests/lean/extract): reactivate some #eval tests 2019-09-19 18:12:51 +02:00
Sebastian Ullrich
31c170117e feat(frontends/lean/builtin_cmds,library/compiler/ir_interpreter): reimplement #eval 2019-09-19 17:52:18 +02:00
Sebastian Ullrich
61819bee6d refactor(library/compiler/ir_interpreter): make box_t/unbox_t total 2019-09-19 17:51:51 +02:00
Sebastian Ullrich
62d1cdcff9 chore(library/init/data/repr): fix String.Iterator.HasRepr 2019-09-19 17:50:24 +02:00
Leonardo de Moura
2abca22e00 fix(kernel/instantiate): compilation problem on Windows 2019-09-18 18:41:59 -07:00
Leonardo de Moura
8148136aa9 fix(util/nat): nat::get_small_value must return size_t since unbox now returns size_t 2019-09-18 17:13:46 -07:00
Leonardo de Moura
02e4abb24a feat(library/init/lean/elaborator): convertForall skeleton 2019-09-17 17:17:46 -07:00
Leonardo de Moura
b36caf701a chore(library/print): minor improvements 2019-09-17 17:17:46 -07:00
Leonardo de Moura
06bb3a82d3 feat(library/init/lean/localcontext): add LocalContext.mkLambda and LocalContext.mkForall 2019-09-17 17:17:46 -07:00
Leonardo de Moura
eebc722f57 feat(library/init/lean/expr): add abstractRange 2019-09-17 17:17:46 -07:00
Leonardo de Moura
1d1ad8e2ed chore(library/init): auxiliary combinators 2019-09-17 17:17:46 -07:00
Leonardo de Moura
fdb1bf84b4 refactor(library/init/data/array/basic): cleanup names and types, add monadic versions 2019-09-17 17:17:46 -07:00
Sebastian Ullrich
a083cab532 fix(library/compiler/ir_interpreter): fix UB sequencing found by GCC 2019-09-17 09:51:24 +02:00
Leonardo de Moura
75e5f5bfd8 feat(library/init/lean/expr): expose abstract 2019-09-16 18:34:45 -07:00
Leonardo de Moura
6d7041fcb4 test(tests/playground/inst): add instantiate and instantiateRev simple tests 2019-09-16 18:30:35 -07:00
Leonardo de Moura
704f90d728 feat(library/init/lean/expr): expose instantiate and instantiateRev 2019-09-16 18:29:43 -07:00
Leonardo de Moura
51955bd945 chore(kernel/instantiate): remove obsolete optimization
I also tested its effectiveness in Lean3, and I did not observe any
performance impact when compiling stdlib without it.
2019-09-16 16:09:26 -07:00
Leonardo de Moura
2996d306c9 feat(library/init): add more general modify: modifyGet
This commit also adds a few helper elaboration functions.
2019-09-16 15:14:02 -07:00
Leonardo de Moura
06327238e6 fix(library/compiler/erase_irrelevant): assertion violation
cc @Kha
2019-09-16 07:21:19 -07:00
Leonardo de Moura
bd7ee8b01b feat(library/init/lean/elaborator/term): add elabList, and fix elabTermAux 2019-09-14 08:41:49 -07:00
Leonardo de Moura
306ff7d7e5 fix(library/compiler): fixes #34
`csimp` assumes constructors and `casesOn` applications match.  That
is, given `I.casesOn x ...`, then if `x` is an constructor, then it is
a constructor of the inductive datatype `I`.
The transformation `erase_irrelevant` was violating this property when
it mixes `Decidable` and `Bool`. We fix this issue by mapping
`Decidable.casesOn`, `Decidable.isTrue` and `Decidable.isFalse` to
`Bool.casesOn`, `Bool.true` and `Bool.false` respectively.
2019-09-13 10:20:50 -07:00