forked from leanprover/lean3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(library/type_context): unifier failed to solve `?m =?= fun x_1 ..…
…. x_n, ?m x_1 ... x_n` Before this commit, the unifier would try to solve the unification consraint ?m =?= fun x_1 ... x_n, ?m x_1 ... x_n by assigning ?m := fun x_1 ... x_n, ?m x_1 ... x_n which fails the occurs check. This commit skips the assignment by using eta-reduction.
- Loading branch information
1 parent
0b5f1f3
commit e676404
Showing
3 changed files
with
58 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
open tactic | ||
example : true := | ||
by do | ||
let n : expr := `(nat), | ||
let t : expr := `(nat → nat), | ||
m ← mk_meta_var t, | ||
let em : expr := (expr.lam `x binder_info.default n (expr.app m (expr.var 0))), | ||
/- The unification constraint | ||
?m =?= (fun x, ?m x) | ||
should work. | ||
-/ | ||
unify m em, | ||
constructor | ||
|
||
example : true := | ||
by do | ||
let n : expr := `(nat), | ||
let t : expr := `(nat → nat), | ||
m ← mk_meta_var t, | ||
let em : expr := (expr.lam `x binder_info.default n (expr.app m (expr.var 0))), | ||
/- The unification constraint | ||
?m =?= (fun x, ?m x) | ||
should work. | ||
-/ | ||
unify em m, | ||
constructor |