Sebastian Ullrich
9db688f4c2
fix(library/{vm/vm_io,init/io}): fix bugs and tests
2018-08-21 08:43:09 -07:00
Sebastian Ullrich
a260bf91d4
refactor(library/vm/vm_io,library/system/io): remove io classes, make errors explicit
2018-08-21 08:43:09 -07:00
Leonardo de Moura
bc57c66ae3
refactor(kernel/level): naming consistency
2018-06-22 10:29:56 -07:00
Leonardo de Moura
ede1a51d60
refactor(kernel/declaration): remove self_opt flag from reducibility hints
...
This flag was used by the kernel to decide whether the following
heuristic should be used to avoid unfolding `f` at `is_def_eq`.
f a =?= f b
-----------
a =?= b
This heuristic was introduced at Lean1 after a discussion with
Georges Gontier. Since this discussion, we added support for
caching failures of this heuristic. This proved to be much more
effective to attack the performance problems.
Moreover, we do not even use this flag in the `type_context::is_def_eq`
used during elaboration.
The current codebase contains only one place where this flag was set to
`false`: coercions generated at structure_cmd. This change was
made at commit
1c70514231
in the Lean2 codebase when we were not caching failures and
the kernel type checker was also used during elaboration.
2018-06-22 09:02:50 -07:00
Leonardo de Moura
c5714c2fac
chore(kernel): remove expr.macro constructor
...
We are now ready to implement `expr` using `runtime/object`.
2018-06-19 17:54:43 -07:00
Leonardo de Moura
62788a9ca3
refactor(kernel): fix terminology: "free_var" is actually a loose bound variable
...
We represent free variables uisng local constants.
We will fix this terminology too.
2018-06-08 13:25:36 -07:00
Leonardo de Moura
e90585737f
refactor(*): use C++11 std::current_exception and std::rethrow_exception
...
With these new C++11 APIs, we can delete the `clone` and `rethrow`
methods from our exception classes.
2018-06-07 16:28:54 -07:00
Leonardo de Moura
c0e1d05199
chore(kernel): type_checker ==> old_type_checker
2018-06-06 16:10:40 -07:00
Leonardo de Moura
e4a168af91
chore(library/init/meta): remove goal tagging feature
2018-06-06 08:46:47 -07:00
Leonardo de Moura
3c1ccc9b74
refactor(kernel): use m_meta instead of m_trusted
2018-05-31 11:18:00 -07:00
Leonardo de Moura
75c63ec921
refactor(*): list<name> ==> obj_list<name>
2018-05-23 15:48:43 -07:00
Leonardo de Moura
2e66449feb
fix(library/tactic/tactic_state): build
2018-03-08 09:58:07 -08:00
Leonardo de Moura
169cd87dbe
feat(library/system/io): add io.run_tactic
...
@nunoplopes @aqjune
I had to add a new primitive to allow you to execute a tactic from the
`main` function. The `main` function is in the `io` monad. The new
primitive has type:
```
meta constant io.run_tactic {α : Type} (a : tactic α) : io α
```
I also added a new test that shows how to use it.
The test displays all declarations that have the `nat` prefix.
cc @kha
2018-03-07 12:15:26 -08:00
Leonardo de Moura
bdea7d420d
chore(*): type_context ==> type_context_old
2018-03-05 12:38:24 -08:00
Sebastian Ullrich
48147646bc
refactor(library): mk_result/get_result_* ~> mk_success/get_success_*
2018-03-01 14:56:01 +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
3895fd8511
chore(library): use type_context to update metavar_context
2018-02-27 12:23:26 -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
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
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
7762dc381a
feat(library/type_context): use context_cache interface
2018-02-21 15:04:20 -08:00
Leonardo de Moura
78d8ff8031
feat(*): add reset_thread_local
2018-02-21 15:04:19 -08:00
Nuno Lopes
7b45d28e77
chore(unicode): use utf8 chars directly in strings
2018-02-13 10:42:08 -08:00
Nuno Lopes
977e11f9be
fix(warnings): fix warnings on VS. its now /W2 clean
2018-02-13 10:42:08 -08:00
Leonardo de Moura
ec1a490a15
chore(*): annotate candidates for thread local cache reset
2018-02-01 14:59:37 -08:00
Leonardo de Moura
1c61129d40
feat(library/init/meta/tactic): expose approx at unify and is_def_eq tactics
2018-01-25 22:27:18 -08:00
Leonardo de Moura
d4e1a4a50a
chore(library/system/io): tactic.run_io ==> tactic.unsafe_run_io
2018-01-24 10:32:32 -08:00
Leonardo de Moura
0ad5497462
refactor(library/io): make io easier to extend and use
2018-01-23 15:03:31 -08:00
Leonardo de Moura
040722c7e7
feat(library/init/meta): add unify config option to apply_cfg
...
This commit also fixes a problem in the `apply` tactic error messages.
2018-01-04 12:51:59 -08:00
Leonardo de Moura
5fa857dc69
fix(library/tactic/tactic_state): do not diplay case for empty tag
2017-12-11 16:27:03 -08:00
Leonardo de Moura
d44996e034
feat(library/init/meta): propagate tag information
2017-12-10 19:15:41 -08:00
Leonardo de Moura
f288205cce
feat(library/tactic): goal tagging
2017-12-09 16:29:03 -08:00
Leonardo de Moura
1b34160396
feat(library/tactic/tactic_state): display number of goals
2017-12-06 11:20:09 -08:00
Leonardo de Moura
a056e87350
fix(library/init/meta/injection_tactic): add support for ginductive datatypes
2017-12-06 09:39:20 -08:00
Leonardo de Moura
af80c2890d
chore(library/init/meta/tactic): define focus_aux using is_assigned
2017-07-21 02:39:55 -07:00
Leonardo de Moura
fe51bebab3
refactor(library/init/meta/converter): new conv monad implementation
2017-06-29 16:37:22 -07:00
Leonardo de Moura
ce5ca79edf
feat(library/init/meta): add type_check tactic
...
closes #1697
2017-06-25 15:26:32 -07:00
Gabriel Ebner
5528a26592
fix(library/tactic/tactic_state): make tactic.sleep interruptible
...
Fixes leanprover/vscode-lean#52
2017-06-15 17:16:40 +02:00
Johannes Hölzl
e88933bac9
feat(library/init/meta/tactic): add tactic.set_env to set environment
2017-06-12 20:42:48 -07:00
Sebastian Ullrich
2bb93aa4f9
feat(init/meta): tactic -> parser coercion
2017-06-07 10:09:38 -07:00
Leonardo de Moura
02c82ac41a
fix(library/tactic/tactic_state): make sure mk_unify_exception is not compiler implementation dependent
2017-06-04 13:29:59 -07:00
Leonardo de Moura
e22ccb4d1f
feat(library/tactic/tactic_state): improve error message for unify and is_def_eq tactics
...
closes #1639
2017-06-03 19:52:22 -07:00
Leonardo de Moura
c59543bde8
feat(library/init/meta/tactic): add sleep tactic for debugging purposes
...
We are going to use it to simulate the issue described at issue #1601
2017-06-02 15:38:08 -07:00
Leonardo de Moura
92a72b238b
feat(library/tactic): add tactic::ref
...
They can be used to store user state in the tactic_state object.
@Armael @jroesch: The new file tests/lean/run/tactic_ref.lean contains a few examples.
2017-06-02 15:19:03 -07:00
Leonardo de Moura
603bbe5987
fix(*): gcc 7 linking errors
2017-05-31 16:35:09 -07:00
Daniel Selsam
d727abeefc
chore(library/inductive_compiler/nested.cpp): prove all theorems in C++
2017-05-04 16:34:32 -07:00
Jared Roesch
dc4086d0ed
feat(library/vm/process): add basic process support
2017-03-28 18:08:06 -07:00
Leonardo de Moura
8cf43e1b30
feat(library/tactic/tactic_state): add tactic.run_io
2017-03-23 18:17:53 -07:00
Leonardo de Moura
b1848efbc4
chore(library/init/meta): add head prefix to head reduction tactics, and add zeta tactic (that applies zeta reduction to all subterms)
2017-03-02 10:55:38 -08:00
Sebastian Ullrich
4d41b03168
chore(frontends/lean,library/tactic): remove old tactic_state functions
2017-02-17 15:41:58 +01:00