coq for beginners
TRANSCRIPT
はじめてのCoq
2010 08/29 Coq庵ITプランニング今井宜洋
自己紹介• id: yoshihiro503 「にわとり小屋のプログラミング日記」
• @yoshihiro503
• 所属:
• ocaml-nagoya
• ProofCafe
• Formal Method 勉強会
Coqとは
• INRIAで研究、開発された対話的な証明支援器 (Proof Assistant)
• OCamlで書かれている
仕様記述言語
実装手法
ZAlloy
B-method
ACL2
モデル検査
Coq
表現力
Isabelle/HOL
Agda
Prolog
テスト
HOL/Light
テキスト
Coqの特徴
• 高階論理 (表現力は最強)
• 自動証明機能(tactic)を備える
• プログラムと連携
Gallina式 tactic
Vernacularコマンド
Coqの中身
• 関数の定義
• 問題の定式化• 証明
• 証明を含む式
VernacularとGallina tactic
(関数型プログラム的) (論理学的)
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.
Coqで書かれたプログラム• でかいもの
• CAMP
• coqtail
• 小さいもの
• GC (@mzp)
• brainf*ckインタープリタ (id:ku-ma-me)
• Twitterクライアント (id:yoshihiro503)
Coq習得の近道• MLやHaskellを知る
• 書いてみる, マニュアル, Twitter, Blog
• わからなければマニュアル
• Twitter, Blogで困ったと言う
• Blogで報告(解決してもしなくても)
さらに熟練するには
• CPDT (Certified Program with Dependent Types)
• Coq’Art
• その他Curry-Howardや型理論など
勉強会に参加しよう• ProofCafe(栄)
• 毎月第4土曜日
• 喫茶どえりゃあ
• Formal Method 勉強会
• id: kencobaさん主催の勉強会
• Coq部はtmiyaさん主体
• 09/23(木)春分の日