---
 doc/namespace/Makefile.in               |   11 +++++
 doc/namespace/disunbig.tikz             |   30 +++++++++++++++
 doc/namespace/flat-module.tikz          |   28 ++++++++++++++
 doc/namespace/hir-module-namespace.tikz |   63 ++++++++++++++++++++++++++++++++
 doc/namespace/namespace.tex             |   23 ++++++++---
 doc/namespace/toplevel.tikz             |   25 ++++++++++++
 6 files changed, 174 insertions(+), 6 deletions(-)

--- /dev/null
+++ cafeobj-1.5.5/doc/namespace/disunbig.tikz
@@ -0,0 +1,30 @@
+\begin{center}
+\begin{tikzpicture}
+  \node[circle,fill=white,draw,minimum width=2cm,align=center,circular drop shadow,label={[shift={(0,-20pt)}]north:A}] (a) at (0, 0) {};
+  \node[circle,fill=white,draw,minimum width=2cm,align=center,circular drop shadow,label={[shift={(0,-20pt)}]north:C}] (c) at (2.8cm, -2.2cm) {};
+  \node[circle,fill=white,draw,minimum width=2cm,align=center,circular drop shadow,label={[shift={(0,-20pt)}]north:B}] (b) at (-0.8cm, -3.5cm) {};
+  \node[circle,fill=white,draw,minimum width=2cm,align=center,circular drop shadow,label={[shift={(0,-20pt)}]north:D}] (d) at (2.5cm, -5.2cm) {};
+  \node[circle,fill=white,draw,minimum width=2cm,align=center,circular drop shadow,label={[shift={(0,-20pt)}]north:E}] (e) at (5.7cm, -4cm) {};
+  \node (a1) at (2cm,0.6cm) {$\alpha$} ;
+  \node (a2) at (-0.8cm,-3.8cm) {$\alpha$} ;
+  \node (a3) at (3cm,-2.4cm) {$\alpha$} ;
+  \node (a4) at (5.9cm,-4.3cm) {$\alpha$} ;
+  \draw[fill] (2.6cm,-2.3cm) circle (2pt);
+  \draw[fill] (-1.2cm,-3.7cm) circle (2pt);
+  \draw[fill] (5.5cm,-4.2cm) circle (2pt);
+  \draw[dotted] (a1) to node[very near start] {?} (a2) ;
+  \draw[dotted] (a1) to node[near start] {?} (a3) ;
+  \draw[dotted] (a1) to node[very near start] {?} (a4) ;
+  \node (ac) at (4.8cm,-1.1cm) {$\alpha$.C} ;
+  \draw[-{Latex[length=3mm, width=1mm]}] (ac) -- (a3) ;
+  \node[align=center] (ae) at (5cm,-6.3cm) {$\alpha$.E\\または\\$\alpha$.D} ;
+  \draw[-{Latex[length=3mm, width=1mm]}] (ae) -- (a4) ;
+  \node (ab) at (-1cm, -5.8cm) {$\alpha$.B} ;
+  \draw[-{Latex[length=3mm, width=1mm]}] (ab) -- (a2) ;
+  %
+  \draw[draw=black!50,line width=1mm, -{Stealth[length=5mm, open]}] (e) -- (d) ;
+  \draw[draw=black!50,line width=1mm, -{Stealth[length=5mm, open]}] (d) -- (b) ;
+  \draw[draw=black!50,line width=1mm, -{Stealth[length=5mm, open]}] (b) -- (a) ;
+  \draw[draw=black!50,line width=1mm, -{Stealth[length=5mm, open]}] (c) -- (a) ;
+\end{tikzpicture}
+\end{center}
--- /dev/null
+++ cafeobj-1.5.5/doc/namespace/flat-module.tikz
@@ -0,0 +1,28 @@
+\definecolor{blueish}{HTML}{9CA4F2}
+\definecolor{grenish}{HTML}{8BFDBD}
+\definecolor{yellish}{HTML}{D4FE76}
+\definecolor{pinkish}{HTML}{B8AAB1}
+\def\firstcircle{(0,1cm) ellipse (1.4cm and 0.9cm)}
+\def\secondcircle{(1.8cm,0) ellipse (2cm and 1cm)}
+\def\thirdcircle{(0.1cm,-0.9cm) ellipse (0.8cm and 1.2cm)}
+\def\forthcircle{(-1cm,0) ellipse (1.2cm and 0.7cm)}
+\begin{center}
+\begin{tikzpicture}
+  \begin{scope}[fill opacity=0.5]
+    \fill[yellish] \firstcircle;
+    \fill[blueish] \secondcircle;
+    \fill[pinkish] \thirdcircle;
+    \fill[grenish] \forthcircle;
+  \end{scope}
+  \draw \firstcircle node[above] {ソートの};
+  \draw \firstcircle node[below] {名前};
+  \draw \secondcircle node[above] {オペレータの};
+  \draw \secondcircle node[below] {名前};
+  \draw \thirdcircle node[above] {公理の};
+  \draw \thirdcircle node[below] {名前};
+  \draw \forthcircle node[above] {変数の};
+  \draw \forthcircle node[below] {名前};
+  \draw (-3cm,-2.6cm) rectangle (4.4cm,2.4cm);
+  \draw (4.4cm,2.4cm) node[below left] {モジュール};
+\end{tikzpicture}
+\end{center}
--- /dev/null
+++ cafeobj-1.5.5/doc/namespace/hir-module-namespace.tikz
@@ -0,0 +1,63 @@
+\definecolor{blueish}{HTML}{9CA4F2}
+\definecolor{grenish}{HTML}{8BFDBD}
+\definecolor{yellish}{HTML}{D4FE76}
+\definecolor{pinkish}{HTML}{B8AAB1}
+\definecolor{greyish}{HTML}{F2FCF4}
+\begin{center}
+\begin{tikzpicture}
+  \def\xs{0cm}
+  \def\ys{0cm}
+  \node[ellipse,draw,fill=yellish,fill opacity=0.5,minimum width=2.8cm,minimum height=1.8cm,align=center] (a1) at (0 + \xs, 1cm + \ys) {};
+  \node[draw=none,fill=none,align=center] at (0 + \xs,1cm + \ys) {ソートの\\[5pt]名前};
+  \node[ellipse,draw,fill=blueish,fill opacity=0.5,minimum width=4cm,minimum height=2cm,align=center] (a2) at (1.8cm + \xs, 0cm + \ys) {};
+  \node[draw=none,fill=none,align=center] at (1.8cm + \xs,0cm + \ys) {オペレータの\\[5pt]名前};
+  \node[ellipse,draw,fill=pinkish,fill opacity=0.5,minimum width=1.6cm,minimum height=2.4cm,align=center] (a3) at (0.1cm + \xs, -0.9cm + \ys) {};
+  \node[draw=none,fill=none,align=center] at (0.1cm + \xs,-0.9cm + \ys) {公理の\\[5pt]名前};
+  \node[ellipse,draw,fill=grenish,fill opacity=0.5,minimum width=2.4cm,minimum height=1.4cm,align=center] (a4) at (-1cm + \xs, 0cm + \ys) {};
+  \node[draw=none,fill=none,align=center] at (-1cm + \xs,0cm + \ys) {変数の\\[5pt]名前};
+  \node[minimum width=7.4cm, minimum height=5cm,draw] (a) at (0.7cm,-0.1cm) {};
+  \draw (4.4cm + \xs,2.4cm + \ys) node[below left] {モジュールA};
+  %
+  \def\xs{2cm}
+  \def\ys{-5.5cm}
+  \node[ellipse,draw,fill=yellish,fill opacity=0.5,minimum width=2.8cm,minimum height=1.8cm,align=center] (b1) at (0 + \xs, 1cm + \ys) {};
+  \node[draw=none,fill=none,align=center] at (0 + \xs,1cm + \ys) {ソートの\\[5pt]名前};
+  \node[ellipse,draw,fill=blueish,fill opacity=0.5,minimum width=4cm,minimum height=2cm,align=center] (b2) at (1.8cm + \xs, 0cm + \ys) {};
+  \node[draw=none,fill=none,align=center] at (1.8cm + \xs,0cm + \ys) {オペレータの\\[5pt]名前};
+  \node[ellipse,draw,fill=pinkish,fill opacity=0.5,minimum width=1.6cm,minimum height=2.4cm,align=center] (b3) at (0.1cm + \xs, -0.9cm + \ys) {};
+  \node[draw=none,fill=none,align=center] at (0.1cm + \xs,-0.9cm + \ys) {公理の\\[5pt]名前};
+  \node[ellipse,draw,fill=grenish,fill opacity=0.5,minimum width=2.4cm,minimum height=1.4cm,align=center] (b4) at (-1cm + \xs, 0cm + \ys) {};
+  \node[draw=none,fill=none,align=center] at (-1cm + \xs,0cm + \ys) {変数の\\[5pt]名前};
+  \node[minimum width=7.4cm, minimum height=5cm,draw] (b) at (0.7cm + \xs,-0.1cm + \ys) {};
+  \draw (4.4cm + \xs,2.4cm + \ys) node[below left] {モジュールB};
+  %
+  \def\xs{4cm}
+  \def\ys{-11cm}
+  \node[ellipse,draw,fill=yellish,fill opacity=0.5,minimum width=2.8cm,minimum height=1.8cm,align=center] (c1) at (0 + \xs, 1cm + \ys) {};
+  \node[draw=none,fill=none,align=center] at (0 + \xs,1cm + \ys) {ソートの\\[5pt]名前};
+  \node[ellipse,draw,fill=blueish,fill opacity=0.5,minimum width=4cm,minimum height=2cm,align=center] (c2) at (1.8cm + \xs, 0cm + \ys) {};
+  \node[draw=none,fill=none,align=center] at (1.8cm + \xs,0cm + \ys) {オペレータの\\[5pt]名前};
+  \node[ellipse,draw,fill=pinkish,fill opacity=0.5,minimum width=1.6cm,minimum height=2.4cm,align=center] (c3) at (0.1cm + \xs, -0.9cm + \ys) {};
+  \node[draw=none,fill=none,align=center] at (0.1cm + \xs,-0.9cm + \ys) {公理の\\[5pt]名前};
+  \node[ellipse,draw,fill=grenish,fill opacity=0.5,minimum width=2.4cm,minimum height=1.4cm,align=center] (c4) at (-1cm + \xs, 0cm + \ys) {};
+  \node[draw=none,fill=none,align=center] at (-1cm + \xs,0cm + \ys) {変数の\\[5pt]名前};
+  \node[minimum width=7.4cm, minimum height=5cm,draw] (c) at (0.7cm + \xs,-0.1cm + \ys) {};
+  \draw (4.4cm + \xs,2.4cm + \ys) node[below left] {モジュールC};
+
+%
+  \node[ellipse,draw=none,fill=greyish,circular drop shadow,minimum width=5cm,minimum height=3.6cm,align=center] (m) at (9cm,-0.1cm) {トップレベルの\\[5pt]名前空間} ; 
+  \draw [-{Latex[length=5mm, width=2mm]}] (m) to [bend right=20] ([yshift=-20pt]a.north east) ;
+  \draw [-{Latex[length=5mm, width=2mm]}] (m) to [bend left=20] ([xshift=-20pt]c.north east) ;
+  \draw [-{Latex[length=5mm, width=2mm]}] (m) to [bend left=20] ([yshift=-20pt]b.north east) ;
+  %
+  \draw [-{Latex[length=5mm, width=2mm]}] (b2.north) to [bend right=80] (a2.east) ;
+  \draw [-{Latex[length=5mm, width=2mm]}] (c2.north) to [bend right=80] (b2.east) ;
+  %
+  \draw [-{Latex[length=5mm, width=2mm]}] (b3.west) to [bend left=90] (a3.west) ;
+  \draw [-{Latex[length=5mm, width=2mm]}] (c3.west) to [bend left=90] (b3.west) ;
+  %
+  \draw [-{Latex[length=5mm, width=2mm]}] (b1.west) to [bend left=90] (a1.west) ;
+  \draw [-{Latex[length=5mm, width=2mm]}] (c1.west) to [bend left=90] (b1.west) ;
+  
+\end{tikzpicture}
+\end{center}
--- cafeobj-1.5.5.orig/doc/namespace/namespace.tex
+++ cafeobj-1.5.5/doc/namespace/namespace.tex
@@ -13,8 +13,8 @@
 %\usepackage{luatexja}
 \usepackage{fontspec}
 \usepackage{indentfirst}
