18c5a06304bc401fd8a115483553510a2a03ccbe
[msc-thesis1617.git] / results.mtask.tex
1 \section{mTask}
2 \subsection{\gls{EDSL}}
3 %The \gls{mTask}-\gls{EDSL} contains several classes that need to be implemented
4 %by a type for it to be an \gls{mTask}. For numeric and boolean arithmetic the
5 %classes \texttt{arith} and \texttt{boolExpr} are available and listed in a
6 %shortened version in Listing~\ref{lst:arithbool}. All classes are to be
7 %implemented by types of kind \texttt{*->*->*} a type \texttt{v t p},
8 %respectively a view with a type and the role.
9 %
10 %\texttt{lit} lifts a constant to the \gls{mTask} domain. For a type to be a
11 %valid \gls{mTask} type it needs to implement the \texttt{mTaskType} class. The
12 %binary operators work as expected.
13
14 \begin{lstlisting}[language=Clean,label={lst:arithbool},
15 caption={Basic classes for expressions}]
16 class mTaskType a | toByteCode, fromByteCode, iTask, TC a
17
18 class arith v where
19 lit :: t -> v t Expr | mTaskType t
20 (+.) infixl 6 :: (v t p) (v t q) -> v t Expr | type, +, zero t & isExpr p & isExpr q
21 ...
22 class boolExpr v where
23 (&.) infixr 3 :: (v Bool p) (v Bool q) -> v Bool Expr | isExpr p & isExpr q
24 Not :: (v Bool p) -> v Bool Expr | isExpr p
25 ...
26 (==.) infix 4 :: (v a p) (v a q) -> v Bool Expr | ==, toCode a & isExpr p & isExpr q
27 \end{lstlisting}
28 %
29 %
30 %\subsection{Tasks}
31 %
32 %\subsection{Shares}
33 %Shares can live on multiple clients at the same time. For every share created
34 %for an \gls{mTask} a real \gls{SDS} is created that mirrors the value on the
35 %client. All shares currently in use are stored in a system-wide \gls{SDS} in
36 %such a way that the actual share can be retrieved at any moment. All shares
37 %have a unique numeric identifier and an initial value.
38 %
39 %\begin{lstlisting}[language=Clean,label={lst:sharespec}, caption={\acrlong{SDS}}]
40 %:: BCValue = E.e: BCValue e & mTaskType e
41 %:: MTaskShareType = MTaskWithShare String | MTaskLens String
42 %:: MTaskShare =
43 % {withTask :: [String]
44 % ,withDevice :: [String]
45 % ,identifier :: Int
46 % ,realShare :: MTaskShareType
47 % ,value :: BCValue
48 % }
49 %
50 %sdsStore :: Shared [MTaskShare]
51 %\end{lstlisting}
52 %\todo{Do something with the sharetype}
53 %
54 %\subsection{Communication}
55 %%\todo{Handshake, device specification sending, spec.c}
56 %%\todo{mTaskDevice class interface}
57 %
58 %\section{mTasks}
59 %\subsection{\gls{EDSL}}
60 %\todo{Show the classes}
61 %
62 %\subsection{Shares}
63 %\todo{Show the types and why}
64 %
65 %Shares are used to store the values
66 %
67 %Shares all have