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.
26 lines
619 B
Text
26 lines
619 B
Text
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
|