-\setmainfont[Mapping=tex-text]{M+ 2p regular}
-\setsansfont[Mapping=tex-text]{M+ 2c regular}
+\setmainfont[Mapping=tex-text]{M+ 2p medium}
+\setsansfont[Mapping=tex-text]{M+ 2c}
 \setmonofont[Mapping=tex-text]{M+ 2m medium}
 \XeTeXlinebreaklocale "ja"
 \XeTeXlinebreakskip=0em plus 0.1em minus 0.01em
@@ -24,6 +24,8 @@
 %%%%
 \usepackage{dcolumn,hhline,colortbl}
 \usepackage[table]{xcolor}
+\usepackage{tikz}
+\usetikzlibrary{shadows.blur,shapes,positioning,arrows.meta,arrows,decorations,calc}
 %%%%% 色付表
 \newcolumntype{G}{%
   >{\columncolor[gray]{0.9}}c}
@@ -175,7 +177,8 @@
 
 \begin{figure}[H]
 \begin{center}
-  \includegraphics[scale=0.7]{toplevel.pdf}
+  \input toplevel.tikz
+  %\includegraphics[scale=0.7]{toplevel.pdf}
 \caption{トップレベルの名前空間}
 \label{fig:toplevel}
 \end{center}
@@ -201,7 +204,8 @@
 図~\ref{fig:flat-module-namespece}に示す:
 \begin{figure}[H]
 \begin{center}
