Commit graph

9154 commits

Author SHA1 Message Date
Leonardo de Moura
ac0be0ecc6 chore(frontends/lean/elaborator): style 2017-08-22 15:41:12 -07:00
Sebastian Ullrich
9e53147e0a feat(frontends/lean/elaborator): allow field notation for recursive calls 2017-08-22 15:33:37 -07:00
Leonardo de Moura
e99ce26b16 fix(library/type_context): fixes #1801
This commit also fixes the decay in error message quality reported at
c6a10b127f
2017-08-22 14:03:58 -07:00
Leonardo de Moura
971ae34521 feat(frontends/lean/elaborator): closes #1760
As described at issue #1760, the new error message is:
```
1760.lean:6:18: error: type mismatch at application
  f x
term
  x
has type
  big_type : Type 1
but is expected to have type
  ?m_1 : Type
```
2017-08-21 16:15:03 -07:00
Leonardo de Moura
fb2186334a fix(library/init/meta/relation_tactics,library/tactic/subst_tactic): fixes #1772 2017-08-21 14:51:30 -07:00
Gabriel Ebner
7453148ad2 fix(library/tactic/simp_lemmas): only check has_idx_metavar in simp_lemmas.rewrite
This copies the change made in 2ca2920284
2017-08-20 09:30:16 +02:00
Gabriel Ebner
df5fb70c8a fix(emacs/lean-server): fix "error running timer"
This error occurred in files without trailing newlines.
2017-08-19 13:35:58 +02:00
Leonardo de Moura
049d940167 chore(frontends/lean/elaborator): cleanup 2017-08-18 17:50:29 -07:00
Leonardo de Moura
c149286f44 fix(frontends/lean/elaborator): add instantiate_pattern_mvars 2017-08-18 16:49:45 -07:00
Leonardo de Moura
94e7b46214 fix(library/string): is_char_value bug
Type may be a metavariable, and the is_def_eq test may succeed by
unifying the metavariable with `char`
2017-08-18 15:29:51 -07:00
Leonardo de Moura
d4f2bb77b8 feat(frontends/lean): recursive equation preprocessor
To make the equation compiler more convenient to use, we will add a
couple of preprocessing steps.
This commit adds the first one of them. In this step, we use
type inference to refine pattern variables, and we relax the
restrictions on inaccessible annotations.

We will also add a preprocessing step that implements the "complete
transition" step before we execute the elim_match step.
2017-08-18 15:06:11 -07:00
Gabriel Ebner
bbfbf1d8f5 doc(library/tactic/simp_lemmas): document and test change in ext_add_core 2017-08-18 19:34:08 +02:00
Gabriel Ebner
6b9bf5e2b7 fix(library/tactic/simp_lemmas): report invalid simplification lemmas also in add() 2017-08-18 19:32:51 +02:00
Gabriel Ebner
effd624911 fix(frontends/lean/parser): add check_system call 2017-08-18 08:54:04 +02:00
Gabriel Ebner
0d8e62ed40 feat(library/tactic/simp_lemmas): add both equational lemmas and the definition itself 2017-08-18 08:54:04 +02:00
Gabriel Ebner
256ca9789f fix(library/tactic/simp_lemmas): fix typo in pp 2017-08-18 08:54:03 +02:00
Gabriel Ebner
6bd3fe2449 feat(library/tactic/simp_lemmas): support congruence lemmas that are metavariable applications 2017-08-18 08:54:03 +02:00
Leonardo de Moura
0660e18943 feat(library/metavar_context): add method for setting metavar user facing name 2017-08-17 16:03:32 -07:00
Leonardo de Moura
9927f331f4 chore(frontends/lean/elaborator): remove dead code 2017-08-17 16:03:32 -07:00
Sebastian Ullrich
b08158fcb8 feat(emacs): add searching definitions using helm on C-c C-d 2017-08-17 18:21:09 +02:00
Leonardo de Moura
6315136279 fix(frontends/lean/definition_cmds): fixes #1790 2017-08-16 15:57:55 -07:00
Sebastian Ullrich
579d4a459e chore(init/meta/interactive): check simp lemmas for ambiguous overloads
Fixes #1786
2017-08-15 12:43:02 +02:00
Gabriel Ebner
32ddac5f40 feat(library/tactic/kabstract): expose kabstract to VM 2017-08-14 11:41:54 +02:00
Gabriel Ebner
867bc46d99 feat(library/vm/vm_parser): expose parse_command_like to the vm 2017-08-14 11:41:48 +02:00
Gabriel Ebner
e2717ec2c5 fix(library/compiler/inliner): inline auxiliary declarations
Fixes #1763.
2017-08-06 10:24:26 +02:00
Gabriel Ebner
0c15724e8e fix(library/tactic/simplify): handle universe polymorphic simplification rules
The issue was that instantiate_mvars(infer(m)) had a metavariable, while
infer(instantiate_mvars(m)) did not.  Changing the call from assign to
is_def_eq also unifies the type, assigning the metavariable inside the
type.
2017-08-03 17:42:07 +01:00
Leonardo de Moura
f39e42bf2d fix(library/tactic/destruct_tactic): fixes #1766 2017-08-02 15:35:33 +01:00
Leonardo de Moura
fdaa26f2fd feat(library/equations_compiler/wf_rec): fixes #1782 2017-08-02 15:12:04 +01:00
Gabriel Ebner
fe5cb0106c fix(frontends/lean/structure_cmd): disable def-eq check of pre-expressions 2017-08-02 14:41:35 +01:00
Gabriel Ebner
c500f9497d feat(frontends/lean/structure_cmd): inherit default values in old_structure_cmd 2017-08-02 14:41:35 +01:00
Gabriel Ebner
ce509e621a refactor(library/init/algebra): remove order_pair classes 2017-08-02 14:41:35 +01:00
Sebastian Ullrich
4f66673fc2 feat(init/meta/attribute,library/tactic/attribute): user_attribute apply handlers 2017-08-02 14:32:39 +01:00
Sebastian Ullrich
8571860876 chore(emacs/lean-dev): lean-diff-test-file: create missing files 2017-08-02 14:32:02 +01:00
Gabriel Ebner
becec82311 fix(frontends/lean/structure_cmd): simplify parser 2017-08-02 11:27:13 +01:00
Gabriel Ebner
b6f81e30e5 fix(frontends/lean/structure_cmd): prevent segfault
Fixes #1727.
2017-08-02 11:27:13 +01:00
Gabriel Ebner
403234f29e fix(frontends/lean/interactive): fix empty prefix in autocompletion 2017-08-01 18:42:31 +01:00
Gabriel Ebner
6d0a7a80af fix(frontends/lean/builtin_exprs): prevent segfault 2017-08-01 14:57:37 +01:00
Gabriel Ebner
c15f2979c6 fix(frontends/lean/util): allow docstrings after variables 2017-08-01 10:18:05 +01:00
Gabriel Ebner
89e1b196db fix(library/compiler/preprocess): do not unfold noncomputable definitions
This happened in Johannes' real number formalization.  We tried to
unfold a noncomputable definition even though it would have been erased
afterwards, and failed.

