I hacked a quick-and-dirty LaTeX style file enabling me to pretty-print Alloy 4 code. As it may be useful to many users, I am releasing it hereby under public domain ;-)
First issue these commands in the preamble of your document:
\usepackage{listings}
Then don't forget to issue the following command after the \begin{document}:
\lstset{language=Alloy}
(the listings package can handle many languages, so every \lsset command is here to switch to a new pretty-printing style).
Now, every time you wish to show some Alloy code, just write:
\begin{lstlisting}[numbers=left, numberstyle={\tiny\oldstylenums}, name=aName]
sig A { x : some B }
sig B {}
sig C {
y : one A,
z : one B
}
\end{lstlisting}
The options numbers=left and numberstyle={\tiny\oldstylenums} command LaTeX to number lines with small old style numbers.
The name=aName gives the name aName to this enviromnent. Every other environemnt with the same name, appearing later in the LaTeX file, will continue the numbering instead of counting from 1. If you don't want this behaviour, just remove this option. If you want this option but don't want to continue a previous numbering, just use a new name.
Sincerely,
Felix Chang
Alloy4 Developer
literate={->}{{$\to\mbox{}$}}