Index: doc/LaTeXmacros/common.sty
===================================================================
--- doc/LaTeXmacros/common.sty	(revision b721578e1616083fc20707814f50186def95d458)
+++ doc/LaTeXmacros/common.sty	(revision b721578e1616083fc20707814f50186def95d458)
@@ -0,0 +1,316 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -*- Mode: Latex -*- %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%% Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+%%
+%% The contents of this file are covered under the licence agreement in the
+%% file "LICENCE" distributed with Cforall.
+%%
+%% common.tex --
+%%
+%% Author           : Peter A. Buhr
+%% Created On       : Sat Apr  9 10:06:17 2016
+%% Last Modified By : Peter A. Buhr
+%% Last Modified On : Sat May  8 08:48:35 2021
+%% Update Count     : 550
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\setlength{\textheight}{9in}
+%\oddsidemargin 0.0in
+\renewcommand{\topfraction}{0.8}		% float must be greater than X of the page before it is forced onto its own page
+\renewcommand{\bottomfraction}{0.8}		% float must be greater than X of the page before it is forced onto its own page
+\renewcommand{\floatpagefraction}{0.8}	% float must be greater than X of the page before it is forced onto its own page
+\renewcommand{\textfraction}{0.0}		% the entire page maybe devoted to floats with no text on the page at all
+
+\lefthyphenmin=4						% hyphen only after 4 characters
+\righthyphenmin=4
+
+\usepackage[ignoredisplayed]{enumitem}	% do not affect trivlist
+\setlist{labelsep=1ex}% global
+\setlist[itemize]{topsep=0.5ex,parsep=0.25ex,itemsep=0.25ex,listparindent=\parindent,leftmargin=\parindent}% global
+\setlist[itemize,1]{label=\textbullet}% local
+%\renewcommand{\labelitemi}{{\raisebox{0.25ex}{\footnotesize$\bullet$}}}
+\setlist[enumerate]{listparindent=\parindent}% global
+\setlist[enumerate,2]{leftmargin=\parindent,labelsep=*,align=parleft,label=\alph*.}% local
+\setlist[description]{topsep=0.5ex,itemsep=0pt,listparindent=\parindent,leftmargin=\parindent,labelsep=1.5ex}
+
+% Names used in the document.
+
+\usepackage{xspace}
+\newcommand{\CFAIcon}{\textsf{C}\raisebox{\depth}{\rotatebox{180}{\textsf{A}}}} % Cforall icon
+\newcommand{\CFA}{\protect\CFAIcon\xspace}				% CFA symbolic name
+\newcommand{\CFL}{\textrm{Cforall}\xspace}				% Cforall non-icon name
+\newcommand{\Celeven}{\textrm{C11}\xspace}				% C11 symbolic name
+\newcommand{\CCIcon}{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}} % C++ icon
+\newcommand{\CC}[1][]{\protect\CCIcon{#1}\xspace}		% C++ symbolic name
+% numbers disallowed in latex variables names => use number names
+\newcommand{\CCeleven}{\protect\CCIcon{11}\xspace}		% C++11 symbolic name
+\newcommand{\CCfourteen}{\protect\CCIcon{14}\xspace}	% C++14 symbolic name
+\newcommand{\CCseventeen}{\protect\CCIcon{17}\xspace}	% C++17 symbolic name
+\newcommand{\CCtwenty}{\protect\CCIcon{20}\xspace}		% C++20 symbolic name
+\newcommand{\Csharp}{C\raisebox{-0.7ex}{\Large$^\sharp$}\xspace} % C# symbolic name
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% remove special-character warning in PDF side-bar names
+\@ifpackageloaded{hyperref}{
+  \pdfstringdefDisableCommands{
+  \def\CFA{\CFL}
+  \def\Celeven{C11\xspace}
+  \def\CC{C++\xspace}
+  \def\CCeleven{C++11\xspace}
+  \def\CCfourteen{C++14\xspace}
+  \def\CCseventeen{C++17\xspace}
+  \def\CCtwenty{C++20\xspace}
+  \def\Csharp{C\#\xspace}
+  \def\lstinline{\xspace}% must use {} as delimiters, e.g., \lstinline{...}
+  }{}
+}
+
+% parindent is relative, i.e., toggled on/off in environments like itemize, so store the value for
+% use rather than use \parident directly.
+\newlength{\parindentlnth}
+\setlength{\parindentlnth}{\parindent}
+
+\usepackage{pslatex}					% reduce size of san serif font
+\usepackage{relsize}					% must be after change to small or selects old size
+\usepackage{rotating}
+
+% reduce size of chapter/section titles
+\def\@makechapterhead#1{%
+  \vspace*{50\p@}%
+  {\parindent \z@ \raggedright \normalfont
+    \ifnum \c@secnumdepth >\m@ne
+        \large\bfseries \@chapapp\space \thechapter
+        \par\nobreak
+        \vskip 5\p@
+    \fi
+    \interlinepenalty\@M
+    \Large \bfseries #1\par\nobreak
+    \vskip 50\p@
+  }}
+\def\@makeschapterhead#1{%
+  \vspace*{50\p@}%
+  {\parindent \z@ \raggedright
+    \normalfont
+    \interlinepenalty\@M
+    \Large \bfseries  #1\par\nobreak
+    \vskip 50\p@
+  }}
+\renewcommand\section{\@startsection{section}{1}{\z@}{-3.0ex \@plus -1ex \@minus -.2ex}{1.5ex \@plus .2ex}{\normalfont\large\bfseries}}
+\renewcommand\subsection{\@startsection{subsection}{2}{\z@}{-2.75ex \@plus -1ex \@minus -.2ex}{1.25ex \@plus .2ex}{\normalfont\normalsize\bfseries}}
+\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}{-2.5ex \@plus -1ex \@minus -.2ex}{1.0ex \@plus .2ex}{\normalfont\normalsize\bfseries}}
+\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}{-2.0ex \@plus -1ex \@minus -.2ex}{-1em}{\normalfont\normalsize\bfseries}}
+\renewcommand\subparagraph{\@startsection{subparagraph}{4}{\z@}{-1.5ex \@plus -1ex \@minus -.2ex}{-1em}{\normalfont\normalsize\bfseries\itshape}}
+
+% index macros
+\newcommand{\italic}[1]{\emph{\hyperpage{#1}}}
+\newcommand{\Definition}[1]{\textbf{\hyperpage{#1}}}
+\newcommand{\see}[1]{(see #1)}
+
+% Define some commands that produce formatted index entries suitable for cross-references.
+% ``\spec'' produces entries for specifications of entities.  ``\impl'' produces entries for their
+% implementations, and ``\use'' for their uses.
+
+%  \newcommand{\bold}[1]{{\bf #1}}
+%  \def\spec{\@bsphack\begingroup
+%             \def\protect##1{\string##1\space}\@sanitize
+%             \@wrxref{|bold}}
+\def\impl{\@bsphack\begingroup
+          \def\protect##1{\string##1\space}\@sanitize
+          \@wrxref{|Definition}}
+\newcommand{\indexcode}[1]{{\lstinline$#1$}}
+\def\use{\@bsphack\begingroup
+         \def\protect##1{\string##1\space}\@sanitize
+         \@wrxref{|hyperpage}}
+\def\@wrxref#1#2{\let\thepage\relax
+    \xdef\@gtempa{\write\@indexfile{\string
+    \indexentry{#2@{\lstinline$#2$}#1}{\thepage}}}\endgroup\@gtempa
+    \if@nobreak \ifvmode\nobreak\fi\fi\@esphack}
+%\newcommand{\use}[1]{\index{#1@{\lstinline$#1$}}}
+%\newcommand{\impl}[1]{\index{\protect#1@{\lstinline$\protect#1$}|Definition}}
+
+% inline text and lowercase index: \Index{inline and lowercase index text}
+\newcommand{\Index}{\@ifstar\@sIndex\@Index}
+% inline text and as-in index: \Index[as-is index text]{inline text}
+\newcommand{\@Index}[2][\@empty]{\lowercase{\def\temp{#2}}#2\ifx#1\@empty\index{\temp}\else\index{#1@{\protect#2}}\fi}
+% inline text but index with different as-is text: \Index[index text]{inline text}
+\newcommand{\@sIndex}[2][\@empty]{#2\ifx#1\@empty\index{#2}\else\index{#1@{\protect#2}}\fi}
+
+% inline text and code index (cannot use ©)
+\newcommand{\Indexc}[2][\@empty]{\lstinline[#1]$#2$\index{#2@\lstinline[#1]$#2$}}
+% code index (cannot use ©)
+\newcommand{\indexc}[2][\@empty]{\index{#2@\lstinline[#1]$#2$}}
+
+% Denote newterms in particular font and index them without particular font and in lowercase, e.g., \newterm{abc}.
+% The option parameter provides an index term different from the new term, e.g., \newterm[\texttt{abc}]{abc}
+% The star version does not lowercase the index information, e.g., \newterm*{IBM}.
+\newcommand{\newtermFontInline}{\emph}
+\newcommand{\newterm}{\protect\@ifstar\@snewterm\@newterm}
+\newcommand{\@newterm}[2][\@empty]{\lowercase{\def\temp{#2}}{\newtermFontInline{#2}}\ifx#1\@empty\index{\temp}\else\index{#1@{\protect#2}}\fi}
+\newcommand{\@snewterm}[2][\@empty]{{\newtermFontInline{#2}}\ifx#1\@empty\index{#2}\else\index{#1@{\protect#2}}\fi}
+
+% Latin abbreviation
+\newcommand{\abbrevFont}{\textit}			% set empty for no italics
+% If not followed by a comma or colon, add a comma.
+\newcommand{\CheckCommaColon}{\@ifnextchar{,}{}{\@ifnextchar{:}{}{,\xspace}}}
+% If not followed by a period, add a period.
+\newcommand{\CheckPeriod}{\@ifnextchar{.}{}{.\xspace}}
+
+\@ifundefined{eg}{
+\newcommand{\EG}{\abbrevFont{e}.\abbrevFont{g}.}
+\newcommand{\eg}{\EG\CheckCommaColon}
+}{}%
+\@ifundefined{ie}{
+\newcommand{\IE}{\abbrevFont{i}.\abbrevFont{e}.}
+\newcommand{\ie}{\IE\CheckCommaColon}
+}{}%
+\@ifundefined{etc}{
+\newcommand{\ETC}{\abbrevFont{etc}}
+\newcommand{\etc}{\ETC\CheckPeriod}
+}{}%
+\@ifundefined{etal}{
+\newcommand{\ETAL}{\abbrevFont{et}~\abbrevFont{al}}
+\newcommand{\etal}{\ETAL\CheckPeriod}
+}{}%
+\@ifundefined{viz}{
+\newcommand{\VIZ}{\abbrevFont{viz}}
+\newcommand{\viz}{\VIZ\CheckPeriod}
+}{}%
+
+\newenvironment{cquote}{%
+	\list{}{\lstset{resetmargins=true,aboveskip=0pt,belowskip=0pt}\topsep=4pt\parsep=0pt\leftmargin=\parindentlnth\rightmargin\leftmargin}%
+	\item\relax
+}{%
+	\endlist
+}% cquote
+
+\newenvironment{rationale}{%
+  \begin{cquote}\noindent$\Box$\enspace
+}{%
+  \hfill\enspace$\Box$\end{cquote}
+}%
+
+% blocks and titles
+\newcommand{\define}[1]{\emph{#1\/}\index{#1}}
+\newcommand{\rewriterules}{\paragraph{Rewrite Rules}~\par\noindent}
+\newcommand{\examples}{\paragraph{Examples}~\par\noindent}
+\newcommand{\semantics}{\paragraph{Semantics}~\par\noindent}
+\newcommand{\constraints}{\paragraph{Constraints}~\par\noindent}
+\newcommand{\predefined}{\paragraph{Predefined Identifiers}~\par\noindent}
+
+% BNF macros
+\newenvironment{syntax}{
+\paragraph{Syntax}
+\begin{cquote}
+\begin{description}[noitemsep,leftmargin=\parindentlnth]
+}{
+\end{description}
+\end{cquote}
+}
+% \def\syntax{\paragraph{Syntax}\trivlist\parindent=.5in\item[\hskip.5in]}
+%\let\endsyntax=\endtrivlist
+\newcommand{\lhs}[1]{\item[\emph{#1:}\index{#1@{\emph{#1}}|italic}]~\ignorespaces}
+\newcommand{\oldlhs}[1]{\item[\emph{#1:}\index{#1@{\emph{#1}}|italic}~\dots]~}
+\newcommand{\rhs}{\hfil\newline}
+\newcommand{\nonterm}[1]{\emph{#1}\index{#1@{\emph{#1}}|italic}}
+\newcommand{\opt}{$_{opt}$\ }
+
+\usepackage{varioref}					% extended references
+% adjust varioref package with default "section" and "page" titles, and optional title with faraway page numbers
+% \VRef{label} => Section 2.7, \VPageref{label} => page 17
+% \VRef[Figure]{label} => Figure 3.4, \VPageref{label} => page 17
+\renewcommand{\reftextfaceafter}{\unskip}
+\renewcommand{\reftextfacebefore}{\unskip}
+\renewcommand{\reftextafter}{\unskip}
+\renewcommand{\reftextbefore}{\unskip}
+\renewcommand{\reftextfaraway}[1]{\unskip, p.~\pageref{#1}}
+\renewcommand{\reftextpagerange}[2]{\unskip, pp.~\pageref{#1}--\pageref{#2}}
+\newcommand{\VRef}[2][Section]{\ifx#1\@empty\else{#1}\nobreakspace\fi\vref{#2}}
+\newcommand{\VPageref}[2][page]{\ifx#1\@empty\else{#1}\nobreakspace\fi\pageref{#2}}
+
+\let\Oldthebibliography\thebibliography
+\renewcommand\thebibliography[1]{
+  \Oldthebibliography{#1}
+  \setlength{\parskip}{0pt}				% reduce vertical spacing between references
+  \setlength{\itemsep}{5pt plus 0.3ex}
+}%
+
+\usepackage{listings}									% format program code
+\usepackage{lstlang}
+\usepackage{calc}										% latex arithmetic
+
+\newcommand{\LstBasicStyle}[1]{{\lst@basicstyle{#1}}}
+\newcommand{\LstKeywordStyle}[1]{{\lst@basicstyle{\lst@keywordstyle{#1}}}}
+\newcommand{\LstCommentStyle}[1]{{\lst@basicstyle{\lst@commentstyle{#1}}}}
+\newcommand{\LstStringStyle}[1]{{\lst@basicstyle{\lst@stringstyle{#1}}}}
+
+\newlength{\gcolumnposn}				% temporary hack because lstlisting does not handle tabs correctly
+\newlength{\columnposn}
+\setlength{\gcolumnposn}{2.75in}
+\setlength{\columnposn}{\gcolumnposn}
+\newcommand{\C}[2][\@empty]{\ifx#1\@empty\else\global\setlength{\columnposn}{#1}\global\columnposn=\columnposn\fi\hfill\makebox[\textwidth-\columnposn][l]{\lst@basicstyle{\LstCommentStyle{#2}}}}
+\newcommand{\CRT}{\global\columnposn=\gcolumnposn}
+
+% allow escape sequence in lstinline
+%\usepackage{etoolbox}
+%\patchcmd{\lsthk@TextStyle}{\let\lst@DefEsc\@empty}{}{}{\errmessage{failed to patch}}
+
+% allow adding to lst literate
+\def\addToLiterate#1{\protect\edef\lst@literate{\unexpanded\expandafter{\lst@literate}\unexpanded{#1}}}
+\lst@Key{add to literate}{}{\addToLiterate{#1}}
+
+\newcommand{\CFAStyle}{%
+\lstset{
+columns=fullflexible,
+basicstyle=\linespread{0.9}\sf,			% reduce line spacing and use sanserif font
+stringstyle=\tt,						% use typewriter font
+tabsize=5,								% N space tabbing
+xleftmargin=\parindentlnth,				% indent code to paragraph indentation
+extendedchars=true,						% allow ASCII characters in the range 128-255
+escapechar=\$,							% LaTeX escape in CFA code §...§ (section symbol), emacs: C-q M-'
+mathescape=false,						% LaTeX math escape in CFA code $...$
+keepspaces=true,						%
+showstringspaces=false,					% do not show spaces with cup
+showlines=true,							% show blank lines at end of code
+aboveskip=4pt,							% spacing above/below code block
+belowskip=2pt,
+numberstyle=\footnotesize\sf,			% numbering style
+% replace/adjust listing characters that look bad in sanserif
+literate={-}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.75ex}{0.1ex}}}}1 {^}{\raisebox{0.6ex}{$\scriptscriptstyle\land\,$}}1
+	{~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1 {`}{\ttfamily\upshape\hspace*{-0.1ex}`}1
+	{<-}{$\leftarrow$}2 {=>}{$\Rightarrow$}2 {->}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.8ex}{0.075ex}}}\kern-0.2ex\textgreater}2,
+}% lstset
+}% CFAStyle
+
+\ifdefined\CFALatin% extra Latin-1 escape characters
+\lstnewenvironment{cfa}[1][]{% necessary
+\lstset{
+language=CFA,
+%moredelim=**[is][\color{red}]{@}{@},	% red highlighting @...@
+moredelim=**[is][\color{red}]{®}{®},	% red highlighting ®...® (registered trademark symbol) emacs: C-q M-.
+%moredelim=**[is][\color{blue}]{ß}{ß},	% blue highlighting ß...ß (sharp s symbol) emacs: C-q M-_
+%moredelim=**[is][\color{OliveGreen}]{¢}{¢}, % green highlighting ¢...¢ (cent symbol) emacs: C-q M-"
+%moredelim=[is][\lstset{keywords={}}]{¶}{¶}, % keyword escape ¶...¶ (pilcrow symbol) emacs: C-q M-^
+}% lstset
+\lstset{#1}% necessary
+}{}
+% inline code ©...© (copyright symbol) emacs: C-q M-)
+\lstMakeShortInline©					% single-character for \lstinline
+\else% regular ASCI characters
+\lstnewenvironment{cfa}[1][]{% necessary
+\lstset{
+language=CFA,
+escapechar=\$,							% LaTeX escape in CFA code
+mathescape=false,						% LaTeX math escape in CFA code $...$
+moredelim=**[is][\color{red}]{@}{@},	% red highlighting @...@
+}% lstset
+\lstset{#1}% necessary
+}{}
+% inline code @...@ (at symbol)
+\lstMakeShortInline@					% single-character for \lstinline
+\fi%
+
+% Local Variables: %
+% tab-width: 4 %
+% fill-column: 100 %
+% End: %
