X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=methods.tex;h=e25809c7034ec18fa86a88fbf8f1918e3d4e0f4c;hb=a0fc5b24e17c83d05fa5cb95e855e784abac8f3e;hp=e510ecbe898a66943bd257ece7c14d6594f828bf;hpb=c3f505fc05f88dd9b36b433b615de6be08977601;p=msc-thesis1617.git diff --git a/methods.tex b/methods.tex index e510ecb..e25809c 100644 --- a/methods.tex +++ b/methods.tex @@ -1,5 +1,73 @@ +\input{methods.top.tex} -\todo{What is IoT} -\todo{What is top} +\input{methods.dsl.tex} + +\input{methods.arch.tex} \section{mTasks} +\subsection{\gls{EDSL}} +The \gls{mTask}-\gls{EDSL} contains several classes that need to be implemented +by a type for it to be an \gls{mTask}. For numeric and boolean arithmetic the +classes \texttt{arith} and \texttt{boolExpr} are available and listed in a +shortened version in Listing~\ref{lst:arithbool}. All classes are to be +implemented by types of kind \texttt{*->*->*} a type \texttt{v t p}, +respectively a view with a type and the role. + +\texttt{lit} lifts a constant to the \gls{mTask} domain. For a type to be a +valid \gls{mTask} type it needs to implement the \texttt{mTaskType} class. The +binary operators work as expected. + +\begin{lstlisting}[language=Clean,label={lst:arithbool}, + caption={Basic classes for expressions}] +class mTaskType a | toByteCode, fromByteCode, iTask, TC a + +class arith v where + lit :: t -> v t Expr | mTaskType t + (+.) infixl 6 :: (v t p) (v t q) -> v t Expr | type, +, zero t & isExpr p & isExpr q + ... +class boolExpr v where + (&.) infixr 3 :: (v Bool p) (v Bool q) -> v Bool Expr | isExpr p & isExpr q + Not :: (v Bool p) -> v Bool Expr | isExpr p + ... + (==.) infix 4 :: (v a p) (v a q) -> v Bool Expr | ==, toCode a & isExpr p & isExpr q +\end{lstlisting} + + +\subsection{Tasks} + +\subsection{Shares} +Shares can live on multiple clients at the same time. For every share created +for an \gls{mTask} a real \gls{SDS} is created that mirrors the value on the +client. All shares currently in use are stored in a system-wide \gls{SDS} in +such a way that the actual share can be retrieved at any moment. All shares +have a unique numeric identifier and an initial value. + +\begin{lstlisting}[language=Clean,label={lst:sharespec}, caption={\acrlong{SDS}}] +:: BCValue = E.e: BCValue e & mTaskType e +:: MTaskShareType = MTaskWithShare String | MTaskLens String +:: MTaskShare = + {withTask :: [String] + ,withDevice :: [String] + ,identifier :: Int + ,realShare :: MTaskShareType + ,value :: BCValue + } + +sdsStore :: Shared [MTaskShare] +\end{lstlisting} +\todo{Do something with the sharetype} + +\subsection{Communication} +%\todo{Handshake, device specification sending, spec.c} +%\todo{mTaskDevice class interface} + +\section{mTasks} +\subsection{\gls{EDSL}} +\todo{Show the classes} + +\subsection{Shares} +\todo{Show the types and why} + +Shares are used to store the values + +Shares all have