Commit graph

13774 commits

Author SHA1 Message Date
Sebastian Ullrich
76843717c4 chore(frontends/lean/elaborator): style 2018-02-28 12:49:22 +01:00
Sebastian Ullrich
61b6e26671 fix(init/meta/tactic): make tactic.funext work on non-abstractions 2018-02-28 12:49:22 +01:00
Sebastian Ullrich
1abf8738fc feat(frontends/lean/structure_cmd): allow implicitness infer annotation and parameters in field declaration 2018-02-28 12:49:22 +01:00
Sebastian Ullrich
f3ca420b64 feat(frontends/lean/elaborator): hide opt/auto param types when elaborating structure field values 2018-02-28 12:49:22 +01:00
Sebastian Ullrich
cf8dd9e75e feat(fronteds/lean/builtin_exprs): do notation: use overloadable bind instead of has_bind.bind 2018-02-28 12:49:22 +01:00
Leonardo de Moura
b72d465835 refactor(library/init/meta): remove tactic_state.mk_empty
The tactic_state object will contain a name_generator for creating fresh
names. `tactic_state.mk_empty` is bad because it does not have sufficient
information to create this name_generator.
Moreover `tactic_state.mk_empty` was only being used to convert
`tactic A` into a `parser A`.
We implement this primitive now in C++. In C++, we will be able
to use the parser name generator to initialize a fresh `tactic_state`.
2018-02-27 14:45:47 -08:00
Leonardo de Moura
902445c56f chore(frontends/lean): remove parser_state object
This is dead code. We have decided to implement the new parser in Lean.
2018-02-27 14:05:02 -08:00
Leonardo de Moura
221931492e feat(library/name_generator): add nest_with 2018-02-27 13:17:58 -08:00
Leonardo de Moura
3895fd8511 chore(library): use type_context to update metavar_context 2018-02-27 12:23:26 -08:00
Leonardo de Moura
69335ce540 chore(.travis.yml): add travis_wait
`ctest` is timing out in debug mode.
The `travis_wait` command extends the threshold to 20mins.
https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
2018-02-27 11:30:45 -08:00
Sebastian Ullrich
5279f92dae fix(library/tactic/simp_lemmas): avoid rewrite failure with more robust code
The old code assumed `emetas` to be descendingly ordered by tmp idx, which is
not true for rfl lemmas.
2018-02-27 10:59:51 -08:00
Nuno Lopes
0eebde1b8b fix(process): fix inherited io on windows (handles were being incorrectly closed)
This also unifies the win/linux versions a bit more
2018-02-27 10:55:42 -08:00
Nuno Lopes
ce66af8f5b fix(process): order of parameters of process class was wrong 2018-02-27 10:55:42 -08:00
Nuno Lopes
9e42e434b5 chore(io): remove a few unneeded ref count bumps 2018-02-27 10:55:38 -08:00
Nuno Lopes
f6a5c26a1f fix(io.cmd): close stdout pipe 2018-02-27 10:43:09 -08:00
Nuno Lopes
ea6a4be124 chore(library): match stdio enum with Lean values 2018-02-27 10:43:09 -08:00
Nuno Lopes
c67062644a fix(io_proc): fix crash on Windows/VS when invoking external processes
This commit also removes a couple of unused functions
2018-02-27 10:43:09 -08:00
Leonardo de Moura
ec141d1671 chore(library/tactic/change_tactic): use type_context instead of metavar_context 2018-02-27 10:41:11 -08:00
Leonardo de Moura
6bf20a980d doc(library/tactic/tactic_state): plan for getting rid of remaining occurrences of mk_fresh_name and mk_tagged_fresh_name 2018-02-27 10:34:55 -08:00
Leonardo de Moura
a962efdcd1 fix(library/tactic/cases_tactic): fixes #1836 2018-02-26 15:32:03 -08:00
Leonardo de Moura
421f2c2ae2 fix(library/tactic/subst_tactic): subst was creating type incorrect motive when using dependent elimination
This commit fix a bug reported at comment
https://github.com/leanprover/lean/issues/1827#issuecomment-368258713

Remark: the original problem reported at issue #1827 has nothing to do
with this bug.
2018-02-26 14:02:10 -08:00
Leonardo de Moura
e53ef3c335 fix(library/type_context): remove unsafe type_context::operator=(type_context &&)
This commit also implements a custom `type_context(type_context &&)`
constructor that enforces correct usage.
2018-02-26 12:28:22 -08:00
Leonardo de Moura
c0267727a8 fix(library/init/meta): mk_fresh_name should not be used to create user facing names
The tactic `mk_fresh_name` is used to create internal unique ids.
We should not use them to create (temporary) user facing
names. Reasons:
1- They are "cryptic".
2- They are not very stable. Minor changes in Lean may change the
value returned and may break proofs that rely on these fresh names.
2018-02-26 10:49:53 -08:00
Leonardo de Moura
44e096f740 fix(util/fresh_name): missing case 2018-02-26 10:19:52 -08:00
Leonardo de Moura
5692baaaf8 chore(library/metavar_context): remove m_ngen field
It was a bad idea to try to store the name_generator here.
We copy/restore metavar_context objects in a few places.
These operations would trigger the regeneration of previously generated
fresh names, and would violate the assumptions made at persistent_context_cache.

