This is my code:
\documentclass{article}
\usepackage{tikz}
\usepackage[margin=15mm]{geometry}
\usepackage{calc}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{positioning,arrows}
\usetikzlibrary{shapes,arrows,fit,calc,positioning,automata}
\newcommand{\mytab}[2]% alignment, content
{ \begin{tabular}{#1}
#2
\end{tabular}
}
\begin{document}
\tikzset{
mynode/.style={line width=0.25pt, draw, minimum width=3.0cm, minimum height=1.0cm, inner sep=0, anchor=south west},
mymatrix/.style={line width=0.5pt, draw, inner sep=0},
myline/.style={shorten <=0.2pt, shorten >=0.2pt},
}
\begin{figure}[H]
\begin{tikzpicture}
\matrix[matrix of nodes, nodes=mynode, mymatrix] (s1) at (0,-2)
{ $p_0$ \\
$f(q_0, x) = q_0$ \\
$g(q_0, x, y) = y$ \\
};
\matrix[matrix of nodes, nodes=mynode, mymatrix] (s2) at (7,-2)
{ $p_0$ \\
$f(q_0, x) = q_0$ \\
$g(q_0, x, y) = z1.y$ \\
};
\node [ below = 1 mm of s1,align=center] (a1) {$r_0$};
\node [ below = 1 mm of s2,align=center] (a2) {$r_1$};
\draw[-latex] (s1.120) to [out=135,in=45] node [auto] {$a \rightarrow [y = a.y]$\newline$b \rightarrow [y = b.y]$} (s1.80);
\draw[-latex] (s1.east) to node [auto] {$a \rightarrow [y = a.y]$\newline$b \rightarrow [y = b.y]$} (s2.west);
\end{tikzpicture}
\end{figure}
\end{document}
This is the output:

How to get line break on labels? And why are some lines of the node are appearing darker than others?
align=centeron the nodes where you want multiple lines and a\\to mark where you want the line breaks. The darker lines are probably a PDF display issue -- if you zoom in they should go away. – Peter Grill Apr 20 '13 at 17:30