VOOZH about

URL: https://qiita.com/amutake/items/5ab7df143906ddbfc926

⇱ Coq の Variable と Parameter の違い #Coq - Qiita


👁 Image
4

Go to list of users who liked

4

Share on X(Twitter)

Share on Facebook

Add to Hatena Bookmark

More than 5 years have passed since last update.

@amutake

Coq の Variable と Parameter の違い

4
Last updated at Posted at 2015-05-23

Coq の Variable(s), Parameter(s), Hypothesis(es), Axiom, Conjecture の違いがいつもわからなくなるのでメモ。

まず Parameter = Parameters = Axiom = Conjecture で、Variable = Variables = Hypothesis = Hypotheses です。

この2つは Section を使わない場合や Section の中にいる場合は同じなのですが、Section の中で使ってその Section を閉じた場合に違いがでます。

(* Coq8.4pl5 *)SectionSect.Parameter(A:Type).Variable(B:Type).DefinitionA':=A.DefinitionB':=B.PrintA.(* => *** [ A : Type ] *)PrintB.(* => *** [B : Type] *)PrintA'.(* => A' = A : Type *)PrintB'.(* => B' = B : Type *)EndSect.PrintA.(* => *** [ A : Type ] *)PrintA'.(* => A' = A : Type *)PrintB'.(* => B' = fun B : Type => B : Type -> Type
 Argument scope is [type_scope] *)PrintB.(* => Error: B not a defined object. *)

Section の中ではどちらも同じですが、Section を閉じたあとは、Variable で定義した B は消え、B' は Type -> Type の関数になっています。

また慣習として、ソートが Prop のときは Axiom, Hypothesis を、それ以外のときは Parameter, Variable を使うようです。

参照: https://coq.inria.fr/refman/Reference-Manual003.html#sec41

4

Go to list of users who liked

4
1

Go to list of comments

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4

Go to list of users who liked

4