\glspl{SDS}.
\begin{lstlisting}[%
- language=Clean,label={lst:exprhier},caption={Expression role hierarchy}]
+ label={lst:exprhier},caption={Expression role hierarchy}]
:: Upd = Upd
:: Expr = Expr
:: Stmt = Stmt
and omitted in subsequent funcitons. Both the boolean expression and arithmetic
expression classes are shown in Listing~\ref{lst:arithbool}.
-\begin{lstlisting}[language=Clean,label={lst:arithbool},
+\begin{lstlisting}[label={lst:arithbool},
caption={Basic classes for expressions}]
class arith v where
lit :: t -> v t Expr
the two expressions together in sequence.
\begin{lstlisting}[%
- language=Clean,label={lst:control},caption={Control flow operators}]
+ 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 | ...
the assignment is the same for every assignable entity.
\begin{lstlisting}[%
- language=Clean,label={lst:sdsio},caption={Input/Output classes}]
+ label={lst:sdsio},caption={Input/Output classes}]
:: DigitalPin = D0 | D1 | D2 | D3 | D4 | D5 |D6 | D7 | D8 | D9 | D10 | D11 | D12 | D13
:: AnalogPin = A0 | A1 | A2 | A3 | A4 | A5
:: UserLED = LED1 | LED2 | LED3
\gls{mTask} and make it recognizable by the type system.
\begin{lstlisting}[%
- language=Clean,label={lst:sdsclass},caption={\glspl{SDS} in \gls{mTask}}]
+ label={lst:sdsclass},caption={\glspl{SDS} in \gls{mTask}}]
:: In a b = In infix 0 a b
:: Main a = {main :: a}
shows a simple specification containing one task that increments a value
indefinitely every one seconds.
-\begin{lstlisting}[language=Clean,label={lst:taskclass},%
+\begin{lstlisting}[label={lst:taskclass},%
caption={The classes for defining tasks}]
class mtask v a where
task :: (((v delay r) a->v MTask Expr)->In (a->v u p) (Main (v t q))) -> Main (v t q) | ...
expression but now using the assignment style \gls{GPIO} technique.
\begin{lstlisting}[%
- language=Clean,label={lst:exmtask},caption={Some example \glspl{mTask}}]
+ label={lst:exmtask},caption={Some example \glspl{mTask}}]
blink = task \blink=(\x.
IF (x ==. lit True) (ledOn led) (ledOff led) :.
blink (lit 1000) (Not x)
thermostat :: Main (View () Stmt)
thermostat = {main =
- IF (analogRead A0 >. 50)
+ IF (analogRead A0 >. lit 50)
( digitalWrite D0 (lit True) )
( digitalWrite D0 (lit False) )
}
thermostat` :: Main (View () Stmt)
thermostat` = let
a0 = aIO A0
- d0 = dIO D0 in {main = IF (a0 >. 50) (d0 =. lit True) (d0 =. lit False) }
+ d0 = dIO D0 in {main = IF (a0 >. lit 50) (d0 =. lit True) (d0 =. lit False) }
\end{lstlisting}