-  \includegraphics[scale=0.7]{flat-module.pdf}
+  \input flat-module.tikz
+  %\includegraphics[scale=0.7]{flat-module.pdf}
 \caption{サブモジュールなしのモジュールの名前空間}
 \label{fig:flat-module-namespece}
 \end{center}
@@ -245,7 +249,8 @@
 有向グラフ構造となるが，ここでの議論に関して違いは無い．}．
 \begin{figure}[!ht]
 \begin{center}
-  \includegraphics[scale=0.7]{hir-module-namespace.pdf}
+  \input hir-module-namespace.tikz
+  %\includegraphics[scale=0.7]{hir-module-namespace.pdf}
   \caption{階層的モジュールの名前空間}
   \label{fig:hir-module}
 \end{center}
@@ -276,7 +281,8 @@
 ある名前$\alpha$の参照が曖昧となる事があり得る．
 \begin{figure}
 \begin{center}
-\includegraphics[scale=0.7]{disunbig.pdf}
+\input disunbig.tikz
+%\includegraphics[scale=0.7]{disunbig.pdf}
 \end{center}
 \caption{名前の衝突と文脈限定名による解決}
 \label{fig:disunbig}
@@ -1019,3 +1025,8 @@
 
 \end{document}
 
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
--- /dev/null
+++ cafeobj-1.5.5/doc/namespace/toplevel.tikz
@@ -0,0 +1,25 @@
+\def\firstcircle{(0,0) ellipse (2.3cm and 1.9cm)}
+\def\secondcircle{(3.5cm,0) ellipse (2.3cm and 1.9cm)}
+\definecolor{blueish}{HTML}{A4C0FF}
+\definecolor{reddish}{HTML}{B7C5B3}
+\begin{center}
+\begin{tikzpicture}
+  \draw[fill=white,blur shadow={shadow xshift=-0.4ex, shadow yshift=-1ex}] \firstcircle;
+  \draw[fill=white,blur shadow={shadow xshift=0.4ex, shadow yshift=-1ex}] \secondcircle;
+  \fill[blueish] \firstcircle;
+  \fill[reddish]  \secondcircle;
+  \begin{scope}
+    \clip \firstcircle;
+    \clip \secondcircle;
+    \fill[white] \secondcircle;
+  \end{scope}
+  \begin{scope}[fill opacity=0.5]
+    \fill[blueish] \firstcircle;
+    \fill[reddish]  \secondcircle;
+  \end{scope}
+  \draw \firstcircle node[above] {モジュールの};
+  \draw \firstcircle node[below] {名前};
+  \draw \secondcircle node[above] {viewの};
+  \draw \secondcircle node[below] {名前};
+\end{tikzpicture}
+\end{center}
--- /dev/null
+++ cafeobj-1.5.5/doc/namespace/Makefile.in
@@ -0,0 +1,11 @@
+
+namespace.pdf: namespace.tex disunbig.tikz flat-module.tikz hir-module-namespace.tikz toplevel.tikz
+	xelatex namespace
+	xelatex namespace
+	xelatex namespace
+
+clean:
+	rm -f *.aux namespace.log namespace.toc namespace.out
+
+distclean:
+
