我有以下Ltac(来自here),曾经在Coq 8.4pl6上工作,但它不适用于Coq 8.5 beta 3:
Ltac maybe_intro_sym A B :=
match goal with
|[H:B=A|-_] => fail 1
|[H:A=B|-_] => assert (B=A) by auto
end.
Ltac maybe_intro_sym_neg A B :=
match goal with
|[H:B<>A|-_] => fail 1
|[H:A<>B|-_] => assert (B<>A) by auto
end.
Ltac intro_sym :=
repeat match goal with
|[H:?A=?B|-_] => maybe_intro_sym A B
|[H:?A<>?B|-_] => maybe_intro_sym_neg A B
end.
我收到一条错误消息
Error: The reference B was not found
in the current environment.
我对Ltac知之甚少。任何人都可以帮忙解释如何解决这个问题吗?
答案 0 :(得分:2)
在Coq 8.5中,Arith
定义了符号=?
。因此,解释为= ?B
的内容现在被解释为=? B
。在=
和?B
之间添加空格就足够了。