We should have a name_generator at type_context instead.
2018-02-23 17:43:48 -08:00
Leonardo de Moura
b9a131d5c2 chore(tests/lean/revert_frozen_dep): fix test 2018-02-23 12:43:06 -08:00
Leonardo de Moura
21812768b0 fix(library/init/meta/interactive): fixes #1889 2018-02-23 12:39:11 -08:00
Leonardo de Moura
7954b56cd8 fix(library/tactic/revert_tactic): missing catch 2018-02-23 12:26:18 -08:00
Leonardo de Moura
6c3d90e20e fix(library/type_context): type_context was not checking if to_revert dependencies were frozen 2018-02-23 11:59:18 -08:00
Leonardo de Moura
24e7a5a339 feat(library/tactic): add frozen_local_instances tactic for retrieving list of frozen local instances 2018-02-23 11:39:38 -08:00
Leonardo de Moura
db4fcac40c feat(library): add tactic unfreeze_local_instances 2018-02-23 11:12:05 -08:00
Leonardo de Moura
f376c48c7f fix(library/type_context): throw exception if trying to revert frozen local instance 2018-02-23 11:11:16 -08:00
Leonardo de Moura
2cb018734e chore(library/metavar_context): add TODO's 2018-02-23 10:35:21 -08:00
Leonardo de Moura
173eb1c6b7 refactor(util/fresh_name): implement fresh_name using unique thread id
@kha This commit is retracting the experiment using
`mk_fresh_name_generator_child` when creating new tasks.
The names get too long.

I'm still refactoring the code and trying to eliminate all occurrences
of `mk_fresh_name`. I still have a long way to go, but I am merging
this branch into master since it has many other fixes.
2018-02-23 10:35:04 -08:00
Leonardo de Moura
eb648a3298 feat(library/metavar_context): add name_generator field.
This is work-in-progress. The change exposed many problems in the
metavar_context propagation.
2018-02-23 10:34:00 -08:00
Leonardo de Moura
993770e14a feat(library/persistent_context_cache): use abstract_context_cache 2018-02-21 16:20:42 -08:00
Leonardo de Moura
6bb592caf0 perf(util/name): avoid unnecessary memory allocations 2018-02-21 16:04:53 -08:00
Leonardo de Moura
5607884787 feat(library/tactic): use new cache
Remark: so far, caching, in the tactic framework, only makes a difference for the `simp` tactic.
This is not surprising since the simplifier tries to apply rewriting
lemmas over and over again.
2018-02-21 15:04:20 -08:00
Leonardo de Moura
80b88c53cb fix(library/persistent_context_cache): missing reset 2018-02-21 15:04:20 -08:00
Leonardo de Moura
4a936f004b feat(library/tactic): use new cache in the apply and simp tactics 2018-02-21 15:04:20 -08:00
Leonardo de Moura
11a05ae4c5 feat(library/tactic): add tactic_state_context_cache helper class
This commit also renames `token` ==> `unique_id`.
We already use `token` in the scanner.
2018-02-21 15:04:20 -08:00
Leonardo de Moura
2ff301babd chore(library/persistent_context_cache): style 2018-02-21 15:04:20 -08:00
Leonardo de Moura
028bd8c6c6 fix(library/type_context): performance bug 2018-02-21 15:04:20 -08:00
Leonardo de Moura
d581fb10a8 chore(library/abstract_context_cache): missing override annotations 2018-02-21 15:04:20 -08:00
Leonardo de Moura
20db4edf27 feat(library): add persistent_context_cache 2018-02-21 15:04:20 -08:00
Leonardo de Moura
1aeaed0cae feat(library/abstract_context_cache): make it fully abstract 2018-02-21 15:04:20 -08:00
Leonardo de Moura
70b6e5c958 feat(library): unique token generator 2018-02-21 15:04:20 -08:00
Leonardo de Moura
8a93d2770e feat(library/equations_compiler): add new cache support to equation compiler 2018-02-21 15:04:20 -08:00
Leonardo de Moura
ada4932507 feat(library/compiler): add new cache support to compiler 2018-02-21 15:04:20 -08:00
Leonardo de Moura
9d9ac16e7a feat(library): add implementation of abstract_context_cache 2018-02-21 15:04:20 -08:00