fix(frontends/lean/elaborator): missing type information when ! operator (aka consume_args) is used

This commit is contained in:
Leonardo de Moura 2014-10-20 08:31:16 -07:00
parent a1006073d4
commit f0cc17af87
3 changed files with 67 additions and 1 deletions

View file

@ -124,7 +124,7 @@ optional<expr> elaborator::mvar_to_meta(expr const & mvar) {
/** \brief Store the pair (pos(e), type(r)) in the info_data if m_info_manager is available. */
void elaborator::save_type_data(expr const & e, expr const & r) {
if (!m_no_info && infom() && pip() &&
(is_constant(e) || is_local(e) || is_placeholder(e) || is_as_atomic(e))) {
(is_constant(e) || is_local(e) || is_placeholder(e) || is_as_atomic(e) || is_consume_args(e))) {
if (auto p = pip()->get_pos_info(e)) {
expr t = m_tc[m_relax_main_opaque]->infer(r).first;
m_pre_info_data.add_type_info(p->first, p->second, t);

View file

@ -0,0 +1,11 @@
VISIT consume_args.lean
SYNC 7
import logic data.nat.basic
open nat eq.ops
theorem tst (a b c : nat) : a + b + c = a + c + b :=
calc a + b + c = a + (b + c) : !add.assoc
... = a + (c + b) : {!add.comm}
... = a + c + b : (!add.assoc)⁻¹
WAIT
INFO 7

View file

@ -0,0 +1,55 @@
-- BEGINWAIT
-- ENDWAIT
-- BEGININFO
-- SYMBOL|7|15
=
-- ACK
-- TYPE|7|17
-- ACK
-- IDENTIFIER|7|17
a
-- ACK
-- TYPE|7|19
-- ACK
-- SYMBOL|7|19
+
-- ACK
-- TYPE|7|21
-- ACK
-- IDENTIFIER|7|21
c
-- ACK
-- TYPE|7|23
-- ACK
-- SYMBOL|7|23
+
-- ACK
-- TYPE|7|25
-- ACK
-- IDENTIFIER|7|25
b
-- ACK
-- SYMBOL|7|31
(
-- ACK
-- SYMBOL|7|32
!
-- ACK
-- TYPE|7|33
a + c + b = a + (c + b)
-- ACK
-- IDENTIFIER|7|33
nat.add.assoc
-- ACK
-- TYPE|7|43
a + c + b = a + (c + b) → a + (c + b) = a + c + b
-- ACK
-- SYMBOL|7|43
⁻¹
-- ACK
-- ENDINFO