annotate paper/introduction.tex @ 81:3f63f697ed3a

Update
author atton <atton@cr.ie.u-ryukyu.ac.jp>
date Wed, 08 Feb 2017 17:37:08 +0900
parents 50c2d2f1a186
children fcab76b8ca58
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
48
623c90a21227 Wrote type.tex
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
1 \chapter{CbC とメタ計算としての検証手法}
20
4307454b56bb Add introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 ソフトウェアの規模が大きくなるにつれてバグは発生しやすくなる。
4307454b56bb Add introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 バグとはソフトウェアが期待される動作以外の動作をすることである。
4307454b56bb Add introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 ここで期待された動作は仕様と呼ばれ、自然言語や論理によって記述される。
4307454b56bb Add introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 検証とは定められた環境下においてソフトウェアが仕様を満たすことを保証することである。
4307454b56bb Add introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
4307454b56bb Add introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 ソフトウェアの検証手法にはモデル検査と定理証明がある。
4307454b56bb Add introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
4307454b56bb Add introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 モデル検査とはソフトウェアの全ての状態を数え上げ、その状態について仕様が常に真となることを確認する。
4307454b56bb Add introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 モデル検査器には Promela と呼ばれる言語でモデルを記述する Spin\cite{spin} や、モデルを状態遷移系で記述する NuSMV\cite{nusmv}、C言語/C++ を記号実行する CBMC\cite{cbmc} などが存在する。
4307454b56bb Add introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 定理証明はソフトウェアが満たすべき仕様を論理式で記述し、その論理式が恒真であることを証明する。
77
50c2d2f1a186 Update chapter akasha
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
12 定理証明を行なうことができる言語には、依存型で証明を行なう Agda\cite{agda} や Coq\cite{coq} 、 ATS2\cite{ats2} などが存在する。
20
4307454b56bb Add introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13
21
a47122d914ea Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
14 モデル検査器や証明でソフトウェアを検証する際、検証を行なう言語と実装に使われる言語が異なるという問題がある。
22
c748fb296673 Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
15 言語が異なれば二重で同じソフトウェアを記述する必要がある上、検証に用いるソースコードは状態遷移系でプログラムを記述するなど実装コードに比べて記述が困難である。
77
50c2d2f1a186 Update chapter akasha
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
16 検証されたコードから実行可能なコードを生成可能な検証系もあるが、生成されたコードは検証のコードとは別の言語であったり、既存の実装に対する検証は行なえないなどの問題がある。
23
925d7e02b712 Add bibliography
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
17 そこで、当研究室では検証と実装が同一の言語で行なえる Continuation based C\cite{utah-master} 言語を開発している。
21
a47122d914ea Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
18
a47122d914ea Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
19 Continuation based C (CbC)はC言語と似た構文を持つ言語である。
a47122d914ea Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
20 CbC では処理の単位は関数ではなく CodeSegment という単位で行なわれる。
a47122d914ea Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
21 CodeSegment は値を入力として受け取り出力を行なう処理単位であり、CodeSegment を接続していくことによりソフトウェアを構築していく。
a47122d914ea Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
22 CodeSegment の接続処理はメタ計算として定義されており、実装や環境によって切り替えを行なうことができる。
77
50c2d2f1a186 Update chapter akasha
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
23 検証を行なうメタ計算を定義することにより、CodeSegment の定義を検証用に変更せずソフトウェアの検証を行なう。
21
a47122d914ea Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
24
a47122d914ea Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
25 本論文では CbC のメタ計算として検証手法の提案と CbC の型システムの定義を行なう。
a47122d914ea Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
26 モデル検査的な検証として、状態の数え上げを行なう有限のモデル検査と仕様の定義を CbC 自身で行なう。
77
50c2d2f1a186 Update chapter akasha
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
27 CbC で記述された GearsOS の非破壊赤黒木に対して、メタ計算ライブラリ akasha を用いて仕様を検査する。
50c2d2f1a186 Update chapter akasha
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
28 また、定理証明的な検証として、 CbC のプログラムが証明支援系言語 Agda 上に証明可能な形で定義できることを示す。
50c2d2f1a186 Update chapter akasha
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 48
diff changeset
29 Agda 上で CbC のプログラムを記述するために、CbC の型システムを部分型を利用して定義する。
21
a47122d914ea Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
30
20
4307454b56bb Add introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
4307454b56bb Add introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 \section{本論文の構成}
81
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 77
diff changeset
33 TODO: もう一回構成しなおし
22
c748fb296673 Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
34 本論文ではまず第\ref{chapter:cbc}章で Continuation based C の解説を行なう。
c748fb296673 Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
35 CbC を記述するプログラミングスタイルである CodeSegment と DataSegment の解説、メタ計算と状態を数え上げるメタ計算ライブラリ akasha の解説を行なう。
c748fb296673 Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
36 次に第\ref{chapter:type}章で型システムについて取り上げる。
c748fb296673 Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
37 型システムの定義とラムダ計算、単純型付きラムダ計算と部分型について述べる。
c748fb296673 Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
38 第\ref{chapter:agda}章では証明支援系プログラミング言語 Agda についての解説を行なう。
c748fb296673 Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
39 Agda の構文や使い方、Curry-Howard Isomorphism や Natural Deduction といった証明に関する解説も行なう。
48
623c90a21227 Wrote type.tex
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
40 第\ref{chapter:cbc-type}章では、部分型を用いて CbC のプログラムを Agda で記述し、証明を行なう。
23
925d7e02b712 Add bibliography
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
41 CodeSegment や DataSegment の Agda 上での定義や、メタ計算はどのように定義されるかを解説する。