Inductive ty: Set :=
| I
| O.
Definition f (x: ty) (y: ty): nat :=
if x = y then 0 else 1.
私はタイプty
の二つの用語を比較する機能f
をしたいが、それはコンパイルできないと、私はこのエラーを参照してください。Coqで同じSetの2つの要素を比較するにはどうすればよいですか?
The term
x = y
has typeProp
which is not a (co-)inductive type.
{} + {}についてもう少し分かりますか? Proposition1やProp2のように思った。しかし、それはそのようには機能しません。彼らのために「分割」のようなものがありますか? – abhishek
@abhishek [sumbool](https://coq.inria.fr/library/Coq.Bool.Sumbool.html)を参照してください。例: [このブログの投稿](http://seb.mondet.org/blog/post/coqtests-02-sumbools.html) – gallais