Commit graph

12422 commits

Author SHA1 Message Date
Sebastian Ullrich
355dac2cd1 chore(.appveyor.yml): separate upgrading and installing new packages 2017-06-03 17:42:48 +02: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
Leonardo de Moura
ca5439c698 feat(frontends/lean/tactic_notation): add support for tac ; [tac_1, ..., tac_n] notation in interactive tactic mode
closes #1634

This commit also changes the semantic of `tactic.focus [tac_1, ..., tac_n]`.
It now fails if the number of goals is not `n`.
Before it would only fail if there were more tactics than goals.

@Armael: See tests/lean/run/handthen.lean for examples of the new notation.
2017-06-02 11:38:04 -07:00
Leonardo de Moura
a8173c8194 feat(library/init): heterogeneous andthen type class, and tactic.seq_focus implementation 2017-06-02 10:38:27 -07:00
Leonardo de Moura
81e97de463 feat(library/init/meta/interactive): allow metavars in the show_goal tactic 2017-06-01 19:46:38 -07:00
Leonardo de Moura
d7ab5cd8a1 feat(frontends/lean/tactic_notation): allow show keyword to be used as syntax sugar for the show_goal tactic
@kha @gebner I added the `show_goal` tactic for selecting arbitrary
subgoals. This feature is similar to the one available in Isabelle.
This commit allows us to use the `show` keyword as syntax sugar for
`show_goal`. The test `show_goal.lean` has a small example.
What do you think?

@Armael: you can use `show` to structure your proofs in tactic mode.
See `tests/lean/run/show_goal.lean` for a small example.
2017-06-01 18:52:54 -07:00
Leonardo de Moura
18467bd302 feat(library/init/meta/interactive): add show_goal tactic for structuring proofs in interactive tactic mode 2017-06-01 18:36:50 -07:00
Leonardo de Moura
5446df1609 feat(library/init/meta/interactive): add interactive done tactic 2017-06-01 17:28:52 -07:00
Leonardo de Moura
00aef04b81 feat(library/init/meta/rec_util): add mk_constructors_fresh_names
@Armael @jroesch this commit implements the
`mk_constructors_fresh_names` tactic.
The new test file has a few examples.
2017-06-01 17:04:21 -07:00
Leonardo de Moura
190d792225 feat(library/init/meta/tactic): add default parameter value 2017-06-01 16:24:36 -07:00
Mario Carneiro
d82b8ed59e feat(init/data/int,init/data/nat,init/algebra): more algebra theorems 2017-06-01 15:15:40 -07:00
Leonardo de Moura
d8f03082b7 chore(library/type_context): style 2017-06-01 13:47:10 -07:00
Leonardo de Moura
9c79b361dc fix(library/type_context): non deterministic failure at bitwise.lean
We were getting the following error non deterministically:

```
library/init/data/nat/bitwise.lean:131:6: error: exact tactic failed, type mismatch, given expression has type
  z = f ff 0 z
but is expected to have type
  eq.rec z e = f ff 0 (binary_rec f z 0)
state:
C : ℕ → Sort u,
f : Π (b : bool) (n : ℕ), C n → C (bit b n),
z : C 0,
h : f ff 0 z = z,
b : bool,
n : ℕ,
b0 : bit b n = 0,
bf : bodd 0 = b,
n0 : shiftr 0 1 = n,
e : 0 = bit ff 0
⊢ eq.rec z e = f ff 0 (binary_rec f z 0)
```

