升级到 Coq 8.5 后 Ltac 不工作
Ltac not working after upgrading to Coq 8.5
我有以下 Ltac(来自 ),它曾用于 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 了解不够。任何人都可以帮助解释如何解决这个问题吗?
在 Coq 8.5 中,Arith
定义了符号 =?
。因此,被解释为 = ?B
的内容现在被解释为 =? B
。在 =
和 ?B
之间添加一个 space 应该就足够了。
我有以下 Ltac(来自
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 了解不够。任何人都可以帮助解释如何解决这个问题吗?
在 Coq 8.5 中,Arith
定义了符号 =?
。因此,被解释为 = ?B
的内容现在被解释为 =? B
。在 =
和 ?B
之间添加一个 space 应该就足够了。