lean4-htt/tests/lean/bad_unification_hint.lean

14 lines
723 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- Good hint
@[unify] def {u} cons_append_hint (α : Type u) (a b : α) (l₁ l₂ l₃: list α) : unification_hint :=
{ pattern := (a :: l₁) ++ l₂ =?= b :: l₃,
constraints := [l₃ =?= l₁ ++ l₂, a =?= b] }
-- Bad hint: pattern is incorrect
@[unify] def {u} append_cons_hint (α : Type u) (a b : α) (l₁ l₂ l₃: list α) : unification_hint :=
{ pattern := l₁ ++ (a :: l₂) =?= b :: l₃,
constraints := [l₃ =?= l₁ ++ l₂, a =?= b] }
-- Bad hint: constraint #1 is incorrect
@[unify] def {u} cons_append_hint' (α : Type u) (a b : α) (l₁ l₂ l₃: list α) : unification_hint :=
{ pattern := (a :: l₁) ++ l₂ =?= b :: l₃,
constraints := [l₃ =?= l₁ ++ l₃, a =?= b] }