proof.tex 4.67 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
20
21
22
23
24
25
26
27
28
29
   \path [thick, dashed] (2.5,1) edge +(0,-6.75);
   \draw (2.5,1) node[anchor=north east] {\sref{sec:Coq-RFC}};
   \draw (2.5,1) node[anchor=north west] {\sref{sec:C-Coq}};
   \path [thick, dashed] (0,-5.75) edge +(8.5,0);
   \draw (8.5,-5.75) node[anchor=north east] {\sref{sec:maths}};

  % SECTION III

  % Definition of RFC
  \begin{scope}[yshift=-3 cm,xshift=0 cm]
   \draw (0,0) -- (0.4, 0.4) -- (1.75,0.4) -- (1.75,0) -- cycle;
   \draw (0,0) -- (1.75,0) -- (1.75,-1) -- (0, -1) -- cycle;
   \draw (0.3,-0.05) node[textstyle] {Definition};
   \draw (0.875,-0.5) node[textstyle, anchor=center] {\texttt{RFC}};
   \draw (1.75,-1) node[textstyle, anchor = south east] {\color{doc@lstfunctions}{.V}};
  \end{scope}

   % SECTION IV

Benoit Viguier's avatar
Benoit Viguier committed
30
  % C code
Benoit Viguier's avatar
Benoit Viguier committed
31
  \begin{scope}[yshift=-0.25 cm,xshift=3 cm]
Benoit Viguier's avatar
Benoit Viguier committed
32
33
34
35
36
37
38
39
    \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}

  % V code
Benoit Viguier's avatar
Benoit Viguier committed
40
  \begin{scope}[yshift=-0.25 cm,xshift=5 cm]
Benoit Viguier's avatar
Benoit Viguier committed
41
42
43
44
45
    \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
46
    % \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
47
48
  \end{scope}

Benoit Viguier's avatar
Benoit Viguier committed
49
  \path [thick, double, ->] (4.25,-0.75) edge (5, -0.75);
Benoit Viguier's avatar
Benoit Viguier committed
50
51

  % VST Spec
Benoit Viguier's avatar
Benoit Viguier committed
52
  \begin{scope}[yshift=-3 cm,xshift=3 cm]
Benoit Viguier's avatar
Benoit Viguier committed
53
54
55
56
    \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
57
      {\color{doc@lstnumbers}\textbf{Pre}}:\\
58
      ~~$n \in \N$,\\
Benoit Viguier's avatar
Benoit Viguier committed
59
      % ~~$n \in$ \TNaCles{u8[32]},\\
60
      ~~$P \in E(\F{p^2})$\\
Benoit Viguier's avatar
Benoit Viguier committed
61
      % ~~$P \in$ \TNaCles{u8[32]}\\
Benoit Viguier's avatar
Benoit Viguier committed
62
      {\color{doc@lstdirective}\textbf{Post}}:\\
Benoit Viguier's avatar
Benoit Viguier committed
63
      ~~\texttt{RFC}$(n,P)$};
Benoit Viguier's avatar
Benoit Viguier committed
64
65
  \end{scope}

Benoit Viguier's avatar
Benoit Viguier committed
66
67
68
69
70
71
72
  % VST Theorem
  \begin{scope}[yshift=-3 cm,xshift=6 cm]
    \draw (0,0) -- (0.4, 0.4) -- (2.5,0.4) -- (2.5,0) -- cycle;
    \draw (0,0) -- (2.5,0) -- (2.5,-1.25) -- (0, -1.25) -- cycle;
    \draw (0.3,-0.05) node[textstyle] {Proof};
    \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
73
74
  \end{scope}

Benoit Viguier's avatar
Benoit Viguier committed
75
76
77
78
79
80
81
82
  \path [thick, double] (5.625,-1.5) edge [out=-90, in=90] (5.625, -2.5);
  \path [thick, double, ->] (5.625, -2.5) edge [out=-90, in=180] (6, -3.5);
  \path [thick, double, ->] (5,-3.75) edge [out=0, in=180] (6, -3.75);



  % SECTION V

Benoit Viguier's avatar
Benoit Viguier committed
83
  % Spec of Curve nP
Benoit Viguier's avatar
Benoit Viguier committed
84
85
86
  \begin{scope}[yshift=-7.25 cm,xshift=0 cm]
    \draw (0,0) -- (0.4, 0.4) -- (1.75,0.4) -- (1.75,0) -- cycle;
    \draw (0,0) -- (1.75,0) -- (1.75,-1) -- (0, -1) -- cycle;
Benoit Viguier's avatar
Benoit Viguier committed
87
    \draw (0.3,-0.05) node[textstyle] {Definition};
Benoit Viguier's avatar
Benoit Viguier committed
88
    \draw (0.875,-0.5) node[textstyle, anchor=center] {$n \cdot P$};
Benoit Viguier's avatar
Benoit Viguier committed
89
90
91
  \end{scope}

  % Correctness Theorem
Benoit Viguier's avatar
Benoit Viguier committed
92
  \begin{scope}[yshift=-6.75 cm,xshift=6 cm]
Benoit Viguier's avatar
Benoit Viguier committed
93
    \draw (0,0) -- (0.4, 0.4) -- (2.5,0.4) -- (2.5,0) -- cycle;
Benoit Viguier's avatar
Benoit Viguier committed
94
    \draw (0,0) -- (2.5,0) -- (2.5,-1.5) -- (0, -1.5) -- cycle;
Benoit Viguier's avatar
Benoit Viguier committed
95
    \draw (0.3,-0.05) node[textstyle] {Proof};
Benoit Viguier's avatar
Benoit Viguier committed
96
    \draw (2.5,-1.5) node[textstyle, anchor = south east] {\color{doc@lstfunctions}{\checkmark}};
Benoit Viguier's avatar
Benoit Viguier committed
97
    \draw (1.25,-0.75) node[textstyle, anchor=center] {{\color{doc@lstnumbers}\textbf{Pre}} $\implies$\\$\text{\texttt{RFC}}(n,P) = n \cdot P$};
Benoit Viguier's avatar
Benoit Viguier committed
98
99
  \end{scope}

Benoit Viguier's avatar
Benoit Viguier committed
100
101
102
103
104
105
106
  \path [thick, double, ->] (1.75,-3.5) edge  [out=0, in=-180] (3, -3.5);
  \path [thick, double] (1.75,-3.5) edge [out=0, in=90] (2.25, -4);
  \path [thick, double] (2.25, -4) edge [out=-90, in=90] (2.25, -6.75);
  \path [thick, double] (2.25, -6.75) edge [out=-90, in=-180] (3, -7.5);
  \path [thick, double, ->] (3, -7.5) edge [out=0, in=-180] (6, -7.5);
  \path [thick, double, ->] (1.75,-7.75) edge [out=0, in=-180] (6, -7.75);

Benoit Viguier's avatar
Benoit Viguier committed
107
108

\end{tikzpicture}