This error was happening because of the type_context.unfold_lemmas new
flag. The type context thread local cache must be flushed whenever the
value of type_context.unfold_lemmas has changed.
2017-06-01 13:39:12 -07:00
Leonardo de Moura
291b61555a chore(library/type_context): add flag for disabling cache at compilation time 2017-06-01 13:32:09 -07:00
Gabriel Ebner
9aeda60e2c fix(library/equations_compiler/util): segfault 2017-06-01 16:58:00 +02:00
Sebastian Ullrich
09987df06e fix(frontends/lean/structure_cmd): do not collect m_ctx_locals multiple times 2017-06-01 07:38:30 -07:00
Sebastian Ullrich
1977b5bfc9 refactor(frontends/lean/structure_cmd): also simplify collecting ctx levels 2017-06-01 07:38:30 -07:00
Sebastian Ullrich
25152bc80d fix(frontends/lean/structure_cmd): use collect_implicit_locals to catch more context locals
Fixes #1623
2017-06-01 07:38:30 -07:00
Gabriel Ebner
f049a3f01e refactor(library/init/meta/has_reflect): get rid of unchecked_cast 2017-06-01 10:59:09 +02:00
Gabriel Ebner
04f9eb0b4f refactor(library/init/meta/expr): pure Lean implementation of reflected 2017-06-01 10:17:51 +02:00
Leonardo de Moura
e90bb65c7a fix(frontends/lean/elaborator): make sure coercions from (reflected t) to expr fire when t contains metavariables that can be synthesized by type class resolution 2017-05-31 23:33:48 -07:00
Leonardo de Moura
8b0cca57d1 fix(library/noncomputable): fixes #1631
This commit fixes issue #1631. However, it is not a perfect solution.
This commit improves the predicate that checks whether a definition is
noncomputable or not. This predicate was implemented before we had
a code generator.
We should refactor the code and use the code generator to check
whether a definition is noncomputable or not. Otherwise, we will
keep finding mismatches between the predicate at noncomputable.cpp
and what the code generator implements.
2017-05-31 23:16:37 -07:00
Leonardo de Moura
42eeb445d4 fix(library): make sure `(t) does not evaluate t
See #1631
2017-05-31 22:03:15 -07:00
Leonardo de Moura
56215b36e8 fix(*): [[fallthrough]] ==> /* fall-thru */
Older gcc compilers generate a warning when the attribute is used.
I found out that GCC 7 will not produce a warning if comments
such as /* fall-thru */ or /* FALLTHRU */ are used instead of the
attribute [[fallthrough]]
2017-05-31 21:18:47 -07:00
Leonardo de Moura
24048c4258 fix(*): gcc 7 weird uninitialized warnings
I think most of them are incorrect.
I didn't find a workaround for the one at json.hpp.
So, I just disabled this warning at server.cpp
2017-05-31 18:05:03 -07:00
Leonardo de Moura
ac17270894 fix(*): more gcc 7 warnings 2017-05-31 17:29:30 -07:00
Leonardo de Moura
603bbe5987 fix(*): gcc 7 linking errors 2017-05-31 16:35:09 -07:00
Leonardo de Moura
919cf420ea fix(*): gcc 7 warnings 2017-05-31 16:35:09 -07:00
Leonardo de Moura
d8fa93b4a2 feat(library/init/meta/tactic): add dependent parameters for empty introv 2017-05-31 15:10:07 -07:00
Leonardo de Moura
293ab6a032 fix(library/init/data/nat/bitwise): broken lemma 2017-05-31 15:08:03 -07:00
Mario Carneiro
41b928a546 feat(init/data/nat/bitwise): properties of bitwise ops 2017-05-31 14:18:44 -07:00
Mario Carneiro
18b622d709 chore(init/data/nat): modify bitwise defs 2017-05-31 14:18:44 -07:00
Leonardo de Moura
1c6e70d170 feat(library/init/meta): introv tactic
@Armael: this commit implements the `introv` tactic.
The implementation uses an auxiliary `intros_dep` that introduces new
hypotheses with forward dependencies.

The `tactic.introv` tactic implemented at library/init/meta/tactic.lean
is the main implementation, but it is not nice for interactive use since
users would have to write
```
tactic.introv [`h1, `h2]
```
To make it more conveninent to use, we define another
```
meta def introv (ns : parse ident_*) : tactic unit :=
tactic.introv ns >> return ()
```
This one is in the namespace `tactic.interactive`, and
uses parser extensions. The argument `parse ident_*` instructs
the parser to parse 0 or more identifiers and create a term
of type `list name` containing these identifiers.
2017-05-31 14:09:25 -07:00
Leonardo de Moura
71ef240817 feat(library/init/meta/interactive): add nary existsi
@Armael, this commit implements the nary existsi.
We can now write
a) existsi t
b) existsi [t_1, t_2, t_3]
2017-05-31 13:41:25 -07:00
Johannes Hölzl
7a855c33cc fix(leanpkg): keep timeout value when updating the manifest 2017-05-31 20:35:59 +02:00
Sebastian Ullrich
4e4dc98c87 chore(script/test_registry): use absolute path to leanpkg 2017-05-31 10:10:48 -07:00
Sebastian Ullrich
c4d684cc33 chore(.travis.yml.in): call cpack conditionally 2017-05-31 10:10:48 -07:00
Sebastian Ullrich
f87f35d623 chore(.travis.yml.in,script/test_registry): fix build 2017-05-31 10:10:48 -07:00
Jared Roesch
0ab3869a6a feat(script/test_registry): enable travis script 2017-05-31 10:10:48 -07:00
Jared Roesch
28246a34e1 feat(scripts): add prototype script for building pkg registry 2017-05-31 10:10:48 -07:00
Jared Roesch
0783ccf582 chore(*): remove old_library 2017-05-31 10:10:47 -07:00