From c1a2d537de7ff3d730d26658daa822b2f03ea110 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Sat, 20 May 2017 13:39:23 +0200 Subject: [PATCH] restructure results --- appendix-device-interface.tex | 2 +- methods.tex | 70 ---------------------------- methods.top.tex | 23 ++++++++- methods.arch.tex => results.arch.tex | 0 results.mtask.tex | 67 ++++++++++++++++++++++++++ results.tex | 3 ++ thesis.tex | 7 ++- 7 files changed, 97 insertions(+), 75 deletions(-) rename methods.arch.tex => results.arch.tex (100%) create mode 100644 results.mtask.tex create mode 100644 results.tex diff --git a/appendix-device-interface.tex b/appendix-device-interface.tex index 8786570..d4872a8 100644 --- a/appendix-device-interface.tex +++ b/appendix-device-interface.tex @@ -1 +1 @@ -\lstinputlisting[language=C]{listings/interface.h} +\lstinputlisting[language=C,caption{Full device interface}]{listings/interface.h} diff --git a/methods.tex b/methods.tex index e25809c..9436474 100644 --- a/methods.tex +++ b/methods.tex @@ -1,73 +1,3 @@ \input{methods.top.tex} \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 diff --git a/methods.top.tex b/methods.top.tex index 174a783..bc94003 100644 --- a/methods.top.tex +++ b/methods.top.tex @@ -87,8 +87,8 @@ basic combinators are shown in Listing~\ref{lst:combinators}. onValue (Value a _) = Just (f a) onValue _ = Nothing - onStable (Value a True) = Just (f a) - onStable _ = Nothing + onStable (Value a True) = Just (f a) + onStable _ = Nothing \end{lstlisting} \item Parallel: @@ -118,4 +118,23 @@ basic combinators are shown in Listing~\ref{lst:combinators}. \end{lstlisting} \subsection{\acrlongpl{SDS}} +\Glspl{SDS} are an abstraction over resources that are available in the world +or in the \gls{iTasks} system. The shared data can be a file on disk, it can be +the time, a random integer or just some data stored in memory. The actual +\gls{SDS} is just a record containing functions on how to read and write the +source. In these functions the \CI{*World} is available and therefore it can +interact with the outside world. The \CI{*IWorld} is also available and +therefore the functions can also access other shares, possibly combining them. + +The basic operations for \glspl{SDS} are get, set and update. The signatures +for these functions are shown in Listing~\ref{lst:shares}. All of the +operations are atomic in the sense that during reading no other tasks are +executed. + +\begin{lstlisting}[% + language=Clean,label={lst:shares},caption={\Gls{SDS} functions}] +get :: (ReadWriteShared r w) -> Task r | iTask r +set :: w (ReadWriteShared r w) -> Task w | iTask w +upd :: (r -> w) (ReadWriteShared r w) -> Task w | iTask r & iTask w +\end{lstlisting} diff --git a/methods.arch.tex b/results.arch.tex similarity index 100% rename from methods.arch.tex rename to results.arch.tex diff --git a/results.mtask.tex b/results.mtask.tex new file mode 100644 index 0000000..18c5a06 --- /dev/null +++ b/results.mtask.tex @@ -0,0 +1,67 @@ +\section{mTask} +\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 diff --git a/results.tex b/results.tex new file mode 100644 index 0000000..3457615 --- /dev/null +++ b/results.tex @@ -0,0 +1,3 @@ +\input{results.arch.tex} + +\input{results.mtask.tex} diff --git a/thesis.tex b/thesis.tex index eb150e9..b08f29a 100644 --- a/thesis.tex +++ b/thesis.tex @@ -66,7 +66,10 @@ \input{methods.tex} \chapter{Results}\label{chp:results} -\chapter{Conclusion \& Discussion}\label{chp:conclusion} +\input{results.tex} + +\chapter{Conclusion \& Discussion} +\label{chp:conclusion} \appendix\label{chp:appendix} \chapter{Planning}\label{app:planning} @@ -80,7 +83,7 @@ \cleardoublepage{} \phantomsection{} -\addcontentsline{toc}{chapter}{List of \ldots} +\addcontentsline{toc}{chapter}{Lists of \ldots} \begingroup \let\clearpage\relax \listoffigures -- 2.20.1