proof.tex 3.8 KB
Newer Older
Benoit Viguier's avatar
Benoit Viguier committed
1
2
\begin{tikzpicture}[textstyle/.style={black, anchor= south west, align=center, minimum height=0.45cm, text centered, font=\scriptsize}]

Benoit Viguier's avatar
Benoit Viguier committed
3
4
5
6
7
8
9
10

  % adapt line thickness and line width, if needed
  \tikzstyle{vecArrow} = [thick, decoration={markings,mark=at position
     1 with {\arrow[semithick]{open triangle 60}}},
     double distance=1.4pt, shorten >= 5.5pt,
     preaction = {decorate},
     postaction = {draw,line width=1.4pt, white,shorten >= 4.5pt}]

Benoit Viguier's avatar
Benoit Viguier committed
11
12
13
14
15
16
17
18
19
  % C code
  \begin{scope}[yshift=0 cm,xshift=0 cm]
    \draw (0,0) -- (0.4, 0.4) -- (1.25,0.4) -- (1.25,0) -- cycle;
    \draw (0,0) -- (1.25,0) -- (1.25,-1.25) -- (0, -1.25) -- cycle;
    \draw (0.3,-0.05) node[textstyle] {code};
    \draw (0.675,-0.5) node[textstyle, anchor=center] {\texttt{Prog}};
    \draw (1.25,-1.25) node[textstyle, anchor = south east] {\color{doc@lstfunctions}{.C}};
  \end{scope}

Benoit Viguier's avatar
Benoit Viguier committed
20

Benoit Viguier's avatar
Benoit Viguier committed
21
22
23
24
25
26
27
  % V code
  \begin{scope}[yshift=0 cm,xshift=2.5 cm]
    \draw (0,0) -- (0.4, 0.4) -- (1.25,0.4) -- (1.25,0) -- cycle;
    \draw (0,0) -- (1.25,0) -- (1.25,-1.25) -- (0, -1.25) -- cycle;
    \draw (0.3,-0.05) node[textstyle] {code};
    \draw (0.675,-0.5) node[textstyle, anchor=center] {\texttt{Prog}};
    \draw (1.25,-1.25) node[textstyle, anchor = south east] {\color{doc@lstfunctions}{.V}};
Benoit Viguier's avatar
Benoit Viguier committed
28
    % \draw (1.25,0)  node[anchor=south east, inner sep=0pt] {\includegraphics[width=.0125\textwidth]{img/coq_logo.png}};
Benoit Viguier's avatar
Benoit Viguier committed
29
30
31
32
33
  \end{scope}

  % VST Theorem
  \begin{scope}[yshift=0 cm,xshift=6 cm]
    \draw (0,0) -- (0.4, 0.4) -- (2.5,0.4) -- (2.5,0) -- cycle;
Benoit Viguier's avatar
Benoit Viguier committed
34
    \draw (0,0) -- (2.5,0) -- (2.5,-1.25) -- (0, -1.25) -- cycle;
Benoit Viguier's avatar
Benoit Viguier committed
35
    \draw (0.3,-0.05) node[textstyle] {Proof};
Benoit Viguier's avatar
Benoit Viguier committed
36
37
    \draw (1.25,-0.5) node[textstyle, anchor=center] {\{{\color{doc@lstnumbers}\textbf{Pre}}\} \texttt{Prog} \{{\color{doc@lstdirective}\textbf{Post}}\}};
    \draw (2.5,-1.25) node[textstyle, anchor = south east] {\color{doc@lstfunctions}{\checkmark}};
Benoit Viguier's avatar
Benoit Viguier committed
38
39
40
  \end{scope}

  % VST Spec
Benoit Viguier's avatar
Benoit Viguier committed
41
  \begin{scope}[yshift=-2.5 cm,xshift=3 cm]
