fix(frontends/lean/pp): bug when pretty printing binder information, fixes #73

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-08-21 09:28:07 -07:00
parent ab404beb01
commit 359c72b02f
4 changed files with 16 additions and 2 deletions

View file

@ -44,7 +44,7 @@ pair<expr, expr> binding_body_fresh(expr const & b, bool preserve_type) {
if (is_internal_name(n))
n = g_x;
n = pick_unused_name(binding_body(b), n);
expr c = mk_local(n, preserve_type ? binding_domain(b) : expr());
expr c = mk_local(n, preserve_type ? binding_domain(b) : expr(), binding_info(b));
return mk_pair(instantiate(binding_body(b), c), c);
}

7
tests/lean/pp.lean Normal file
View file

@ -0,0 +1,7 @@
check λ {A : Type.{1}} (B : Type.{1}) (a : A) (b : B), a
check λ {A : Type.{1}} {B : Type.{1}} (a : A) (b : B), a
check λ (A : Type.{1}) {B : Type.{1}} (a : A) (b : B), a
check λ (A : Type.{1}) (B : Type.{1}) (a : A) (b : B), a
check λ [A : Type.{1}] (B : Type.{1}) (a : A) (b : B), a
check λ {{A : Type.{1}}} {B : Type.{1}} (a : A) (b : B), a
check λ {{A : Type.{1}}} {{B : Type.{1}}} (a : A) (b : B), a

View file

@ -0,0 +1,7 @@
λ {A : Type} (B : Type) (a : A) (b : B), a : Π {A : Type} (B : Type), A → B → A
λ {A B : Type} (a : A) (b : B), a : Π {A B : Type}, A → B → A
λ (A : Type) {B : Type} (a : A) (b : B), a : Π (A : Type) {B : Type}, A → B → A
λ (A B : Type) (a : A) (b : B), a : Π (A B : Type), A → B → A
λ [A : Type] (B : Type) (a : A) (b : B), a : Π [A : Type] (B : Type), A → B → A
λ ⦃A : Type⦄ {B : Type} (a : A) (b : B), a : Π ⦃A : Type⦄ {B : Type}, A → B → A
λ ⦃A B : Type⦄ (a : A) (b : B), a : Π ⦃A B : Type⦄, A → B → A

View file

@ -2,5 +2,5 @@ id : ?M_1 → ?M_1
trans : (?M_1 → ?M_1 → Prop) → Prop
symm : (?M_1 → ?M_1 → Prop) → Prop
equivalence : (?M_1 → ?M_1 → Prop) → Prop
λ (A : Type) (R : A → A → Prop),
λ {A : Type} (R : A → A → Prop),
and (and (refl R) (symm R)) (trans R)