升级到Coq 8.5后,Ltac无法正常工作

时间:2015-12-02 00:25:31

标签: coq ltac

我有以下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知之甚少。任何人都可以帮忙解释如何解决这个问题吗?

1 个答案:

答案 0 :(得分:2)

在Coq 8.5中,Arith定义了符号=?。因此,解释为= ?B的内容现在被解释为=? B。在=?B之间添加空格就足够了。