# HG changeset patch # User atton # Date 1486633046 -32400 # Node ID 54cf3b3153fe3864abdfd6ea03e79c1de1068bbd # Parent f535393e40437d01370057dbe0c205bc5aa85fff Update diff -r f535393e4043 -r 54cf3b3153fe paper/atton-master.pdf Binary file paper/atton-master.pdf has changed diff -r f535393e4043 -r 54cf3b3153fe paper/cbc-type.tex --- a/paper/cbc-type.tex Thu Feb 09 18:30:02 2017 +0900 +++ b/paper/cbc-type.tex Thu Feb 09 18:37:26 2017 +0900 @@ -183,7 +183,7 @@ \begin{figure}[htbp] \begin{center} - \includegraphics[width=450]{fig/meta-hierarchy.pdf} + \includegraphics[width=450pt]{fig/meta-hierarchy.pdf} \caption{fig:meta-hierarchy} \label{メタの階層構造} \end{center} diff -r f535393e4043 -r 54cf3b3153fe paper/sources.tex --- a/paper/sources.tex Thu Feb 09 18:30:02 2017 +0900 +++ b/paper/sources.tex Thu Feb 09 18:37:26 2017 +0900 @@ -5,7 +5,7 @@ \section{部分型の定義} リスト~\ref{src:agda-subtype} に Agda 上で定義した CbC の部分型の定義を示す。 -\lstinputlisting[label=src:agda-subtype, caption=Agda 上で定義した CbC の部分型の定義(subtype.agda)] {src/subtype.agda} +\lstinputlisting[label=src:agda-subtype, caption=Agda 上で定義した CbC の部分型の定義(subtype.agda)] {src/subtype.agda.replaced} \section{ノーマルレベル計算の実行} \ref{section:normal-level-exec}節で取り上げたソースコードをリスト~\ref{src:normal-level-exec}に示す。 diff -r f535393e4043 -r 54cf3b3153fe paper/src/struct-init.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/paper/src/struct-init.c Thu Feb 09 18:37:26 2017 +0900 @@ -0,0 +1,1 @@ +struct Point p = {100 , 200}; diff -r f535393e4043 -r 54cf3b3153fe paper/src/struct.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/paper/src/struct.c Thu Feb 09 18:37:26 2017 +0900 @@ -0,0 +1,4 @@ +struct Point { + int x; + int y; +}; diff -r f535393e4043 -r 54cf3b3153fe paper/type.tex --- a/paper/type.tex Thu Feb 09 18:30:02 2017 +0900 +++ b/paper/type.tex Thu Feb 09 18:37:26 2017 +0900 @@ -89,11 +89,14 @@ ここでレコード型という型を導入する。 レコード型は複数の型を持ちえる型であり、内部に持っている値にはユニークな名前がラベルとして付いている。 例えば「Intの変数x とIntの変数yを持つレコード型」は$ \{ x : Int , y : Bool\}$のように記述する。 -C における構造体ではリストに対応する。 -% TODO C の構造体 +C における構造体ではリスト~\ref{src:struct}にのソースコードに対応する。 + +\lstinputlisting[label=src:struct, caption=C におけるレコード型である構造体の定義] {src/struct.c} レコード型の値を構成する際には、内部に格納する値を全て与えることで構成できる。 -% TODO C の構造体の初期化 +C 言語ならばフィールドの値を \verb/{}/ 内部に \verb/,/ 区切りで与えることで構造体を構成できる(リスト~\ref{src:struct-init})。 +\lstinputlisting[label=src:struct-init, caption=C 言語の構造体の初期化] {src/struct-init.c} + レコード型から値を取り出す際にはラベル名を用いた射影を利用する。 C 言語では構造体の後に \verb/./ キーワードを付けた後にラベル名を指定する。