proof.tex 4.41 KB
 Benoit Viguier committed Jul 12, 2019 1 2 \begin{tikzpicture}[textstyle/.style={black, anchor= south west, align=center, minimum height=0.45cm, text centered, font=\scriptsize}]  Benoit Viguier committed Jul 16, 2019 3 4 5  % adapt line thickness and line width, if needed  Benoit Viguier committed Sep 18, 2019 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  \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 committed Jul 12, 2019 25  % C code  Benoit Viguier committed Sep 18, 2019 26  \begin{scope}[yshift=-0.25 cm,xshift=3 cm]  Benoit Viguier committed Jul 12, 2019 27 28 29 30 31 32 33 34  \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 committed Sep 18, 2019 35  \begin{scope}[yshift=-0.25 cm,xshift=5 cm]  Benoit Viguier committed Jul 12, 2019 36 37 38 39 40  \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 committed Jul 15, 2019 41  % \draw (1.25,0) node[anchor=south east, inner sep=0pt] {\includegraphics[width=.0125\textwidth]{img/coq_logo.png}};  Benoit Viguier committed Jul 12, 2019 42 43  \end{scope}  Benoit Viguier committed Sep 20, 2019 44  \path [thick, dotted, double, ->] (4.25,-0.75) edge (5, -0.75);  Benoit Viguier committed Jul 12, 2019 45 46  % VST Spec  Benoit Viguier committed Sep 18, 2019 47  \begin{scope}[yshift=-3 cm,xshift=3 cm]  Benoit Viguier committed Jul 12, 2019 48 49 50 51  \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 committed Jul 15, 2019 52  {\color{doc@lstnumbers}\textbf{Pre}}:\\  Benoit Viguier committed Sep 02, 2019 53  ~~$n \in \N$,\\  Benoit Viguier committed Sep 18, 2019 54  % ~~$n \in$ \TNaCles{u8[32]},\\  Benoit Viguier committed Sep 02, 2019 55  ~~$P \in E(\F{p^2})$\\  Benoit Viguier committed Sep 18, 2019 56  % ~~$P \in$ \TNaCles{u8[32]}\\  Benoit Viguier committed Jul 15, 2019 57  {\color{doc@lstdirective}\textbf{Post}}:\\  Benoit Viguier committed Sep 18, 2019 58  ~~\texttt{RFC}$(n,P)$};  Benoit Viguier committed Jul 12, 2019 59 60  \end{scope}  Benoit Viguier committed Sep 18, 2019 61 62 63 64 65 66 67  % 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 committed Jul 12, 2019 68 69  \end{scope}  Benoit Viguier committed Sep 18, 2019 70 71 72 73 74 75 76 77  \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 committed Jul 12, 2019 78  % Spec of Curve nP  Benoit Viguier committed Sep 19, 2019 79  \begin{scope}[yshift=-7.5 cm,xshift=0 cm]  Benoit Viguier committed Sep 18, 2019 80 81  \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 committed Jul 12, 2019 82  \draw (0.3,-0.05) node[textstyle] {Definition};  Benoit Viguier committed Sep 18, 2019 83  \draw (0.875,-0.5) node[textstyle, anchor=center] {$n \cdot P$};  Benoit Viguier committed Jul 12, 2019 84 85 86  \end{scope} % Correctness Theorem  Benoit Viguier committed Sep 19, 2019 87  \begin{scope}[yshift=-7 cm,xshift=6 cm]  Benoit Viguier committed Jul 12, 2019 88  \draw (0,0) -- (0.4, 0.4) -- (2.5,0.4) -- (2.5,0) -- cycle;  Benoit Viguier committed Jul 15, 2019 89  \draw (0,0) -- (2.5,0) -- (2.5,-1.5) -- (0, -1.5) -- cycle;  Benoit Viguier committed Jul 12, 2019 90  \draw (0.3,-0.05) node[textstyle] {Proof};  Benoit Viguier committed Jul 15, 2019 91  \draw (2.5,-1.5) node[textstyle, anchor = south east] {\color{doc@lstfunctions}{\checkmark}};  Benoit Viguier committed Sep 18, 2019 92  \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 committed Jul 12, 2019 93 94  \end{scope}  Benoit Viguier committed Sep 18, 2019 95 96  \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);  Benoit Viguier committed Sep 19, 2019 97 98 99 100  \path [thick, double] (2.25, -4) edge [out=-90, in=90] (2.25, -7); \path [thick, double] (2.25, -7) edge [out=-90, in=-180] (3, -7.75); \path [thick, double, ->] (3, -7.75) edge [out=0, in=-180] (6, -7.75); \path [thick, double, ->] (1.75,-8) edge [out=0, in=-180] (6, -8);  Benoit Viguier committed Sep 18, 2019 101   Benoit Viguier committed Jul 12, 2019 102 103  \end{tikzpicture}