12
はじめてのCoq 2010 08/29 CoqITプランニング 今井宜洋

Coq for beginners

Embed Size (px)

Citation preview

Page 1: Coq for beginners

はじめてのCoq

2010 08/29 Coq庵ITプランニング今井宜洋

Page 2: Coq for beginners

自己紹介• id: yoshihiro503 「にわとり小屋のプログラミング日記」

• @yoshihiro503 

• 所属:

• ocaml-nagoya

• ProofCafe

• Formal Method 勉強会

Page 3: Coq for beginners

Coqとは

• INRIAで研究、開発された対話的な証明支援器 (Proof Assistant)

• OCamlで書かれている

Page 4: Coq for beginners

仕様記述言語

実装手法

ZAlloy

B-method

ACL2

モデル検査

Coq

表現力

Isabelle/HOL

Agda

Prolog

テスト

HOL/Light

テキスト

Page 5: Coq for beginners

Coqの特徴

• 高階論理 (表現力は最強)

• 自動証明機能(tactic)を備える

• プログラムと連携

Page 6: Coq for beginners

Gallina式 tactic

Vernacularコマンド

Coqの中身

Page 7: Coq for beginners

• 関数の定義

• 問題の定式化• 証明

• 証明を含む式

VernacularとGallina tactic

(関数型プログラム的) (論理学的)

Page 8: Coq for beginners

Variable A: Type.Fixpoint append (xs ys:list A) := match xs with | nil => ys | x::xs => x :: append xs ys endwhere “xs ++ ys” := (append xs ys).

Theorem assoc : forall xs ys zs, (xs ++ ys) ++ zs = xs ++ (ys ++ zs).Proof. induction xs; simpl; intros; [| rewrite IHxs]; reflexivity.Qed.

Page 9: Coq for beginners

Coqで書かれたプログラム• でかいもの

• CAMP

• coqtail

• 小さいもの

• GC (@mzp)

• brainf*ckインタープリタ (id:ku-ma-me)

• Twitterクライアント (id:yoshihiro503)

Page 10: Coq for beginners

Coq習得の近道• MLやHaskellを知る

• 書いてみる, マニュアル, Twitter, Blog

• わからなければマニュアル

• Twitter, Blogで困ったと言う

• Blogで報告(解決してもしなくても)

Page 11: Coq for beginners

さらに熟練するには

• CPDT (Certified Program with Dependent Types)

• Coq’Art

• その他Curry-Howardや型理論など

Page 12: Coq for beginners

勉強会に参加しよう• ProofCafe(栄)

• 毎月第4土曜日

• 喫茶どえりゃあ

• Formal Method 勉強会

• id: kencobaさん主催の勉強会

• Coq部はtmiyaさん主体

• 09/23(木)春分の日