Coq战术是右联想还是左联想?

时间:2018-12-12 19:59:08

标签: coq coq-tactic logical-foundations

我正在经历software foundations并得到了例子:

try [ (left; reflexivity); right ]

,这很困惑。例如我们得到:

[try (left; reflexivity);] right

Theorem In10 : In 10 [1;2;3;4;5;6;7;8;9;10].
Proof.
  repeat (try (left; reflexivity); right).
Qed.

第二还是第一?


我特别想理解:

has-many

1 个答案:

答案 0 :(得分:3)

自行解决这些问题的一种好方法是使用idtac(总是成功)和fail(总是失败)这样的策略来消除歧义:

try (idtac; idtac); fail.     (* FAILS *)
try ((idtac; idtac); fail).   (* SUCCEEDS *)
(try (idtac; idtac)); fail.   (* FAILS *)

实际上,try的绑定比分号更紧密:

try (idtac; idtac); fail.   is the same as   (try (idtac; idtac)); fail.