From: Mart Lubbers Date: Sat, 28 Jan 2017 14:02:48 +0000 (+0100) Subject: update praatje X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=6348f77cccb3cf6b4b43be64b8d45f558a332660;p=ri1617.git update praatje --- diff --git a/.gitignore b/.gitignore index 25b17b3..585431c 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ *.tdo *.toc *.mlog +*.nav +*.snm +*.vrb diff --git a/final_review/Makefile b/final_review/Makefile index ef80336..d211763 100644 --- a/final_review/Makefile +++ b/final_review/Makefile @@ -27,4 +27,4 @@ all: $(addsuffix .pdf,$(DOCS)) clean: $(RM) $(foreach DOC,$(DOCS),\ - $(addprefix $(DOC).,aux log fmt toc bbl blg run.xml out pdf snm nav)) + $(addprefix $(DOC).,aux log fmt toc bbl blg run.xml out pdf snm nav snm vrb)) diff --git a/final_review/clean.sty b/final_review/clean.sty new file mode 100644 index 0000000..ca04091 --- /dev/null +++ b/final_review/clean.sty @@ -0,0 +1,70 @@ +\usepackage{listings} + +\lstdefinelanguage{Clean}{% + alsoletter={ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_`1234567890}, + alsoletter={~!@\#$\%^\&*-+=?<>:|\\.}, + morekeywords={generic,implementation,definition,dynamic,module,import,from,where,in,of,case,let,infix,infixr,infixl,class,instance,with,if,derive,Void}, + sensitive=true, + morecomment=[l]{//}, + morecomment=[n]{/*}{*/}, + morestring=[b]", + morestring=[b]', + emptylines=1, + basicstyle=\small, + identifierstyle=\small\ttfamily, + commentstyle=\itshape, + keywordstyle=\bfseries, + stringstyle=\ttfamily, + numbers=none, + showstringspaces=false, + basewidth=0.45em, + columns=[c]fixed, + keepspaces=true, + breaklines=false, + tabsize=4, + texcl=true, + escapeinside={(\#}{\#)}, + literate=% + % Basic Clean constructs + {\\}{{$\lambda\:$}}1 + {A.}{{$\forall\;\,$}}1 + {E.}{{$\exists\;\,$}}1 + {>}{{$>$}}1 + {<}{{$<$}}1 + {<=}{{$\leq$}}1 + {>=}{{$\geq$}}1 + {<>}{{$\neq$}}1 + {->}{{$\rightarrow$}}2 + {<-}{{$\leftarrow$}}1 + {=}{{$=$}}1 + {~}{{$\sim$}}1 + {\#}{{$\sharp$}}1 + {\{|}{{$\{\!|\!$}}1 + {|\}}{{$\!|\!\}$}}1 + {:=}{{$:=$}}2 + {==}{{$==$}}2 + {++}{{$+\!\!+$}}2 + {+++}{{$+\!\!\!\!+\!\!\!\!+$}}2 + {:==}{{$:==$}}3 + {\{|*|\}}{{$\{\!|\!\!\star\!\!|\!\}$}}3 + % + % Basic iTask constructs + {>||>}{{$\triangleright\triangleright$}}2 + {>>=}{{\texttt{>>=}}}3 + {>>|}{{\texttt{>>|}}}3 + {?>>}{{\texttt{?>>}}}3 + {!>>}{{\texttt{!>>}}}3 + {-||-}{{\texttt{-||-}}}4 + {.||.}{{\texttt{.||.}}}4 + {.&&.}{{\texttt{.\&\&.}}}4 +} + +\newcommand{\CleanInline}[1]{\lstinline[language=Clean]¦#1¦} +\newcommand{\CI}[1]{\CleanInline{#1}} + +\lstdefinestyle{numbers}{numbers=left, stepnumber=1, numberstyle=\tiny, numbersep=5pt} + +\lstnewenvironment{CleanCode}{\lstset{language=Clean,identifierstyle=\ttfamily}}{} +\lstnewenvironment{CleanCodeN}{\lstset{language=Clean,style=numbers}}{} +\lstnewenvironment{CleanCodeB}{\lstset{language=Clean,frame=single}}{} +\lstnewenvironment{CleanCodeNB}{\lstset{language=Clean,style=numbers,frame=single}}{} diff --git a/final_review/demo.listing b/final_review/demo.listing new file mode 100644 index 0000000..eaeaa9e --- /dev/null +++ b/final_review/demo.listing @@ -0,0 +1,18 @@ +main = sds \x=1 In sds \pin=1 In + { main = + IF (digitalRead D3) ( + x =. x +. lit 1 :. pub x + ) ( noOp + ) :. + IF (pinnetje ==. lit 1) ( + digitalWrite D0 (lit True) + ) ( IF (pinnetje ==. lit 2) ( + digitalWrite D1 (lit True) + ) ( digitalWrite D2 (lit True) + )) } + +ledOn :: DigitalPin -> Main (ByteCode () Stmt) +ledOn d = { main = digitalWrite d (lit True) :. noOp } + +ledOff :: DigitalPin -> Main (ByteCode () Stmt) +ledOff d = { main = digitalWrite d (lit False) :. noOp } diff --git a/final_review/praatje.pre b/final_review/praatje.pre index c2f2fff..33b1cd0 100644 --- a/final_review/praatje.pre +++ b/final_review/praatje.pre @@ -1,6 +1,8 @@ \documentclass{beamer} \usepackage[british]{babel} +\usepackage{listings} +\usepackage{clean} \title{iTasks and the Internet of Things} \subtitle{Research internship} diff --git a/final_review/praatje.tex b/final_review/praatje.tex index 33de65b..b43bb20 100644 --- a/final_review/praatje.tex +++ b/final_review/praatje.tex @@ -58,10 +58,36 @@ \begin{frame} \frametitle{mTask} + \begin{block}{Properties} + \begin{itemize} + \item Initially developed by Pieter Koopman + \item Designed to simulate TOP on microcontrollers + \item Type safe + \item Shallowly embedded + \item Class based and thus extendable with views + \pause% + \item Current views: Simulation in iTasks, C code generation + \pause% + \item New view: Bytecode compilation. + \end{itemize} + \end{block} +% \begin{table} +% +% \caption{Language elements mTask} +% \end{table} \end{frame} \begin{frame} \frametitle{SDS} + +\end{frame} + +\begin{frame}[fragile] + \frametitle{Demo} + \lstinputlisting[% + caption={mTasks used in the demo}, + language=Clean, + basicstyle=\scriptsize]{demo.listing} \end{frame} \begin{frame}