The check_computable check was introduced in order to fix the error
message in #1401, the error message is still intelligible in that
example.
2017-08-01 08:37:18 +01:00
Gabriel Ebner
2804a0ea27 fix(util/name): escape empty name components using french quotes 2017-07-31 16:01:46 +01:00
Gabriel Ebner
36dc037d65 perf(util/rc): do not use fences
As suggested by David Chisnall.  If I read the spec correctly, it would
be unsafe to use the release ordering for dec_ref_core: then the
following situation could happen:

```c++
// m_rc -> 2

// Thread 1:
unsigned x = atomic_fetch_sub_explicit(&m_rc, 1u, memory_order_release);

// Thread 2:
unsigned y = atomic_fetch_sub_explicit(&m_rc, 1u, memory_order_release);

// x = y = 1u, m_rc -> 2
```

That is, a release store operation is not required to be visible to
another release operation.

Herb Sutter also recommends the acq_rel ordering for reference counters.
2017-07-28 18:31:04 +01:00
Mario Carneiro
f369e34bd6 chore(library/standard): remove standard.lean (unused, and confusing given stdlib) 2017-07-28 16:47:53 +01:00
Sebastian Ullrich
52ae484f68 feat(emacs): add keybindings for leanpkg commands (C-c C-p ...) 2017-07-27 14:40:22 +02:00
Sebastian Ullrich
dc3e0c17ff fix(emacs/lean-pkg): fix leanpkg being started in the wrong folder 2017-07-27 14:39:39 +02:00
Sebastian Ullrich
99b4c8714d chore(.appveyor.yml,.travis.yml): simplify using glob patterns 2017-07-26 17:13:34 +02:00
Sebastian Ullrich
c44ed73d56 fix(frontends/lean/scanner): minor lexical grammar fixup 2017-07-26 17:02:00 +02:00
Sebastian Ullrich
a54ac12918 chore(.appveyor.yml,.travis.yml,CMakeLists): set Lean version string to "nightly" for nightly builds to make artifact name and contents version-independent 2017-07-25 17:57:53 +02:00
Gabriel Ebner
25aa847aba fix(library/constructions/brec_on): make motive explicit in *.below
Otherwise you can't figure out the type from the pretty-printed output
`nat.below n`.
2017-07-23 09:38:44 +01:00
Gabriel Ebner
537b11f358 fix(library/tactic/cases_tactic): do not let internal exception escape
This was doubly ungood since the contained vm_obj was shared across
threads.  @digama0 wseq.exists_of_lift_rel_left should work now.
2017-07-22 15:25:56 +01:00
Mario Carneiro
667e1e1381 fix(CMakeLists): remove executable before overwriting on windows, third try
This one is tested to work on my machine
2017-07-21 05:09:02 -07:00