lean4-htt/src/library/constructions
Leonardo de Moura 85092412c7 refactor: remove Expr.FVar hack
@Kha @dselsam:
This hack was preventing us from making `Expr` a "real" Lean type.
This was bad for a few reasons:
- It was hard to extend/modify `Expr` in Lean since we would also have
to modify the C++ code that creates the `Expr` objects with the hidden
fields.
- `Expr.lam` and `Expr.forallE` were not following the Lean layout
standard where we sort fields by size. @Kha: recall we used that to
avoid a UB. The issue with `Expr.lam` and `Expr.forallE` is that they
have a "visible" field (`BinderInfo`), which is smaller than
hidden fields such as hash code.
- `Expr.fvar` had only one field at `Expr.lean,` but four behind the
scenes.

I added a new constructor `Local` that is only accessible from C++.
It is only used in legacy code we inherited from Lean2.
We will eventually delete it.

This refactoring was quite painful since many parts of the codebase
were mixing the new `Expr.fvar` with the old `Expr.local`.
I doubt I would be able to do it without the new staging framework
@Kha built.

BTW, some of the patches are horrible. I didn't care much since we
are going to deleted the super ugly files. That being said,
you should expect new weird bevaior due to `Expr.fvar` vs `Expr.local`.

Next step: use the new `ExprCachedData` to make all `Expr` hidden visibles
accessible from Lean.

checkpoint
2019-11-15 14:04:26 -08:00
..
brec_on.cpp refactor: remove Expr.FVar hack 2019-11-15 14:04:26 -08:00
brec_on.h feat(library/constructions/brec_on): add brec_on and binduction_on for new inductive datatype module 2018-09-05 14:46:03 -07:00
cases_on.cpp chore(library/module): module::add for declarations is not needed anymore 2019-05-14 11:23:35 -07:00
cases_on.h feat(*): use new inductive datatype module 2018-09-06 18:09:22 -07:00
CMakeLists.txt chore(library/constructions): remove constructor (dead code) 2018-09-03 17:41:19 -07:00
init_module.cpp chore(library/constructions): remove injective 2018-09-03 17:38:13 -07:00
init_module.h
no_confusion.cpp chore(library/module): module::add for declarations is not needed anymore 2019-05-14 11:23:35 -07:00
no_confusion.h feat(*): use new inductive datatype module 2018-09-06 18:09:22 -07:00
projection.cpp chore(library/module): module::add for declarations is not needed anymore 2019-05-14 11:23:35 -07:00
projection.h feat(frontends/lean/structure_cmd): allow implicitness infer annotation and parameters in field declaration 2018-02-28 12:49:22 +01:00
rec_on.cpp chore(library/module): module::add for declarations is not needed anymore 2019-05-14 11:23:35 -07:00
rec_on.h feat(*): use new inductive datatype module 2018-09-06 18:09:22 -07:00
util.cpp feat: use kernel projections in constructions 2019-11-04 03:38:57 -08:00
util.h chore(kernel): move abstract_type_context to library 2018-09-08 08:29:51 -07:00