update 3b fixed
[ar1516.git] / a2 / 3.tex
index a6e47e9..d29e965 100644 (file)
--- a/a2/3.tex
+++ b/a2/3.tex
@@ -1 +1,80 @@
 \section{Problem 3}
+\emph{The goal of this problem is to exploit the power of the recom mended
+tools rather than elaborating the questions by hand.}
+\begin{enumerate}[a.]
+       \item\emph{In mathematics, a \emph{group} is defined to be a set $G$
+               with an element $I\in G$, a binary operator $∗$ and a unary
+               operator inv satisfying.
+               $$x*(y*z)=(x*y)*z, x*I=x\text{ and }x*inv(x)=I,$$
+               for all $x,y,z\in G$. Determine whether in every group each of
+               the four properties
+               $$I*x=x, inv(inv(x))=x, inv(x)*x=I\text{ and } x*y=y*x$$
+               holds for all $x,y\in G$. If a property does not hold,
+               determine the size of the smallest finite group for which it
+               does not hold.}
+       \item\emph{A term rewrite sysetm consists of the single rule
+               $$a(x,a(y,a(z,u)))\rightarrow a(y,a(z,a(x,u))),$$
+               in which $a$ is a binary symbol and $x,y,z,u$ are variables.
+               Moreover, there are constants $b,c,d,e,f,g$. Determine whether
+               $c$ and $d$ may swapped in $a(b,a(c,a(d,a(e,a(f,a(b,g))))))$ by
+               rewriting, that is, $a(b,a(c,a(d,a(e,a(f,a(b,g))))))$ rewrites
+               in a finite number of steps to
+               $a(b,a(d,a(c,a(e,a(f,a(b,g))))))$.}\\
+
+               When inspecting the rewrite rule more closely we see that the
+               entire structure of the formula stays the same and that only
+               the variables $x,y,z$ are changed in order. Because of this we
+               can simplify the rule to
+               $$x,y,z\rightarrow y,z,x$$
+               and we can simplify the question to asking whether 
+               $b,c,d,e,f,b$ rewrites to $b,d,c,e,f,b$.\\
+
+               Because of this the nature of the rewritten problem becomes
+               solvable by a symbolic model checker. We define for every
+               position $i\in\{0\ldots5\}$ a variable $p_i$ of the enumeration
+               type $\{b,c,d,e,f\}$. To keep track of the moves we define a
+               move $m\in\{0\ldots4\}$ variable that indicates the location of
+               the first variable or $0$ for the initial value.  The initial
+               values of the position variables is
+               $$p_0=b,p_1=c,p_2=d,p_3=e,p_4=f,p_5=b$$
+               There are four possible transitions and they are put in a
+               disjuction and shown below:
+               $$\begin{array}{rl}
+                       next(m)=1 \wedge & next(p_0)=p_1 \wedge next(p_1)=p_2
+                               \wedge next(p_2)=p_0 \wedge\\
+                       & next(p_3)=p_3 \wedge next(p_4)=p_4 \wedge next(p_5)=p_5\\
+
+                       next(m)=2 \wedge & next(p_0)=p_0 \wedge next(p_1)=p_2 
+                               \wedge next(p_2)=p_3 \wedge\\
+                       & next(p_3)=p_1 \wedge next(p_4)=p_4 \wedge next(p_5)=p_5\\
+
+                       next(m)=3 \wedge & next(p_0)=p_0 \wedge next(p_1)=p_1
+                               \wedge next(p_2)=p_3 \wedge\\
+                       & next(p_3)=p_4 \wedge next(p_4)=p_2 \wedge next(p_5)=p_5\\
+                       next(m)=4 \wedge & next(p_0)=p_0 \wedge next(p_1)=p_1
+                               \wedge next(p_2)=p_2 \wedge\\
+                       & next(p_3)=p_4 \wedge next(p_4)=p_5 \wedge next(p_5)=p_3
+               \end{array}$$
+
+               The LTL logic goal state would then be
+               $$\mathcal{G} \neg(p_0=b\wedge p_1=d\wedge p_2=c\wedge
+               p_3=e\wedge p_4=f\wedge p_5=b)$$
+
+               The solution described below is found by
+               \textsc{NuSMV} within $0.01$ seconds. Overline triples are the
+               ones changed in the next.
+               $$\begin{array}{rl}
+                       \overline{b,c,d},e,f,b 
+                               & \rightarrow c,d,\overline{b,e,f},b\\
+                               & \rightarrow c,d,e,\overline{f,b,b}\\
+                               & \rightarrow c,d,e,\overline{b,b,f}\\
+                               & \rightarrow c,\overline{d,e,b},f,b\\
+                               & \rightarrow c,\overline{e,b,d},f,b\\
+                               & \rightarrow \overline{c,b,d},e,f,b\\
+                               & \rightarrow b,\overline{d,c,e},f,b\\
+                               & \rightarrow b,c,e,d,f,b\\
+               \end{array}$$
+
+               
+
+\end{enumerate}