LaTeX package to typeset Uppaal timed automata specifications.
The style depends on listings.sty, xcolor.sty and xspace.sty.
Properties in a table:
Timed automata labels:
Minimal uppaalcode environment:
Customized using lstlisting options:
-
Make sure that
listings,xcolorandxspaceare installed. In Linux distributions this is usually found intexlive-latex-recommended(sudo apt-get install texlive-latex-recommended). -
Make sure that the font
beramonois installed (usually ships asfvm*files withtexlive-font-extra) -
Download
uppaal.styfrom releases and put it into your LaTeX project directory. -
Add
\usepackage{uppaal}to your main .tex file. -
Embed Uppaal code into your .tex files, like:
\begin{uppaalcode}[caption={Updates velocity and position.},label={lst:updatecode}]
int lIZERO = 0; // note the characters l, I, 0 and O
int distance = 5; // approximated distance between cars
int velocityEgo, velocityFront; /* approximated velocities */
int accelerationEgo, accelerationFront; /** acceleration */
void updateDiscrete() {
int newVel, oldVel = velocityFront - velocityEgo;
velocityEgo = velocityEgo + accelerationEgo;
velocityFront = velocityFront + accelerationFront;
newVel = velocityFront - velocityEgo;
if (distance > maxSensorDistance) {
distance = maxSensorDistance + 1;
} else { // $d \approx \sum_i \frac{v_i+v_{i+1}}{2}\Delta t$
distance += (oldVel + newVel)/2;
}
}
\end{uppaalcode}See manual.pdf from releases for more details on how to customize.



