From: Mart Lubbers Date: Mon, 15 May 2017 09:59:23 +0000 (+0200) Subject: process notes in first sections X-Git-Tag: hand-in~128 X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=8c6f463e3da3f3a2469b44f17705d633c988fee6;p=msc-thesis1617.git process notes in first sections --- diff --git a/introduction.tex b/introduction.tex index c2ee7bc..0f86d15 100644 --- a/introduction.tex +++ b/introduction.tex @@ -3,19 +3,19 @@ The \gls{TOP} paradigm and the according \gls{iTasks} implementation offer a high abstraction level for real life workflow tasks. These workflow tasks can be described through an \gls{EDSL} and modeled as \glspl{Task} From the specification the system will then generate a multi-user web service. -This web service can be accessed through a browser and used to complete these +This web service is accessed through a browser and used to complete these \glspl{Task}. Familiar workflow patterns like sequence, parallel and conditional tasks can be modelled using combinators. \gls{iTasks} has been shown to be useful in many fields of operation such as incident management~\cite{lijnse_top_2013}. Interfaces are automatically generated for the types of data which makes rapid development possible. -However, while the tasks in the \gls{iTasks} system model after real life -workflow tasks the modelling is very high level. It is difficult to connect -actual tasks to the real tasks and let them interact. A lot of the actual tasks -can be \emph{performed} by small \gls{IoT} devices. Nevertheless, adding such -devices to the current system is difficult to say the least as it was not -designed to cope with these devices. +\Glspl{Task} in the \gls{iTasks} system are modelled after real life workflow +tasks but the modelling is applied on a very high level. Therefore it is +difficult to connect \gls{iTasks} tasks to the real world tasks and let them +interact. A lot of the actual tasks can be \emph{performed} by small \gls{IoT} +devices. Nevertheless, adding such devices to the current system is difficult +to say the least as it was not designed to cope with these devices. In the current system such adapters, in principle, can be written as \glspl{SDS}\footnote{Similar as to resources such as time are available in @@ -24,8 +24,8 @@ adapter to be written for every device and functionality. However, this forces a fixed logic in the device that is set at compile time. A lot of the small \gls{IoT} devices have limited processing power but can still contain decision making. Oortgiese et al.\ lifted \gls{iTasks} from a single server model to a -distributed server architecture~\cite{oortgiese_distributed_2017} that is also -runnable on smaller devices like \acrshort{ARM} devices. However, this is +distributed server architecture that is also runnable on smaller devices like +\acrshort{ARM} devices\cite{oortgiese_distributed_2017}. However, this is limited to fairly high performance devices that are equipped with high speed communication channels. Devices in \gls{IoT} often only have \gls{LTN} communication with low bandwidth and a very limited amount of processing power diff --git a/methods.dsl.tex b/methods.dsl.tex index 2d0aab2..bf9953f 100644 --- a/methods.dsl.tex +++ b/methods.dsl.tex @@ -8,53 +8,52 @@ techniques are briefly explained. A deep \gls{EDSL} means that the language is represented as an \gls{ADT}. Views are functions that transform something to the datatype or the other way around. As an example we have the simple arithmetic \gls{EDSL} shown in -Listing~\ref{lst:exdeep}. Deep embedding has the advantage that it is very -simple to build and the views are easy to make and add. However, there are also -a few downsides. +Listing~\ref{lst:exdeep}. \begin{lstlisting}[language=Clean,label={lst:exdeep},% caption={A minimal deep \gls{EDSL}}] :: DSL - = LitI Int - | LitB Bool - | Var String - | Plus DSL DSL + = LitI Int + | LitB Bool + | Var String + | Plus DSL DSL | Minus DSL DSL - | And DSL DSL - | Eq DSL + | And DSL DSL + | Eq DSL \end{lstlisting} - -The expressions created with this language are not type-safe. In the given -language it is possible an expression such as \CI{Plus (LitI 4) (LitB True)} -which to add a boolean to an integer. Evermore so, extending the \gls{ADT} is -easy and convenient but extending the views accordingly is tedious and has to -be done individually for all views. +Deep embedding has the advantage that it is very simple to build and the views +are easy to make and add. However, there are also a few downsides. The +expressions created with this language are not type-safe. In the given language +it is possible an expression such as \CI{Plus (LitI 4) (LitB True)} which to +add a boolean to an integer. Evermore so, extending the \gls{ADT} is easy and +convenient but extending the views accordingly is tedious and has to be done +individually for all views. The first downside of the type of \gls{EDSL} can be overcome by using -\glspl{GADT}. Listing~\ref{lst:exdeepgadt} shows the same language, but -type-safe with a \gls{GADT}\footnote{\glspl{GADT} are not supported -in the current version of \gls{Clean}. However, they can be simulated using -bimaps}. Unfortunately the lack of extendability stays a problem. If a language -construct is added no compile time guarantee is given that all views support -it. +\glspl{GADT}\cite{cheney_first-class_2003}. Listing~\ref{lst:exdeepgadt} shows +the same language, but type-safe with a \gls{GADT}\footnote{\glspl{GADT} are +not supported in the current version of \gls{Clean} and therefore the syntax is +artificial. However, \glspl{GADT} can be simulated using bimaps}. Unfortunately +the lack of extendability stays a problem. If a language construct is added no +compile time guarantee is given that all views support it. \begin{lstlisting}[language=Clean,label={lst:exdeepgadt},% caption={A minimal deep \gls{EDSL} using \glspl{GADT}}] :: DSL a - = LitI Int -> DSL Int - | LitB Bool -> DSL Bool - | Var String -> DSL Int - | Plus (DSL Int) (DSL Int) -> DSL Int - | Minus (DSL Int) (DSL Int) -> DSL Int - | And (DSL Bool) (DSL Bool) -> DSL Bool - | E.e: Eq (DSL e) (DSL e) -> DSL Bool & == e + = LitI Int -> DSL Int + | LitB Bool -> DSL Bool + | E.e: Var String -> DSL e + | Plus (DSL Int) (DSL Int) -> DSL Int + | Minus (DSL Int) (DSL Int) -> DSL Int + | And (DSL Bool) (DSL Bool) -> DSL Bool + | E.e: Eq (DSL e) (DSL e) -> DSL Bool & == e \end{lstlisting} \subsection{Shallow embedding} In a shallowly \gls{EDSL} all language constructs are expressed as functions in the host language. An evaluator view for our example language then looks something like the code shown in Listing~\ref{lst:exshallow}. Note that much of -the internals of the language can be hidden away using monads. +the internals of the language can be hidden using monads. \begin{lstlisting}[language=Clean,label={lst:exshallow},% caption={A minimal shallow \gls{EDSL}}] @@ -114,13 +113,13 @@ choose to implement only parts of the collection of classes. :: PrettyPrinter a = PP String class intArith where - lit :: t -> v t | toString t - add :: (v t) (v t) -> (v t) | + t + lit :: t -> v t | toString t + add :: (v t) (v t) -> (v t) | + t minus :: (v t) (v t) -> (v t) | - t class boolArith where and :: (v Bool) (v Bool) -> (v Bool) - eq :: (v t) (v t) -> (v Bool) | == t + eq :: (v t) (v t) -> (v Bool) | == t instance intArith Evaluator where lit x = \e->x diff --git a/methods.top.tex b/methods.top.tex index 52ed983..982ac24 100644 --- a/methods.top.tex +++ b/methods.top.tex @@ -1,19 +1,24 @@ \section{\acrlong{TOP}} \subsection{\gls{iTasks}} -\gls{TOP} is a recent new programming paradigm implemented as +\gls{TOP} is a recent programming paradigm implemented as \gls{iTasks}\cite{achten_introduction_2015} in the pure lazy functional language \gls{Clean}\cite{brus_cleanlanguage_1987}. \gls{iTasks} is a \gls{EDSL} to model workflow tasks in the broadest sense. A \CI{Task} is just a function that, given some state, returns the observable \CI{TaskValue}. The \CI{TaskValue} of a \CI{Task} can have different states. Not all state transitions are possible as shown in Figure~\ref{fig:taskvalue}. Once a value -has gone stable it can never become unstable again. Stability is often reached -by pressing a confirmation button or for \glspl{Task} that offer a constant -value. A simple example is shown in Listing~\ref{lst:taskex} accompanied with -Figure~\ref{fig:taskex1},~\ref{fig:taskex2} and~\ref{fig:taskex3}. In this -example the first image in is the \CI{NoValue} state, the second and third -image are in the \CI{Unstable} state. When the user presses \emph{Continue} the -value becomes \CI{Stable}. +is stable it can never become unstable again. Stability is often reached +by pressing a confirmation button. \glspl{Task} yielding a constant value are +immediately stable. + +A simple \gls{iTasks} example illustrating the route to stability of a +\gls{Task} in which the user has to enter a full name is shown in +Listing~\ref{lst:taskex}. The code is accompanied by screenshots showing the +user interface in Figure~\ref{fig:taskex1},~\ref{fig:taskex2} +and~\ref{fig:taskex3}. The \CI{TaskValue} of the \gls{Task} is in the first +image in the \CI{NoValue} state, the second and third image have an +\CI{Unstable} state. When the user presses \emph{Continue} the value becomes +\CI{Stable}. \begin{figure}[H] \centering @@ -23,9 +28,9 @@ value becomes \CI{Stable}. \begin{lstlisting}[language=Clean,label={lst:taskex},% caption={An example \gls{Task} for entering a name}] -:: Name = { firstname :: String - , lastname :: String - } +:: Name = { firstname :: String + , lastname :: String + } derive class iTask Name diff --git a/thesis.bib b/thesis.bib index 1deb14b..c11c597 100644 --- a/thesis.bib +++ b/thesis.bib @@ -1,4 +1,49 @@ +@article{da_xu_internet_2014, + title = {Internet of things in industries: a survey}, + volume = {10}, + number = {4}, + journal = {Industrial Informatics, IEEE Transactions on}, + author = {Da Xu, Li and He, Wu and Li, Shancang}, + year = {2014}, + pages = {2233--2243}, + file = {IOT industrial survey.pdf:/home/mrl/.mozilla/firefox/a614qfce.default/zotero/storage/EJHG7M8I/IOT industrial survey.pdf:application/pdf} +} + +@inproceedings{svenningsson_combining_2012, + title = {Combining deep and shallow embedding for {EDSL}}, + url = {http://link.springer.com/chapter/10.1007/978-3-642-40447-4_2}, + urldate = {2017-05-10}, + booktitle = {International {Symposium} on {Trends} in {Functional} {Programming}}, + publisher = {Springer}, + author = {Svenningsson, Josef and Axelsson, Emil}, + year = {2012}, + pages = {21--36}, + file = {svenningsson2013combining.pdf:/home/mrl/.mozilla/firefox/a614qfce.default/zotero/storage/NFBGZCZT/svenningsson2013combining.pdf:application/pdf} +} + +@article{koopman_type-safe_nodate, + title = {Type-{Safe} {Functions} and {Tasks} in a {Shallow} {Embedded} {DSL} for {Microprocessors}}, + url = {https://tfp2016.org/papers/TFP_2016_paper_7.pdf}, + urldate = {2017-02-22}, + author = {Koopman, Pieter and Plasmeijer, Rinus}, + file = {TFP_2016_paper_7.pdf:/home/mrl/.mozilla/firefox/a614qfce.default/zotero/storage/WR3PZNTT/TFP_2016_paper_7.pdf:application/pdf} +} + +@phdthesis{oortgiese_distributed_2017, + address = {Nijmegen}, + type = {Master}, + title = {A {Distributed} {Server} {Architecture} for {Task} {Oriented} {Programming}}, + shorttitle = {A {Distributed} {Server} {Architecture} for {Task} {Oriented} {Programming}}, + url = {http://www.ru.nl/publish/pages/769526/arjan_oortgiese.pdf}, + language = {English}, + urldate = {2017-04-08}, + school = {Radboud University}, + author = {Oortgiese, Arjan}, + year = {2017}, + file = {arjan_oortgiese.pdf:/home/mrl/.mozilla/firefox/a614qfce.default/zotero/storage/J4WXQXU4/arjan_oortgiese.pdf:application/pdf} +} + @incollection{achten_introduction_2015, title = {An {Introduction} to {Task} {Oriented} {Programming}}, booktitle = {Central {European} {Functional} {Programming} {School}}, @@ -6,31 +51,35 @@ author = {Achten, Peter and Koopman, Pieter and Plasmeijer, Rinus}, year = {2015}, pages = {187--245}, - file = {chp%3A10.1007%2F978-3-319-15940-9_5.pdf:/home/mrl/.mozilla/firefox/7b4r727h.default-1470981082057/zotero/storage/ZSDSIIT7/chp%3A10.1007%2F978-3-319-15940-9_5.pdf:application/pdf} + file = {chp%3A10.1007%2F978-3-319-15940-9_5.pdf:/home/mrl/.mozilla/firefox/a614qfce.default/zotero/storage/ZSDSIIT7/chp%3A10.1007%2F978-3-319-15940-9_5.pdf:application/pdf} } -@incollection{serrano_shallow_2016, - address = {Cham}, - series = {Lecture {Notes} in {Computer} {Science}}, - title = {A {Shallow} {Embedded} {Type} {Safe} {Extendable} {DSL} for the {Arduino}}, - volume = {9547}, - isbn = {978-3-319-39109-0 978-3-319-39110-6}, - url = {http://link.springer.com/10.1007/978-3-319-39110-6}, - urldate = {2017-02-22}, - booktitle = {Trends in {Functional} {Programming}}, - publisher = {Springer International Publishing}, - editor = {Serrano, Manuel and Hage, Jurriaan}, - year = {2016}, - note = {DOI: 10.1007/978-3-319-39110-6}, - file = {chp%3A10.1007%2F978-3-319-39110-6_6.pdf:/home/mrl/.mozilla/firefox/7b4r727h.default-1470981082057/zotero/storage/TJVP6FHF/chp%3A10.1007%2F978-3-319-39110-6_6.pdf:application/pdf} +@book{lijnse_top_2013, + address = {S.l.; Nijmegen}, + title = {{TOP} to the rescue: task-oriented programming for incident response applications}, + isbn = {978-90-820259-0-3}, + shorttitle = {{TOP} to the rescue}, + language = {English}, + publisher = {s.n.] ; UB Nijmegen [host}, + author = {Lijnse, Bas}, + year = {2013}, + note = {OCLC: 833851220}, + file = {103931.pdf:/home/mrl/.mozilla/firefox/a614qfce.default/zotero/storage/9KZ9I6N9/103931.pdf:application/pdf} } -@article{koopman_type-safe_nodate, - title = {Type-{Safe} {Functions} and {Tasks} in a {Shallow} {Embedded} {DSL} for {Microprocessors}}, - url = {https://tfp2016.org/papers/TFP_2016_paper_7.pdf}, - urldate = {2017-02-22}, - author = {Koopman, Pieter and Plasmeijer, Rinus}, - file = {TFP_2016_paper_7.pdf:/home/mrl/.mozilla/firefox/7b4r727h.default-1470981082057/zotero/storage/WR3PZNTT/TFP_2016_paper_7.pdf:application/pdf} +@inproceedings{pike_programming_2014, + title = {Programming languages for high-assurance autonomous vehicles: extended abstract}, + isbn = {978-1-4503-2567-7}, + shorttitle = {Programming languages for high-assurance autonomous vehicles}, + url = {http://dl.acm.org/citation.cfm?doid=2541568.2541570}, + doi = {10.1145/2541568.2541570}, + language = {en}, + urldate = {2017-05-10}, + publisher = {ACM Press}, + author = {Pike, Lee and Hickey, Patrick and Bielman, James and Elliott, Trevor and DuBuisson, Thomas and Launchbury, John}, + year = {2014}, + pages = {1--2}, + file = {pike-plpv14.pdf:/home/mrl/.mozilla/firefox/a614qfce.default/zotero/storage/MTUSHBNF/pike-plpv14.pdf:application/pdf} } @inproceedings{brus_cleanlanguage_1987, @@ -42,43 +91,47 @@ author = {Brus, T. H. and van Eekelen, Marko CJD and Van Leer, M. O. and Plasmeijer, Marinus J.}, year = {1987}, pages = {364--384}, - file = {Clean —\; A language for functional graph rewriting - chp%3A10.1007%2F3-540-18317-5_20.pdf:/home/mrl/.mozilla/firefox/7b4r727h.default-1470981082057/zotero/storage/GCEPPRUJ/chp%3A10.1007%2F3-540-18317-5_20.pdf:application/pdf} + file = {Clean —\; A language for functional graph rewriting - chp%3A10.1007%2F3-540-18317-5_20.pdf:/home/mrl/.mozilla/firefox/a614qfce.default/zotero/storage/GCEPPRUJ/chp%3A10.1007%2F3-540-18317-5_20.pdf:application/pdf} } -@article{da_xu_internet_2014, - title = {Internet of things in industries: a survey}, - volume = {10}, - number = {4}, - journal = {Industrial Informatics, IEEE Transactions on}, - author = {Da Xu, Li and He, Wu and Li, Shancang}, - year = {2014}, - pages = {2233--2243}, - file = {IOT industrial survey.pdf:/home/mrl/.mozilla/firefox/7b4r727h.default-1470981082057/zotero/storage/EJHG7M8I/IOT industrial survey.pdf:application/pdf} +@incollection{havelund_practical_2015, + address = {Cham}, + series = {Lecture {Notes} in {Computer} {Science}}, + title = {Practical {Formal} {Verification} of {Domain}-{Specific} {Language} {Applications}}, + volume = {9058}, + isbn = {978-3-319-17523-2 978-3-319-17524-9}, + url = {http://link.springer.com/10.1007/978-3-319-17524-9}, + urldate = {2017-05-10}, + booktitle = {{NASA} {Formal} {Methods}}, + publisher = {Springer International Publishing}, + editor = {Havelund, Klaus and Holzmann, Gerard and Joshi, Rajeev}, + year = {2015}, + note = {DOI: 10.1007/978-3-319-17524-9}, + file = {mart_paper.pdf:/home/mrl/.mozilla/firefox/a614qfce.default/zotero/storage/5SXR59GR/mart_paper.pdf:application/pdf} } -@book{lijnse_top_2013, - address = {S.l.; Nijmegen}, - title = {{TOP} to the rescue: task-oriented programming for incident response applications}, - isbn = {978-90-820259-0-3}, - shorttitle = {{TOP} to the rescue}, - language = {English}, - publisher = {s.n.] ; UB Nijmegen [host}, - author = {Lijnse, Bas}, - year = {2013}, - note = {OCLC: 833851220}, - file = {103931.pdf:/home/mrl/.mozilla/firefox/7b4r727h.default-1470981082057/zotero/storage/9KZ9I6N9/103931.pdf:application/pdf} +@incollection{serrano_shallow_2016, + address = {Cham}, + series = {Lecture {Notes} in {Computer} {Science}}, + title = {A {Shallow} {Embedded} {Type} {Safe} {Extendable} {DSL} for the {Arduino}}, + volume = {9547}, + isbn = {978-3-319-39109-0 978-3-319-39110-6}, + url = {http://link.springer.com/10.1007/978-3-319-39110-6}, + urldate = {2017-02-22}, + booktitle = {Trends in {Functional} {Programming}}, + publisher = {Springer International Publishing}, + editor = {Serrano, Manuel and Hage, Jurriaan}, + year = {2016}, + note = {DOI: 10.1007/978-3-319-39110-6}, + file = {chp%3A10.1007%2F978-3-319-39110-6_6.pdf:/home/mrl/.mozilla/firefox/a614qfce.default/zotero/storage/TJVP6FHF/chp%3A10.1007%2F978-3-319-39110-6_6.pdf:application/pdf} } -@phdthesis{oortgiese_distributed_2017, - address = {Nijmegen}, - type = {Master}, - title = {A {Distributed} {Server} {Architecture} for {Task} {Oriented} {Programming}}, - shorttitle = {A {Distributed} {Server} {Architecture} for {Task} {Oriented} {Programming}}, - url = {http://www.ru.nl/publish/pages/769526/arjan_oortgiese.pdf}, - language = {English}, - urldate = {2017-04-08}, - school = {Radboud University}, - author = {Oortgiese, Arjan}, - year = {2017}, - file = {arjan_oortgiese.pdf:/home/mrl/.mozilla/firefox/7b4r727h.default-1470981082057/zotero/storage/J4WXQXU4/arjan_oortgiese.pdf:application/pdf} +@techreport{cheney_first-class_2003, + title = {First-class phantom types}, + url = {https://ecommons.cornell.edu/handle/1813/5614}, + urldate = {2017-05-15}, + institution = {Cornell University}, + author = {Cheney, James and Hinze, Ralf}, + year = {2003}, + file = {https\://ecommons.cornell.edu/bitstream/handle/1813/5614/?sequence=1:/home/mrl/.mozilla/firefox/a614qfce.default/zotero/storage/R5IFMHTP/5614.pdf:application/pdf} } \ No newline at end of file diff --git a/thesis.pre b/thesis.pre index bb610fb..9c362f9 100644 --- a/thesis.pre +++ b/thesis.pre @@ -92,7 +92,7 @@ breaklines=true, % sets automatic line breaking captionpos=b, % sets the caption-position to bottom keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible) - basicstyle=\footnotesize, % the size of the fonts that are used for the code + basicstyle=\ttfamily\footnotesize, % the size of the fonts that are used for the code commentstyle=\itshape, % comment style keywordstyle=\bfseries, % keyword style stringstyle=\ttfamily, % string literal style