From: Mart Lubbers Date: Mon, 22 May 2017 07:33:10 +0000 (+0200) Subject: update X-Git-Tag: hand-in~121 X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=a3a00cd9df798eda92291a2f3f6c922bdfdfdac2;p=msc-thesis1617.git update --- diff --git a/conclusion.tex b/conclusion.tex new file mode 100644 index 0000000..8d69ebc --- /dev/null +++ b/conclusion.tex @@ -0,0 +1,5 @@ +\section{Conclusion} + +\section{Discussion} + +\section{Future Research} diff --git a/introduction.tex b/introduction.tex index 4d1dded..79f6c1d 100644 --- a/introduction.tex +++ b/introduction.tex @@ -41,8 +41,8 @@ at runtime and information can be exchanged. \section{Document structure} The structure of the thesis is as follows. -Chapter~\ref{chp:introduction} contains the problem statement, motivation and -the structure of the document. +Chapter~\ref{chp:introduction} contains the problem statement, motivation, +literature embedding and the structure of the document. Chapter~\ref{chp:methods} describes the foundations on which the implementation is built. Chapter~\ref{chp:results} shows the new techniques deviced and an example @@ -53,3 +53,7 @@ Appendix~\ref{app:communication-protocol} shows the concrete protocol used for communicating between the server and client. Appendix~\ref{app:device-interface} shows the concrete interface for the devices. + +\section{Relevant research} +\todo{Hier alle citaten en achtergrond doen} +Ivory, firmata, dsl spul, etc. diff --git a/methods.mtask.tex b/methods.mtask.tex index 837933d..941d95e 100644 --- a/methods.mtask.tex +++ b/methods.mtask.tex @@ -1,15 +1,15 @@ \section{mTask} The \gls{mTask}-\gls{EDSL} is the basis on which the system is built. The -\gls{mTask} was created by Koopman et al.\ to support several views such as an -\gls{iTasks} simulation and a \gls{C}-code generator. The \gls{EDSL} was -designed to generate a ready to compile \gls{TOP}-like system for +\gls{mTask}-\gls{EDSL} was created by Koopman et al.\ to support several views +such as an \gls{iTasks} simulation and a \gls{C}-code generator. The \gls{EDSL} +was designed to generate a ready to compile \gls{TOP}-like system for microcontrollers such as the Arduino\cite{koopman_type-safe_nodate}% \cite{plasmeijer_shallow_2016}. The \gls{mTask}-\gls{EDSL} is a shallowly embedded class based \gls{EDSL} and therefore it is very suitable to have a new backend that partly implements the given classes. The following subsections show the details of the \gls{EDSL} -that are used in the extension. The parts of the \gls{EDSL} that are not used +that are used in this extension. The parts of the \gls{EDSL} that are not used will not be discussed and the details of those parts can be found in the cited literature. @@ -36,6 +36,13 @@ instance isExpr Upd instance isExpr Expr \end{lstlisting} +\subsection{Semantics} +\gls{mTask} do not behave like functions but more like +\gls{iTasks}-\glspl{Task}. When an \gls{mTask} is created it returns immediatly +and the \gls{Task} will be executed sometime in the future. \glspl{Task} can +run at an interval and they can start other tasks. +\todo{Meer uitwijden over de mTask semantiek} + \subsection{Expressions} Expressions in the \gls{mTask}-\gls{EDSL} are divided into two types, namely boolean expressions and arithmetic expressions. The class of arithmetic @@ -61,7 +68,24 @@ class boolExpr v where \end{lstlisting} \subsection{Control flow} -\todo{Write this} +Looping of \glspl{Task} happens because \glspl{Task} are launched at regular +intervals or relaunch themselves. Therefore there is no need for loop control +flow functionality such as \CI{While} or \CI{For} constructions. The main +control flow is the sequence operator and the \CI{If} statement. Both are shown +in Listing~\ref{lst:control}. The first class of \CI{If} statements describe +the regular if statement. The expressions given can have any role. The +functional dependency on \CI{s} determines the return type of the statement. +The sequence operator is very straightforward and just ties the two expressions +together in sequence. + +\begin{lstlisting}[% + language=Clean,label={lst:control},caption={Control flow operators}] +class If v q r ~s where + If :: (v Bool p) (v t q) (v t r) -> v t s | ... + +class seq v where + (:.) infixr 0 :: (v t p) (v u q) -> v u Stmt | ... +\end{lstlisting} \subsection{Input/Output and class extensions} All expressions that have an \CI{Upd} role can be assigned to. Examples of such diff --git a/results.arch.tex b/results.arch.tex index cd9918d..1f33b15 100644 --- a/results.arch.tex +++ b/results.arch.tex @@ -51,9 +51,6 @@ of. The exact specification is listed in Listing~\ref{lst:devicespec} } \end{lstlisting} -\subsection{Memory Management} -\todo{Explain specification, combine task and share space} - \subsection{Communication} The communication to and fro a device runs via a single \gls{SDS}. Every device has a specific resource that is used to connect to the device. The diff --git a/results.mtask.tex b/results.mtask.tex index 18c5a06..aaa2515 100644 --- a/results.mtask.tex +++ b/results.mtask.tex @@ -1,67 +1,16 @@ \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. +\subsection{Semantics} +\todo{Uitleggen wat het systeem precies doet} -\begin{lstlisting}[language=Clean,label={lst:arithbool}, - caption={Basic classes for expressions}] -class mTaskType a | toByteCode, fromByteCode, iTask, TC a +\subsection{Extension on the \gls{mTask}-\gls{EDSL}} +\todo{Aanpassingen aan de mTask DSL} -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 +\section{iTasks} +\subsection{Shares} +\todo{Semantiek van shares, hoe ze in iTasks zijn, hoe typering} + +\subsection{Lifting} +\todo{Lift mTask taken naar echte taken, hoe werkt dat?} + +\section{Demo} +\todo{Wat voorbeeld code} diff --git a/thesis.tex b/thesis.tex index d36ac86..a1c50d3 100644 --- a/thesis.tex +++ b/thesis.tex @@ -70,6 +70,7 @@ \input{results.tex} \chapter{Conclusion \& Discussion}\label{chp:conclusion} +\input{conclusion.tex} \appendix\label{chp:appendix}