fix(frontends/lean/builtin_exprs): bug in 'using' construct

This commit is contained in:
Leonardo de Moura 2015-03-06 11:33:44 -08:00
parent 78d8e79000
commit daf36803c4
2 changed files with 10 additions and 1 deletions

View file

@ -289,7 +289,7 @@ static expr parse_proof(parser & p, expr const & prop) {
buffer<expr> new_locals;
while (!p.curr_is_token(get_comma_tk())) {
auto id_pos = p.pos();
expr l = p.parse_expr();
expr l = p.parse_id();
if (!is_local(l))
throw parser_error("invalid 'using' declaration for 'have', local expected", id_pos);
expr new_l = l;

View file

@ -0,0 +1,9 @@
example (p q r : Prop) : p ∧ q ∧ r → q ∧ p :=
assume Hpqr : p ∧ q ∧ r,
have Hp : p, from and.elim_left Hpqr,
have Hqr : q ∧ r, from and.elim_right Hpqr,
have Hq : q, from and.elim_left Hqr,
show q ∧ p, using Hp Hq, from
proof
and.intro Hq Hp
qed