Commit graph

8904 commits

Author SHA1 Message Date
Johannes Hölzl
1352d4a5b3 feat(src/frontents/lean): support for coinduction command in frontend 2017-06-12 20:42:48 -07: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
Leonardo de Moura
9d5b69ad5c fix(library/compiler/preprocess): compile_lemma => compile_irrelevant
We can also ignore functions that return types at compile_lemma (now
called compile_irrelevant).

fixes #1658
2017-06-12 20:33:31 -07:00
Leonardo de Moura
f5e34f0c02 chore(library): make sure replace_visitor behavior is not compiler dependent, and remove code duplication 2017-06-12 20:18:11 -07:00
Leonardo de Moura
d7e3bd794e fix(library/equations_compiler): fixes #1663 2017-06-12 19:45:01 -07:00
Daniel Selsam
8f875c92ba fix(inductive_compiler/nested.cpp): fixes #1657 2017-06-09 20:06:50 +02:00
Sebastian Ullrich
fd8c1de428 fix(emacs/lean-type): replace non-stable function 2017-06-08 22:58:51 +02:00
Sebastian Ullrich
85905ccbb8 fix(emacs/lean-type): do not update *Lean Goal* buffer if new state is empty 2017-06-08 11:31:01 +02:00
Sebastian Ullrich
587cf6c050 fix(emacs/lean-mode): update *Lean Goal* buffer on flycheck changes 2017-06-08 11:29:19 +02:00
Gabriel Ebner
4b05c645bb fix(library/constructions/injective): use same transparency setting as no_confusion 2017-06-08 10:17:21 +02:00
Leonardo de Moura
17f8231d59 feat(library/tactic/cases_tactic): add support for injective functions in the cases tactic
This feature is needed when we declare an inductive predicate/type
which is indexed by a mutual and/or nested inductive datatype.

See tests/lean/run/term_pred.lean for an example.

@Armael: this commit should fix the issue with the `cases` tactic that
you reported today.
2017-06-07 19:50:01 -07:00
Leonardo de Moura
2a51fc4458 fix(frontends/lean): anonymous constructor and structure instances for private structures 2017-06-07 17:51:23 -07:00
Leonardo de Moura
4eefc41b6e refactor(*): wrap string in a structure
We want to make sure string users do not depend on the string
implementation. This is the first step.

