Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Coq 逻辑:All_In无法展开嵌套的for All_Coq_Logical Foundations - Fatal编程技术网

Coq 逻辑:All_In无法展开嵌套的for All

Coq 逻辑:All_In无法展开嵌套的for All,coq,logical-foundations,Coq,Logical Foundations,我面临着一个非常奇怪的问题:coq不想将forall变量移动到上下文中 在过去,它确实: Example and_exercise : forall n m : nat, n + m = 0 -> n = 0 /\ m = 0. Proof. intros n m. 它产生: n, m : nat ============================ n + m = 0 -> n = 0 /\ m = 0 但当我们在forall中使用forall时,它不起作用: (*

我面临着一个非常奇怪的问题:coq不想将forall变量移动到上下文中

在过去,它确实:

Example and_exercise :
  forall n m : nat, n + m = 0 -> n = 0 /\ m = 0.
Proof.
  intros n m.
它产生:

n, m : nat
============================
n + m = 0 -> n = 0 /\ m = 0
但当我们在forall中使用forall时,它不起作用:

(* Auxilliary definition *)
Fixpoint All {T : Type} (P : T -> Prop) (l : list T) : Prop :=
  (* ... *)

Lemma All_In :
  forall T (P : T -> Prop) (l : list T),
    (forall x, In x l -> P x) <->
    All P l.
Proof.
  intros T P l. split.
  - intros H.
但是如何将x移出H并将其分解成更小的碎片呢?我试过:

destruct H as [x H1].
但它给出了一个错误:

Error: Unable to find an instance for the variable x.

这是什么?如何修复?

问题是forall嵌套在蕴涵的左侧,而不是右侧。从所有x,px形式的假设中引入x是没有意义的,就像在另一个证明的上下文中引入n是没有意义的。相反,您需要通过在正确的位置应用H假设。我不能给你这个问题的答案,但你可能想参考同一章中的dist_not_exists练习。

问题是forall嵌套在蕴涵的左侧,而不是右侧。从所有x,px形式的假设中引入x是没有意义的,就像在另一个证明的上下文中引入n是没有意义的。相反,您需要通过在正确的位置应用H假设。我不能给你这个问题的答案,但您可能希望参考同一章中的dist_not_exists练习。

我编辑了该问题,因为它包含了软件基础练习的部分答案。我编辑了该问题,因为它包含了软件基础练习的部分答案。感谢您提供了有用的提示,但没有给出答案当前位置在谷歌上搜索时感到内疚,但被卡住了。现在我可以带着一种良好的意识继续解决这个问题了谢谢你给了我一个有用的提示,但没有给出答案:我对谷歌搜索感到内疚,但非常困惑。现在我可以继续有意识地解决这个问题了
Error: Unable to find an instance for the variable x.