summaryrefslogtreecommitdiffstats
path: root/archive
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-11-18 18:22:32 +0000
committerYann Herklotz <git@yannherklotz.com>2020-11-18 18:22:40 +0000
commit8681e9c5ca5fb20610bbbc6f1a7fb9de2b6da68b (patch)
tree5d1a0df76b7423ac95b461c01131dabffb8abab5 /archive
parent545b10d1daef259f1baa496420723d7f74726023 (diff)
downloadoopsla21_fvhls-8681e9c5ca5fb20610bbbc6f1a7fb9de2b6da68b.tar.gz
oopsla21_fvhls-8681e9c5ca5fb20610bbbc6f1a7fb9de2b6da68b.zip
Add proof
Diffstat (limited to 'archive')
-rw-r--r--archive/proof.tex9
1 files changed, 9 insertions, 0 deletions
diff --git a/archive/proof.tex b/archive/proof.tex
new file mode 100644
index 0000000..9e962b7
--- /dev/null
+++ b/archive/proof.tex
@@ -0,0 +1,9 @@
+Firstly, as the input representation is a map, all the keys of the map will be unique, which will be translated to the matched expressions in the case statement. In addition to that, the assumption is made that every possible evaluation of the state value will give a valid state, meaning the key will be present in the map. Both of these observations mean that after the translation, for every possible value of the state, the case statement will be able to match an expression and enter the correct statement. As each key is unique, if the state matches a case expression, then this also means that this is the only case expression that it could match, and it therefore has to be the correct case expression which contains the same statement as the map.
+
+However, the proof of uniqueness of the keys only works if the translation function is \emph{injective}, meaning that the function will result in distinct outputs for all possible inputs. Otherwise, the proof of uniqueness of the keys for the input would not translate to a uniqueness of possible case expression matches in the output. However, in our case the translation function is actually not injective, even though it might at first seem like it, because the state is stored as an integer, whereas the map is addressable by any positive number. This means that if the positive number is greater than the maximum value that can be stored in the integer, the overflow would result in the wrong states being accessed. To make the function injective, we therefore have to prove that the input positive number is never greater than $2^{32}-1$ so that the uniqueness property also holds for the output.
+
+\begin{align*}
+ &\forall\ (S_{1} : \texttt{3AC.state})\ t\ S_{2},\ S_{1} \xrightarrow{t} S_{2}\\
+ &\implies \forall\ (R_{1} : \texttt{HTL.state}),\ \texttt{match\_states}\ S_{1}\ R_{1}\\
+ &\implies \exists R_{2},\ R_{1} \xrightarrow{t}_{+} R_{2} \land \texttt{match\_states}\ S_{2}\ R_{2}.
+\end{align*}