We need this refactoring *now* to make sure it will not be
super painful to address issue #1175
2017-06-07 17:30:49 -07:00
Sebastian Ullrich
b60899138e fix(library/vm/vm_parser): header worries after rebase 2017-06-07 10:09:38 -07:00
Sebastian Ullrich
dd91630a83 feat(frontends/lean/user_notation): more error checking 2017-06-07 10:09:38 -07:00
Sebastian Ullrich
db08f3f139 fix(frontends/lean/user_notation): check for closedness before evaluating term 2017-06-07 10:09:38 -07:00
Sebastian Ullrich
01c430cd62 fix(frontends/lean/{parser_config,user_notation): persisting user notations 2017-06-07 10:09:38 -07:00
Sebastian Ullrich
56995348d3 hack(frontends/lean/parser): allow input to be substituted and use it to implement interpolating format macro 2017-06-07 10:09:38 -07:00
Sebastian Ullrich
c49f6f7873 refactor(frontends/lean/user_notation): use parser instead of tactic monad 2017-06-07 10:09:38 -07:00
Sebastian Ullrich
2bb93aa4f9 feat(init/meta): tactic -> parser coercion 2017-06-07 10:09:38 -07:00
Sebastian Ullrich
20ab8feeae feat(init/meta/lean/parser): pexpr parser that does not use quoted mode 2017-06-07 10:09:38 -07:00
Sebastian Ullrich
18063fa9ba feat(frontends/lean): user-defined notation parsers 2017-06-07 10:09:38 -07:00
Sebastian Ullrich
be6f2eada7 chore(*): typos 2017-06-07 10:09:38 -07:00
Sebastian Ullrich
283d8ade1a fix(library/quote): use opaque macro for elaborated expr quotations 2017-06-07 10:00:17 -07:00
Leonardo de Moura
82db0f874a fix(kernel/type_checker,library/type_context): add support for macros that cannot be expanded
Fixes #1650
2017-06-07 08:25:21 -07:00
Sebastian Ullrich
a72687661b fix(util/stackinfo): avoid and guard against negative overflow in g_stack_threshold computation 2017-06-07 13:22:11 +02:00
Leonardo de Moura
748eb856c3 fix(frontends/lean): fixes #1649
This issue is yet another reason for refactoring how parameters are
represented in Lean.
2017-06-06 21:33:24 -07:00
Leonardo de Moura
b9a22155da perf(util/stackinfo): optimize check_stack 2017-06-06 16:35:20 -07:00
Leonardo de Moura
3bc414efff perf(library/tactic): add unsafe_change tactic
The `unsafe_change e` tactic is similar to the `change e` tactic, but it
does not check whether `e` is definitionally equal to the current
tactic. It is useful when implementing tactics such as:

```
meta def dunfold : list name → tactic unit :=
λ cs, target >>= dunfold_core transparency.instances default_max_steps cs >>= unsafe_change
```

The tactic `dunfold_core` guarantees that the resultant expression is
definitionally equal to the input one.

This was one of the performance problems at issue #1646.
Here are the runtimes for size 7 in the example described at issue #1646.

Before this commit:

   tactic execution took 4.96s
   elaboration of some_lifted_lets took 7.6s
   type checking time of some_lifted_lets took 31.1ms (aka QED time)
   total execution time: 12.785s

After this commit:

   tactic execution took 3.78s
   elaboration of some_lifted_lets took 5.71s
   type checking time of some_lifted_lets took 35.2ms
   total execution time: 10.693s
2017-06-06 14:55:25 -07:00
Leonardo de Moura
aac7777beb perf(library/tactic/unfold_tactic): implement dunfold_core and dunfold_occs_core in C++
Before this commit they were implemented using C++ and Lean.
A Lean procedure was being invoked for each subterm of the input term.

This is one of the performance problems at issue #1646.
Here are the runtimes for size 7 in the example described at issue #1646.

Before this commit:

   tactic execution took 7.48s
   elaboration of some_lifted_lets took 11.5s
   type checking time of some_lifted_lets took 33.4ms (aka QED time)
   total execution time: 16.841s

After this commit:

   tactic execution took 4.96s
   elaboration of some_lifted_lets took 7.6s
   type checking time of some_lifted_lets took 31.1ms (aka QED time)
   total execution time: 12.785s
2017-06-06 14:35:05 -07:00
Gabriel Ebner
34d5c0f769 fix(library/mt_task_queue): work around non-recursive lock 2017-06-06 19:57:04 +02:00
Leonardo de Moura
559211d284 perf(library/local_context): fix performance bottleneck at local_const
This is one of the performance problems at issue #1646.
The method `local_context::erase_user_name(local_decl const & d)` was
inefficient when there are many locals with the same user facing name.
For size 7 in the example described at issue #1646, the average size of the
declaration list was 400. Here are the runtimes for size 7

Before: 19.021 secs
After:  16.433 secs

There are more performance issues.
2017-06-06 10:01:08 -07:00
Leonardo de Moura
544817cf15 fix(library/vm/interaction_state_imp): add scope_vm_state
This is needed when the expression to be compiled is too simple.
2017-06-05 19:22:13 -07:00
Gabriel Ebner
1e7e440951 fix(library/module_mgr): actually cancel invalidated tasks 2017-06-05 19:36:09 +02:00
Gabriel Ebner
d03b61635c fix(frontends/lean/module_parser): end-of-file position 2017-06-05 09:08:38 +02:00
Leonardo de Moura
e204a30685 fix(kernel/replace_fn): check if running out of stack space at replace_rec_fn
See #1646
2017-06-04 15:57:11 -07:00
Leonardo de Moura
cd624dda75 fix(library/tactic/exact_tactic): make sure exact/refine tactics check for cycles when assigning metavariables
fixes #1638
2017-06-04 15:10:42 -07:00
Gabriel Ebner
86f4c9a794 fix(util/thread): disable thread finalizer manager finalization due to race condition 2017-06-04 23:29:34 +02: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
Gabriel Ebner
0c90e97134 fix(util/lp): fix compile error due to missing functions 2017-06-03 15:44:22 +02:00
Gabriel Ebner
9a706daf12 chore(util/debug): mark assertion failures as LEAN_UNLIKELY 2017-06-03 15:44:22 +02:00
Gabriel Ebner
88a1067435 fix(util/debug): extract exit-to-debugger functionality 2017-06-03 15:44:22 +02:00
Gabriel Ebner
910d63d314 refactor(util/compiler_hints): move LEAN_UNLIKELY macro out of vm code 2017-06-03 15:44:22 +02:00
Gabriel Ebner
d46c8b96fe fix(CMakeLists): enable debugging assertions in RelWithDebInfo builds 2017-06-03 15:30:01 +02:00
Gabriel Ebner
d394654490 feat(util/debug): throw exceptions for failed assertions in server mode 2017-06-03 15:29:37 +02:00
Leonardo de Moura
a1dc121eee feat(library/init/meta/environment): add environment.fingerprint API 2017-06-02 16:52:40 -07:00
Leonardo de Moura
6af3084f9a feat(util/numerics/mpz): add mpz(uint64) constructor 2017-06-02 16:36:40 -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