答案1
这里是方程式内部显示的复制:
\documentclass{article}
\usepackage{amsmath,array}
\newcommand{\var}{\texttt}
\newcommand{\AND}{\wedge}
\newcommand{\curlylbrace}{\texttt{\symbol{123}}} % \{
\newcommand{\curlyrbrace}{\texttt{\symbol{125}}} % \}
\begin{document}
\[
\begin{array}{ l }
\bigl( \var{max} \doteq 0
\AND \var{i} \doteq 0
\AND \var{i} < \var{a.length} \rightarrow
\begin{array}[t]{ @{} l }
[ \curlylbrace
\begin{tabular}[t]{ >{\ttfamily}l }
if(a[i] > max) max = a[i]; \\
i++; \\
while(i < a.length) \curlylbrace \\
\quad if(a[i] > max) max = a[i]; \\
\quad i++; \\
\curlyrbrace
\end{tabular} \\
\curlyrbrace ] \psi_0)
\end{array} \\
{} \AND (\var{max} \doteq 0
\AND \var{i} \doteq 0
\AND \var{i} \geq \var{a.length} \rightarrow [ \curlylbrace \curlyrbrace ] \psi_0 \bigr)
\end{array}
\]
\end{document}