X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=methods.mtask.tex;h=a35883a596e5944f5afa91da706fdfee1cd007b3;hb=d118ff9d857683084065145df45135ef6fa06711;hp=941d95e8d52675d59b09b636fedd884b36a678eb;hpb=a3a00cd9df798eda92291a2f3f6c922bdfdfdac2;p=msc-thesis1617.git diff --git a/methods.mtask.tex b/methods.mtask.tex index 941d95e..a35883a 100644 --- a/methods.mtask.tex +++ b/methods.mtask.tex @@ -1,4 +1,3 @@ -\section{mTask} The \gls{mTask}-\gls{EDSL} is the basis on which the system is built. The \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} @@ -8,7 +7,7 @@ microcontrollers such as the Arduino\cite{koopman_type-safe_nodate}% 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} +given classes. The following sections show the details of the \gls{EDSL} 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,14 +35,14 @@ instance isExpr Upd instance isExpr Expr \end{lstlisting} -\subsection{Semantics} +\section{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} +\section{Expressions} Expressions in the \gls{mTask}-\gls{EDSL} are divided into two types, namely boolean expressions and arithmetic expressions. The class of arithmetic language constructs also contains the function \CI{lit} that lifts a @@ -67,7 +66,7 @@ class boolExpr v where (==.) infix 4 :: (v a p) (v a q) -> v Bool Expr | ==, toCode a & ... \end{lstlisting} -\subsection{Control flow} +\section{Control flow} 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 @@ -87,7 +86,7 @@ class seq v where (:.) infixr 0 :: (v t p) (v u q) -> v u Stmt | ... \end{lstlisting} -\subsection{Input/Output and class extensions} +\section{Input/Output and class extensions} All expressions that have an \CI{Upd} role can be assigned to. Examples of such expressions are \glspl{SDS} and \gls{GPIO}. Moreover, class extensions can be created for specific peripherals such as user LEDs. The classes facilitating @@ -133,7 +132,7 @@ class sds v where sds :: ((v t Upd)->In t (Main (v c s))) -> (Main (v c s)) | ... \end{lstlisting} -\subsection{Example \gls{mTask}} +\section{Example mTask} \todo{Also explain semantics about running tasks} Some example \glspl{mTask} using almost all of the functionality are show in Listing~\ref{lst:exmtask}. The \glspl{mTask} shown in the example do not belong