--- /dev/null
+\section{Conclusion}
+
+\section{Discussion}
+
+\section{Future Research}
\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
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.
\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.
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
\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
}
\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
\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}
\input{results.tex}
\chapter{Conclusion \& Discussion}\label{chp:conclusion}
+\input{conclusion.tex}
\appendix\label{chp:appendix}