annotate paper/introduction.tex @ 126:18f872806bc0

Update reference
author atton <atton@cr.ie.u-ryukyu.ac.jp>
date Thu, 16 Feb 2017 13:39:49 +0900
parents ebe838b83ada
children
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
100
ebe838b83ada Self review
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
9 モデル検査とはソフトウェアの全ての状態を数え上げ、その状態について仕様が常に真となることを確認することである。
ebe838b83ada Self review
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
10 モデル検査器には、 Promela と呼ばれる言語でモデルを記述する Spin\cite{spin} や、モデルを状態遷移系で記述する NuSMV\cite{nusmv}、C言語/C++ を記号実行する CBMC\cite{cbmc} などが存在する。
20
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 自身で行なう。
126
18f872806bc0 Update reference
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
27 CbC で記述された GearsOS の非破壊赤黒木に対して、メタ計算ライブラリ akasha~\cite{atton-ipsjpro} を用いて仕様を検査する。
100
ebe838b83ada Self review
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
28 また、定理証明的な検証として、 CbC のプログラムを証明支援系言語 Agda 上で証明する。
ebe838b83ada Self review
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
29 Agda で CbC の項を表現するために部分型を用いてCbCを型付けし、Agdaでの定義からCbCの形式的な定義を得る。
ebe838b83ada Self review
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
30 そして、Agda 上で Single Linked Stack の性質の証明を行なう。
21
a47122d914ea Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
31
20
4307454b56bb Add introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32
4307454b56bb Add introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 \section{本論文の構成}
22
c748fb296673 Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
34 本論文ではまず第\ref{chapter:cbc}章で Continuation based C の解説を行なう。
100
ebe838b83ada Self review
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
35 CbC を記述するプログラミングスタイルである CodeSegment と DataSegment の解説、メタ計算の例として GearsOS の解説を行なう。
95
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 81
diff changeset
36 第\ref{chapter:akasha}章にて GearsOS 上の非破壊赤黒木の検証をメタ計算ライブラリ akasha にて行なう。
22
c748fb296673 Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
37 次に第\ref{chapter:type}章で型システムについて取り上げる。
95
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 81
diff changeset
38 型システムの定義と CbC の型システムの定義に必要な単純型、レコード型、部分型について述べる。
22
c748fb296673 Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
39 第\ref{chapter:agda}章では証明支援系プログラミング言語 Agda についての解説を行なう。
c748fb296673 Update introduction
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
40 Agda の構文や使い方、Curry-Howard Isomorphism や Natural Deduction といった証明に関する解説も行なう。
48
623c90a21227 Wrote type.tex
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
41 第\ref{chapter:cbc-type}章では、部分型を用いて CbC のプログラムを Agda で記述し、証明を行なう。
23
925d7e02b712 Add bibliography
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
42 CodeSegment や DataSegment の Agda 上での定義や、メタ計算はどのように定義されるかを解説する。