Benoit Viguier's avatar
Benoit Viguier committed
42
43
44
45
    \draw (0,0) -- (0.4, 0.4) -- (2,0.4) -- (2,0) -- cycle;
    \draw (0,0) -- (2,0) -- (2,-2) -- (0, -2) -- cycle;
    \draw (0.3,-0.05) node[textstyle] {Specification};
    \draw (1,-1) node[textstyle, anchor=center, align=left] {
Benoit Viguier's avatar
Benoit Viguier committed
46
      {\color{doc@lstnumbers}\textbf{Pre}}:\\
Benoit Viguier's avatar
Benoit Viguier committed
47
      ~~$n$, $P$\\
Benoit Viguier's avatar
Benoit Viguier committed
48
      {\color{doc@lstdirective}\textbf{Post}}:\\
Benoit Viguier's avatar
Benoit Viguier committed
49
50
51
52
      ~~\texttt{CSM}$(n,P)$};
  \end{scope}

  % Definition of CSM
Benoit Viguier's avatar
Benoit Viguier committed
53
  \begin{scope}[yshift=-4.5 cm,xshift=0 cm]
Benoit Viguier's avatar
Benoit Viguier committed
54
    \draw (0,0) -- (0.4, 0.4) -- (2,0.4) -- (2,0) -- cycle;
Benoit Viguier's avatar
Benoit Viguier committed
55
    \draw (0,0) -- (2,0) -- (2,-1) -- (0, -1) -- cycle;
Benoit Viguier's avatar
Benoit Viguier committed
56
    \draw (0.3,-0.05) node[textstyle] {Definition};
Benoit Viguier's avatar
Benoit Viguier committed
57
    \draw (1,-0.5) node[textstyle, anchor=center] {\texttt{CSM}};
Benoit Viguier's avatar
Benoit Viguier committed
58
59
60
  \end{scope}

  % Spec of Curve nP
Benoit Viguier's avatar
Benoit Viguier committed
61
  \begin{scope}[yshift=-7 cm,xshift=0 cm]
Benoit Viguier's avatar
Benoit Viguier committed
62
    \draw (0,0) -- (0.4, 0.4) -- (2,0.4) -- (2,0) -- cycle;
Benoit Viguier's avatar
Benoit Viguier committed
63
    \draw (0,0) -- (2,0) -- (2,-1) -- (0, -1) -- cycle;
Benoit Viguier's avatar
Benoit Viguier committed
64
    \draw (0.3,-0.05) node[textstyle] {Definition};
65
    \draw (1,-0.5) node[textstyle, anchor=center] {$n \cdot P$};
Benoit Viguier's avatar
Benoit Viguier committed
66
67
68
  \end{scope}

  % Correctness Theorem
Benoit Viguier's avatar
Benoit Viguier committed
69
  \begin{scope}[yshift=-6.5 cm,xshift=6 cm]
Benoit Viguier's avatar
Benoit Viguier committed
70
    \draw (0,0) -- (0.4, 0.4) -- (2.5,0.4) -- (2.5,0) -- cycle;
Benoit Viguier's avatar
Benoit Viguier committed
71
    \draw (0,0) -- (2.5,0) -- (2.5,-1.5) -- (0, -1.5) -- cycle;
Benoit Viguier's avatar
Benoit Viguier committed
72
    \draw (0.3,-0.05) node[textstyle] {Proof};
Benoit Viguier's avatar
Benoit Viguier committed
73
    \draw (2.5,-1.5) node[textstyle, anchor = south east] {\color{doc@lstfunctions}{\checkmark}};
74
    \draw (1.25,-0.75) node[textstyle, anchor=center] {{\color{doc@lstnumbers}\textbf{Pre}} $\implies$\\$\text{\texttt{CSM}}(n,P) = n \cdot P$};
Benoit Viguier's avatar
Benoit Viguier committed
75
76
  \end{scope}

Benoit Viguier's avatar
Benoit Viguier committed
77
78
79
80
81
82
  \path [thick, double, ->] (1.25,-0.5) edge (2.5, -0.5);
  \path [thick, double, ->] (3.75,-0.5) edge (6, -0.5);
  \path [thick, double, ->] (5,-3.5) edge [out=0, in=-90] (6.5, -1.25);
  \path [thick, double, ->] (2,-5) edge  [out=0, in=-180] (3, -3.5);
  \path [thick, double, ->] (2,-5) edge [out=0, in=-180] (6, -7);
  \path [thick, double, ->] (2,-7.5) edge [out=0, in=-180] (6, -7.5);
Benoit Viguier's avatar
Benoit Viguier committed
83
84

\end{tikzpicture}