Coq:“是的。”;相依归纳法;Ltac内部

Coq:“是的。”;相依归纳法;Ltac内部,coq,ltac,Coq,Ltac,依赖性归纳法在Ltac中对我的作用似乎不同,而不是 以下几点效果不错: Require Import Coq.Program.Equality. Goal forall (x:unit) (y:unit), x = y. intros. dependent induction x. dependent induction y. trivial. Qed. dependent-inclution在这里是过分的,因为destruct工作得很好。此外,如果Ltac用于帮助以下操作,则无需在校对脚本

依赖性归纳法在
Ltac中对我的作用似乎不同,而不是

以下几点效果不错:

Require Import Coq.Program.Equality.

Goal forall (x:unit) (y:unit), x = y.
intros.
dependent induction x.
dependent induction y.
trivial.
Qed.
dependent-inclution
在这里是过分的,因为
destruct
工作得很好。此外,如果
Ltac
用于帮助以下操作,则无需在校对脚本中命名要销毁的对象:

Ltac ok :=
  match goal with
    | [H : unit |- _] => destruct H
  end.

Goal forall (x:unit) (y:unit), x = y.
intros.
ok.
ok.
trivial.
Qed.
但是,当
自毁
相关感应
取代时,相同的
Ltac
会失败:

Ltac wat :=
  match goal with
    | [H : unit |- _] => dependent induction H
  end.

Goal forall (x:unit) (y:unit), x = y.
intros.
wat.

(*
Error: No matching clauses for match goal
       (use "Set Ltac Debug" for more info).
*)
Set Ltac Debug
没有提供任何其他有用的信息,除了
dependent inclution
实际上是在
x
y
上尝试的

奇怪的是,如果我在另一个
Ltac
中不匹配地将
依赖归纳法
包装起来,并将其应用于一个等于我实际想要进行归纳法的术语,那么一切都会顺利进行:

Ltac go H := let z := fresh in remember H as z; dependent induction z; subst H.

Ltac why :=
  match goal with
    | [H : unit |- _] => go H
  end.

Goal forall (x:unit) (y:unit), x = y.
intros.
why.
why.
trivial.
Qed.

这里发生了什么,为什么
依赖归纳法
看起来如此依赖于上下文?

这确实是一个bug,它在2015年3月被修复。

这在我看来像个bug。你试过在Coq的主干版本上测试这个吗?对于trunk,
wat。
以更详细的方式失败:“在对“wat”的嵌套Ltac调用中,最后一次调用失败。错误:Ltac变量H绑定到x,无法强制为新标识符。”
为什么
确定
两者都可以正常工作。我还是很困惑。是的,几乎可以肯定这是一只虫子。最好提交一份报告:。完成: