Commit graph

55 commits

Author SHA1 Message Date
Cameron Zwarich
bf1d253764
feat: add support for extern LCNF decls (#6429)
This PR adds support for extern LCNF decls, which is required for parity
with the existing code generator.
2024-12-20 21:20:56 +00:00
Markus Himmel
4bac74c4ac chore: switch to Std.HashMap and Std.HashSet almost everywhere 2024-08-07 18:24:42 +02:00
Henrik Böving
23e49eb519 perf: add prelude to all Lean modules 2024-02-18 14:55:17 -08:00
Leonardo de Moura
5654d8465d fix: fixes #1822 2022-11-13 18:13:29 -08:00
Leonardo de Moura
c147059fd7 fix: fixes #1812 2022-11-10 08:58:09 -08:00
Leonardo de Moura
b4d13a8946 refactor: LetExpr => LetValue
We use "let value" in many other places in the code base.
2022-11-07 18:51:07 -08:00
Leonardo de Moura
eaade5abde chore: port LambdaLifting.lean 2022-11-07 16:18:36 -08:00
Leonardo de Moura
e6232b67b6 chore: add helper functions 2022-11-07 16:18:36 -08:00
Leonardo de Moura
123aed11ca chore: port InlineCandidate.lean 2022-11-07 16:18:36 -08:00
Leonardo de Moura
6d46829599 chore: new LCNF representation
This is the first of a series of commits to change the LCNF representation.
2022-11-07 16:18:35 -08:00
Mario Carneiro
583e023314 chore: snake-case attributes (part 2) 2022-10-19 09:28:08 -07:00
Leonardo de Moura
53b995386d fix: avoid [anonymous] at LCNF binder names 2022-10-15 11:56:52 -07:00
Leonardo de Moura
3f076fc836 perf: missing annotations and helper instances 2022-10-14 08:42:50 -07:00
Leonardo de Moura
8fe4b75c48 feat: do not inline definitions occurring in instances at the base phase 2022-10-12 16:24:16 -07:00
Leonardo de Moura
aa845dee98 feat: cache lambda lifted functions 2022-10-11 21:28:03 -07:00
Leonardo de Moura
f61ec4929f chore: add low-level normExprCore 2022-10-09 12:10:11 -07:00
Leonardo de Moura
dc6f635f41 refactor: add LCNF/Internalize.lean 2022-10-03 09:18:11 -07:00
Leonardo de Moura
8cca2ea24e fix: refresh LCNF parameter binder names 2022-09-29 12:46:53 -07:00
Leonardo de Moura
fd5f3a5bad feat: track recursively inlining
closes #1657
see #1646

https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/inline.20codegen.20crash/near/301099703
2022-09-27 16:26:49 -07:00
Leonardo de Moura
35ca2b203c refactor: split Simp.lean 2022-09-26 07:04:20 -07:00
Mario Carneiro
85119ba9d1 chore: move Std.* data structures to Lean.* 2022-09-26 05:46:04 -07:00
Leonardo de Moura
ce12ecfe13 fix: free variable collision at LCNF/Specialize.lean 2022-09-24 18:51:32 -07:00
Leonardo de Moura
5969dc2694 feat: beta-reduce at LCNF normExpr 2022-09-24 18:26:34 -07:00
Leonardo de Moura
2be8cb93ac feat: store phase at CompilerM context 2022-09-23 16:30:51 -07:00
Leonardo de Moura
5db452cfe7 doc: add note at LCNF internalizer
We should also new tests that expose the problem.
2022-09-22 20:19:01 -07:00
Leonardo de Moura
990b031871 feat: add translator attribute to MonadFVarSubst class
See new comments.
2022-09-20 16:58:27 -07:00
Leonardo de Moura
4c19fdbb97 fix: normFVarImp bug 2022-09-19 21:41:18 -07:00
Leonardo de Moura
9dede6f632 feat: add mkSpecDecl 2022-09-17 17:30:57 -07:00
Leonardo de Moura
483234f30c refactor: rename Internalize.M 2022-09-17 16:46:44 -07:00
Leonardo de Moura
c1b7accd12 refactor: LCNF local context
The previous implementation had a few issues:
- Function (and join point) declarations were being inserted into two different hashmaps.
- `borrow` information was not available for parameters.
- No proper erase functions.
2022-09-14 19:25:16 -07:00
Leonardo de Moura
1350a57a03 refactor: remove pure field from LCNF.LetDecl
We decide that in phase 3 we will assume everything is impure, and
this kind of fine-grain tracking is not worth it.
2022-09-12 19:13:43 -07:00
Leonardo de Moura
613523e1f6 feat: store borrow flag at Param
It is more robust that using `Expr.mdata`, and we save the information at `toLCNF`.
2022-09-11 20:19:44 -07:00
Leonardo de Moura
e0197b4e09 feat: add bindCases
It is similar to `Code.bind` but has special support for `inlineMatcher`
2022-09-04 19:04:21 -07:00
Leonardo de Moura
bc88b0307e feat: cases on cases for new LCNF simplifier 2022-09-03 07:54:19 -07:00
Leonardo de Moura
30c75b4b88 feat: add simpCasesOnCtor 2022-09-01 20:52:08 -07:00
Leonardo de Moura
255d34d2ac feat: add simpValue? back 2022-09-01 20:52:08 -07:00
Leonardo de Moura
c201133d4d feat: LCNF local context dead variable checker
This commit also fixes a few local declaration leaks.
2022-08-31 21:07:21 -07:00
Leonardo de Moura
ddab48a154 fix: erase dead variables 2022-08-31 20:43:13 -07:00
Leonardo de Moura
ba0835e387 feat: refresh binder names during internalization 2022-08-31 18:10:32 -07:00
Leonardo de Moura
25447af13c feat: new code inliner 2022-08-31 18:10:32 -07:00
Leonardo de Moura
c451bf0c91 feat: add simpFunDecl 2022-08-30 11:45:05 -07:00
Leonardo de Moura
7b161d33d1 refactor: add MonadFVarSubst class 2022-08-29 09:52:16 -07:00
Leonardo de Moura
e80028b7d1 feat: add pure field to LetDecl, add helper functions for updating LCNF code
The update functions try to minimize the amount of memory allocation
2022-08-28 08:55:35 -07:00
Leonardo de Moura
d5fa178fc3 feat: modify FVarSubst used in the new code generator 2022-08-28 08:55:35 -07:00
Leonardo de Moura
cd0dd4cc2f feat: start simp for new LCNF format 2022-08-27 19:59:31 -07:00
Leonardo de Moura
9446ae3056 feat: add cleanup function for CompilerM 2022-08-27 18:35:30 -07:00
Leonardo de Moura
11c8253f6c feat: more update functions for LCNF 2022-08-27 10:41:54 -07:00
Leonardo de Moura
969dce70db perf: improve FVarSubst apply functions in the new compiler stack 2022-08-26 20:10:36 -07:00
Leonardo de Moura
65f9344f01 feat: check whether join points are fully applied at Check.lean 2022-08-25 18:17:54 -07:00
Leonardo de Moura
4c9c2d2bf7 feat: new CSE.lean 2022-08-25 18:08:22 -07:00