beamer automaton pass
This commit is contained in:
parent
edfec42738
commit
fc0a12fa12
@ -1,4 +1,11 @@
|
|||||||
\documentclass{beamer}
|
\documentclass{beamer}
|
||||||
|
\usepackage{listings}
|
||||||
|
\lstset{
|
||||||
|
basicstyle=\ttfamily,
|
||||||
|
columns=fullflexible,
|
||||||
|
frame=single,
|
||||||
|
breaklines=true,
|
||||||
|
}
|
||||||
\usepackage{tikz}
|
\usepackage{tikz}
|
||||||
|
|
||||||
\usetikzlibrary{positioning}
|
\usetikzlibrary{positioning}
|
||||||
@ -119,6 +126,23 @@
|
|||||||
\end{block}
|
\end{block}
|
||||||
\end{frame}
|
\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}
|
\section{Translation to C}
|
||||||
\begin{frame}
|
\begin{frame}
|
||||||
|
|
||||||
|
22
beamer/code/example_automaton.lus
Normal file
22
beamer/code/example_automaton.lus
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user