lean4-htt/library/init/lean
Leonardo de Moura 0b7d987699 feat(frontends/lean, library/init/lean): opaque constants
@kha I have added support for opaque constants to the old C++ frontend,
and made sure the new frontend can still parse `library/init/core.lean`.
The kernel should enforce that opaque constants are really opaque, and
the following example should fail
```
constant x : nat := 0
theorem foo : x = 0 := rfl
```
If it doesn't, it is a bug.

Here are some remaining issues:
1- `environment.mk_empty` is currently an axiom because we cannot create
an inhabitant of an opaque type. A possible solution is to use
`option environment` instead of `environment`.

2- There is no support for opaque constants in the new
frontend. However, I modified it to handle axioms, and fixed the literal
values with decl_cmd_kind. I tried to mark some of my changes with
comments, but it is probably much easier for you to just check the
commit change list.

3- I did not add any support for automatically constructing `e`
at `constant x : t := e`. I think we can do this later
after we replace the old frontend with the new one. BTW, it took only a
few minutes to provide the inhabitants manually.
2019-03-15 17:41:44 -07:00
..
compiler feat(library/init, frontends/lean): add abbreviation for abbreviation 2019-03-15 16:01:25 -07:00
parser feat(frontends/lean, library/init/lean): opaque constants 2019-03-15 17:41:44 -07:00
config.lean feat(library/init/lean): add lean.closure_max_args 2018-05-13 08:40:46 -07:00
declaration.lean feat(library/init, frontends/lean): add abbreviation for abbreviation 2019-03-15 16:01:25 -07:00
default.lean fix(library/init/lean/default): missing file 2019-02-14 15:21:53 -08:00
disjoint_set.lean feat(library/init/lean/ir): add elim_phi function 2018-05-06 10:07:44 -07:00
elaborator.lean feat(frontends/lean, library/init/lean): opaque constants 2019-03-15 17:41:44 -07:00
expander.lean feat(frontends/lean, library/init/lean): opaque constants 2019-03-15 17:41:44 -07:00
expr.lean feat(library/init/lean/compiler): fold nat predicates 2019-02-15 16:17:16 -08:00
extern.lean feat(library/init/lean/extern): remove restriction from expand_extern_pattern 2019-03-10 11:42:39 -07:00
format.lean refactor(frontends/lean/elaborator): mark thunk as opaque, and thunk A to A is now a coercion 2018-08-21 15:27:51 -07:00
frontend.lean chore(library/init/lean/frontend): revert 4333ab620 2019-03-08 12:06:49 -08:00
kvmap.lean feat(library/init/lean/kvmap): add == for kvmap 2019-03-07 14:12:10 -08:00
level.lean feat(library/init/lean/compiler): fold nat predicates 2019-02-15 16:17:16 -08:00
message.lean refactor(library/init/lean): remove duplicate position type, rename pos to position 2018-12-20 15:32:46 +01:00
name.lean feat(library/init/lean/compiler/ir): collect fnbody free variables 2019-03-07 15:37:45 -08:00
name_mangling.lean feat(library/init/data/char): use uint32 instead of nat for defining char 2019-02-15 18:07:55 -08:00
options.lean feat(library/init/lean): add kvmap 2018-06-15 16:05:11 -07:00
position.lean perf(library/init/lean/position): add file_map cache for position conversion 2018-12-20 15:32:46 +01:00
trace.lean chore(*): meta ==> unsafe 2019-03-15 15:04:40 -07:00
util.lean feat(frontends/lean, library/init/lean): opaque constants 2019-03-15 17:41:44 -07:00