Skip to content
Snippets Groups Projects
Commit c145059a authored by Allan Blanchard's avatar Allan Blanchard
Browse files

[wp/doc] Document new Overflow behavior

parent 7be87e6c
No related branches found
No related tags found
No related merge requests found
...@@ -487,19 +487,25 @@ $G(n) \equiv P(n)\Longrightarrow\,Q(n)$: ...@@ -487,19 +487,25 @@ $G(n) \equiv P(n)\Longrightarrow\,Q(n)$:
\end{array}} \] \end{array}} \]
\paragraph{Overflow} Integer Conversions \\ \paragraph{Overflow} Integer Conversions \\
This tactic rewrites machine integer conversions by identity, This tactic split machine integer conversions into three cases: value in integer
providing the converted value is in available range. The tactic applies on expression range, lower than range and upper than range. The tactic applies on expression
with pattern $\mathtt{to\_iota(e)}$ where \texttt{iota} is a a machine-integer name, with pattern $\mathtt{to\_iota(e)}$ where \texttt{iota} is a a machine-integer
\emph{eg.} \texttt{to\_uint32}. name, \emph{eg.} \texttt{to\_uint32}.
\[\TACTIC{\Delta\models G}{% \[\TACTIC{\Delta\models G}{%
\begin{array}[t]{rcl} \begin{array}[t]{rcl}
\Delta\phantom{)} &\models & a \leq e \leq b \\ \sigma_{id}(\Delta) & \models & low \leq e \leq up \Rightarrow \sigma_{id}(G) \\
\sigma(\Delta) & \models & \sigma(G) \sigma_{+}(\Delta) & \models & low < e \Rightarrow \sigma_{+}(G) \\
\sigma_{-}(\Delta) & \models & e < up \Rightarrow \sigma_{-}(G)
\end{array} \end{array}
}\] }\]
where $\sigma = [ \mathtt{to\_iota}(e) \mapsto e ]$ and $[a..b]$ is the range where
of the \texttt{iota} integer domain. \begin{itemize}
\item $[low..up]$ is the range of the \texttt{iota} integer domain,
\item $\sigma_{id} = [ \mathtt{to\_iota}(e) \mapsto e ]$,
\item $\sigma_{+} = [ \mathtt{to\_iota}(e) \mapsto \mathtt{overflow}(e) ]$,
\item $\sigma_{-} = [ \mathtt{to\_iota}(e) \mapsto \mathtt{overflow}(e) ]$.
\end{itemize}
\paragraph{Range} Enumerate a range of values for an integer term\\ \paragraph{Range} Enumerate a range of values for an integer term\\
The user select any integer expression $e$ in the proof, and a range of numerical values $a\ldots b$. The proof goes by case for each $e=a\ldots e=b$, plus the side cases $e<a$ and $e>b$: The user select any integer expression $e$ in the proof, and a range of numerical values $a\ldots b$. The proof goes by case for each $e=a\ldots e=b$, plus the side cases $e<a$ and $e>b$:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment