diff --git a/beamer/beamer.tex b/beamer/beamer.tex index 6c7ff77..5107df3 100644 --- a/beamer/beamer.tex +++ b/beamer/beamer.tex @@ -1,4 +1,11 @@ \documentclass{beamer} +\usepackage{listings} +\lstset{ + basicstyle=\ttfamily, + columns=fullflexible, + frame=single, + breaklines=true, +} \usepackage{tikz} \usetikzlibrary{positioning} @@ -119,6 +126,23 @@ \end{block} \end{frame} +\begin{frame}[fragile]{Translation of automaton} + \only<1>{\lstinputlisting[language=ml, firstline=1, lastline=7]{code/example_automaton.lus}} + \only<2>{\lstinputlisting[language=ml, firstline=9, lastline=14]{code/example_automaton.lus}} +\end{frame} +\begin{frame}{Restriction on automaton} + The patterns that appears on the left of equations must be the + same in all branches + + \only<2>{\lstinputlisting[language=ml, firstline=16, lastline=22]{code/example_automaton.lus}} +\end{frame} + +\begin{frame}{Clock unification} + + Derived from the rules provided in \emph{Clock-directed Modular Code Generation for Synchronous + Data-flow Languages} +\end{frame} + \section{Translation to C} \begin{frame} diff --git a/beamer/code/example_automaton.lus b/beamer/code/example_automaton.lus new file mode 100644 index 0000000..b0a7aa4 --- /dev/null +++ b/beamer/code/example_automaton.lus @@ -0,0 +1,22 @@ +node auto (i: int) returns (o : int); +var x, y:int; +let + automaton + | Incr -> do (o,x) = (0 fby o + 1, 2); until o < 5 then Decr + | Decr -> do (o,x) = diagonal_int(0 fby o); until o > 3 then Incr +tel + +node auto (i: int) returns (o: int); +var x, y: int; +let + _s1 = 1 -> (if _s = 1 and o < 5 then 2 else if _s = 2 and o > then 1 else 1); + o, x = if _s = 1 then (0 fby o + 1, 2) else if _s = 2 then diagonal_int(0 fby 0) else (0, 0); +tel + +node auto (i: int) returns (o : int); +var x, y:int; +let + automaton + | Incr -> do (o,x) = (0 fby o + 1, 2); until o < 5 then Decr + | Decr -> do (x,o) = diagonal_int(0 fby o); until o > 3 then Incr +tel