Index: doc/LaTeXmacros/common.tex
===================================================================
--- doc/LaTeXmacros/common.tex	(revision e55ca0532660df6b168cbfe023499f87bda57a53)
+++ doc/LaTeXmacros/common.tex	(revision e55ca0532660df6b168cbfe023499f87bda57a53)
@@ -0,0 +1,203 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Names used in the document.
+
+\newcommand{\CFA}{C$\mathbf\forall$\xspace}				% set language symbolic name
+\newcommand{\CFL}{Cforall\xspace}						% set language text name
+\newcommand{\CC}{C\kern-.1em\hbox{+\kern-.25em+}\xspace} % CC symbolic name
+\def\c11{ISO/IEC C} % C11 name (cannot have numbers in latex command name)
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\makeatletter
+% allow escape sequence in lstinline
+%\usepackage{etoolbox}
+%\patchcmd{\lsthk@TextStyle}{\let\lst@DefEsc\@empty}{}{}{\errmessage{failed to patch}}
+
+% make fontsize "small" slightly larger, specifically for san serif (helvetica) in program code
+\renewcommand\small{%
+   \@setfontsize\small{8.5}{11}%
+   \abovedisplayskip 8.5pt \@plus 3pt \@minus 4pt
+   \abovedisplayshortskip \z@ \@plus 2pt
+   \belowdisplayshortskip 4pt \@plus 2pt \@minus 2pt
+   \def\@listi{\leftmargin\leftmargini
+               \topsep 4pt \@plus 2pt \@minus 2pt
+               \parsep 2pt \@pluspt \@minuspt
+               \itemsep \parsep}%
+   \belowdisplayskip \abovedisplayskip
+}
+\usepackage{relsize}									% must be after change to small or selects old size
+
+% 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.0ex \@plus .2ex}{\normalfont\large\bfseries}}
+\renewcommand\subsection{\@startsection{subsection}{2}{\z@}{-2.5ex \@plus -1ex \@minus -.2ex}{1.0ex \@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}}
+
+% index macros
+\newcommand{\italic}[1]{\emph{\hyperpage{#1}}}
+\newcommand{\definition}[1]{\textbf{\hyperpage{#1}}}
+\newcommand{\see}[1]{\emph{see} #1}
+
+% reduce bullet size and spacing for "itemize" macro
+\renewcommand{\labelitemi}{{\raisebox{0.25ex}{\footnotesize$\bullet$}}}
+\renewenvironment{itemize}{\begin{list}{\labelitemi}{\topsep=5pt\itemsep=5pt\parsep=0pt}}{\end{list}}
+
+% 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}
+% inline text and as-in index: \Index[as-is index text]{inline text}
+% inline text but index with different as-is text: \Index[index text]{inline text}
+\newcommand{\Index}{\@ifstar\@sIndex\@Index}
+\newcommand{\@Index}[2][\@empty]{\lowercase{\def\temp{#2}}#2\ifx#1\@empty\index{\temp}\else\index{#1@{\protect#2}}\fi}
+\newcommand{\@sIndex}[2][\@empty]{#2\ifx#1\@empty\index{#2}\else\index{#1@{\protect#2}}\fi}
+
+\newcommand{\newtermFontInline}{\emph}
+\newcommand{\newterm}{\@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}
+\makeatother
+
+\newenvironment{quote2}{%
+	\list{}{\lstset{resetmargins=true}\leftmargin=\parindent\rightmargin\leftmargin}%
+	\item\relax
+}{%
+	\endlist
+}% quote2
+\newenvironment{rationale}{%
+  \begin{quotation}\noindent$\Box$\enspace
+}{%
+  \hfill\enspace$\Box$\end{quotation}
+}%
+
+% blocks and titles
+\newcommand{\define}[1]{\emph{#1\/}\index{#1}}
+\newcommand{\rewrite}{\(\Rightarrow\)}
+\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
+\def\syntax{\paragraph{Syntax}\trivlist\parindent=.5in\item[\hskip.5in]}
+\let\endsyntax=\endtrivlist
+\newcommand{\lhs}[1]{\par{\emph{#1:}}\index{#1@{\emph{#1}}|italic}}
+\newcommand{\rhs}{\hfil\break\hbox{\hskip1in}}
+\newcommand{\oldlhs}[1]{\emph{#1: \ldots}\index{#1@{\emph{#1}}|italic}}
+\newcommand{\nonterm}[1]{\emph{#1\/}\index{#1@{\emph{#1}}|italic}}
+\newcommand{\opt}{$_{opt}$\ }
+
+% 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}}
+
+% Go programming language
+\lstdefinelanguage{Golang}{
+	morekeywords=[1]{package,import,func,type,struct,return,defer,panic, recover,select,var,const,iota,},%
+	morekeywords=[2]{string,uint,uint8,uint16,uint32,uint64,int,int8,int16, int32,int64,
+		bool,float32,float64,complex64,complex128,byte,rune,uintptr, error,interface},%
+	morekeywords=[3]{map,slice,make,new,nil,len,cap,copy,close,true,false, delete,append,real,imag,complex,chan,},%
+	morekeywords=[4]{for,break,continue,range,goto,switch,case,fallthrough,if, else,default,},%
+	morekeywords=[5]{Println,Printf,Error,},%
+	sensitive=true,%
+	morecomment=[l]{//},%
+	morecomment=[s]{/*}{*/},%
+	morestring=[b]',%
+	morestring=[b]",%
+	morestring=[s]{`}{`},%
+}
+
+% CFA programming language, based on ANSI C
+\lstdefinelanguage{CFA}[ANSI]{C}{
+	morekeywords={_Alignas,_Alignof,__alignof,__alignof__,asm,__asm,__asm__,_At,_Atomic,__attribute,__attribute__,auto,
+		_Bool,catch,catchResume,choose,_Complex,__complex,__complex__,__const,__const__,disable,dtype,enable,__extension__,
+		fallthru,finally,forall,ftype,_Generic,_Imaginary,inline,__label__,lvalue,_Noreturn,otype,restrict,_Static_assert,
+		_Thread_local,throw,throwResume,trait,try,typeof,__typeof,__typeof__,},
+	moredelim=**[is][\color{red}]{`}{`}, % red highlighting of program text
+}%
+
+\lstset{
+language=CFA,
+columns=flexible,
+basicstyle=\sf\relsize{-1},
+tabsize=4,
+xleftmargin=\parindent,
+escapechar=@,
+mathescape=true,
+keepspaces=true,
+showstringspaces=false,
+showlines=true,
+aboveskip=6pt,
+belowskip=4pt,
+literate={\\`}{\raisebox{0.3ex}{\ttfamily\upshape \hspace*{-2pt}`}}1, % escape \`, otherwise used for red highlighting
+}%
+
+\makeatletter
+% replace/adjust listings characters that look bad in sanserif
+\lst@CCPutMacro
+\lst@ProcessOther{"22}{\lst@ttfamily{"}{\raisebox{0.3ex}{\ttfamily\upshape "}}} % replace double quote
+\lst@ProcessOther{"27}{\lst@ttfamily{'}{\raisebox{0.3ex}{\ttfamily\upshape '\hspace*{-2pt}}}} % replace single quote
+\lst@ProcessOther{"2D}{\lst@ttfamily{-}{\ttfamily\upshape -}} % replace minus
+\lst@ProcessOther{"3C}{\lst@ttfamily{<}{\texttt{<}}} % replace less than
+\lst@ProcessOther{"3E}{\lst@ttfamily{<}{\texttt{>}}} % replace greater than
+\lst@ProcessOther{"5E}{\raisebox{0.4ex}{$\scriptstyle\land\,$}} % replace circumflex
+\lst@ProcessOther{"5F}{\lst@ttfamily{\char95}{{\makebox[1.2ex][c]{\rule{1ex}{0.1ex}}}}} % replace underscore
+\lst@ProcessOther{"60}{\lst@ttfamily{`}{\raisebox{0.3ex}{\ttfamily\upshape \hspace*{-2pt}`}}} % replace backquote
+\lst@ProcessOther{"7E}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}} % replace tilde
+%\lst@ProcessOther{"7E}{\raisebox{-.4ex}[1ex][0pt]{\textasciitilde}} % lower tilde
+\@empty\z@\@empty % NECESSARY DO NOT REMOVE
+\makeatother
+
+% Local Variables: %
+% tab-width: 4 %
+% fill-column: 100 %
+% End: %
Index: doc/LaTeXmacros/indexstyle
===================================================================
--- doc/LaTeXmacros/indexstyle	(revision e55ca0532660df6b168cbfe023499f87bda57a53)
+++ doc/LaTeXmacros/indexstyle	(revision e55ca0532660df6b168cbfe023499f87bda57a53)
@@ -0,0 +1,2 @@
+preamble ""
+postamble ""
Index: doc/bibliography/cfa.bib
===================================================================
--- doc/bibliography/cfa.bib	(revision e55ca0532660df6b168cbfe023499f87bda57a53)
+++ doc/bibliography/cfa.bib	(revision e55ca0532660df6b168cbfe023499f87bda57a53)
@@ -0,0 +1,1 @@
+/usr/local/bibliographies/pl.bib
Index: doc/refrat/Makefile
===================================================================
--- doc/refrat/Makefile	(revision 9827c7ba5413abbccb22da6f8446abc970030c2e)
+++ doc/refrat/Makefile	(revision e55ca0532660df6b168cbfe023499f87bda57a53)
@@ -1,8 +1,7 @@
 ## Define the appropriate configuration variables.
 
-Macros = 
-TeXLIB = .:${Macros}:
+TeXLIB = .:../bibliography/:../LaTeXmacros/:
 LaTeX  = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex
-BibTeX = BSTINPUTS=${TeXLIB} && export BSTINPUTS && bibtex
+BibTeX = BIBINPUTS=${TeXLIB} && export BIBINPUTS && bibtex
 
 ## Define the text source files.
@@ -44,5 +43,6 @@
 	dvips $< -o $@
 
-${basename ${DOCUMENT}}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} ${basename ${DOCUMENT}}.tex ${basename ${DOCUMENT}}.bib
+${basename ${DOCUMENT}}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} ${basename ${DOCUMENT}}.tex \
+		../LaTeXmacros/common.tex ../LaTeXmacros/indexstyle ../bibliography/cfa.bib
 	# Conditionally create an empty *.ind (index) file for inclusion until makeindex is run.
 	if [ ! -r ${basename $@}.ind ] ; then touch ${basename $@}.ind ; fi
@@ -54,5 +54,5 @@
 	-${BibTeX} ${basename $@}
 	# Make index from *.aux entries and input index at end of document
-	makeindex -s indexstyle ${basename $@}.idx
+	makeindex -s ../LaTeXmacros/indexstyle ${basename $@}.idx
 	${LaTeX} ${basename $@}.tex
 	# Run again to get index title into table of contents
Index: c/refrat/indexstyle
===================================================================
--- doc/refrat/indexstyle	(revision 9827c7ba5413abbccb22da6f8446abc970030c2e)
+++ 	(revision )
@@ -1,2 +1,0 @@
-preamble ""
-postamble ""
Index: doc/refrat/refrat.tex
===================================================================
--- doc/refrat/refrat.tex	(revision 9827c7ba5413abbccb22da6f8446abc970030c2e)
+++ doc/refrat/refrat.tex	(revision e55ca0532660df6b168cbfe023499f87bda57a53)
@@ -11,6 +11,6 @@
 %% Created On       : Wed Apr  6 14:52:25 2016
 %% Last Modified By : Peter A. Buhr
-%% Last Modified On : Wed Apr  6 21:57:27 2016
-%% Update Count     : 2
+%% Last Modified On : Fri Apr  8 18:32:07 2016
+%% Update Count     : 6
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -36,170 +36,6 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-% Names used in the document.
-
-\newcommand{\CFA}{C$\mathbf\forall$\xspace}	% set language symbolic name
-\newcommand{\CFL}{Cforall\xspace}		% set language text name
-\newcommand{\CC}{C\kern-.1em\hbox{+\kern-.25em+}\xspace} % CC symbolic name
-\def\c11{ISO/IEC C} % C11 name (cannot have numbers in latex command name)
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 % Bespoke macros used in the document.
-
-\makeatletter
-% allow escape sequence in lstinline
-%\usepackage{etoolbox}
-%\patchcmd{\lsthk@TextStyle}{\let\lst@DefEsc\@empty}{}{}{\errmessage{failed to patch}}
-
-\renewcommand\small{%
-   \@setfontsize\small{8.5}{11}%
-   \abovedisplayskip 8.5pt \@plus 3pt \@minus 4pt
-   \abovedisplayshortskip \z@ \@plus 2pt
-   \belowdisplayshortskip 4pt \@plus 2pt \@minus 2pt
-   \def\@listi{\leftmargin\leftmargini
-               \topsep 4pt \@plus 2pt \@minus 2pt
-               \parsep 2pt \@pluspt \@minuspt
-               \itemsep \parsep}%
-   \belowdisplayskip \abovedisplayskip
-}
-\usepackage{relsize}            % must be after change to small
-
-\renewcommand{\labelitemi}{{\raisebox{0.25ex}{\footnotesize$\bullet$}}}
-\renewenvironment{itemize}{\begin{list}{\labelitemi}{\topsep=5pt\itemsep=5pt\parsep=0pt}}{\end{list}}
-
-%  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.0ex \@plus .2ex}{\normalfont\large\bfseries}}
-\renewcommand\subsection{\@startsection{subsection}{2}{\z@}{-2.5ex \@plus -1ex \@minus -.2ex}{1.0ex \@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}}
-
-% index macros
-\newcommand{\italic}[1]{\emph{\hyperpage{#1}}}
-\newcommand{\definition}[1]{\textbf{\hyperpage{#1}}}
-\newcommand{\see}[1]{\emph{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}
-% inline text and as-in index: \Index[as-is index text]{inline text}
-% inline text but index with different as-is text: \Index[index text]{inline text}
-\newcommand{\Index}{\@ifstar\@sIndex\@Index}
-\newcommand{\@Index}[2][\@empty]{\lowercase{\def\temp{#2}}#2\ifx#1\@empty\index{\temp}\else\index{#1@{\protect#2}}\fi}
-\newcommand{\@sIndex}[2][\@empty]{#2\ifx#1\@empty\index{#2}\else\index{#1@{\protect#2}}\fi}
-\makeatother
-
-% blocks and titles
-\newenvironment{rationale}{%
-  \begin{quotation}\noindent$\Box$\enspace
-}{%
-  \hfill\enspace$\Box$\end{quotation}
-}%
-\newcommand{\define}[1]{\emph{#1\/}\index{#1}}
-\newcommand{\rewrite}{\(\Rightarrow\)}
-\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
-\def\syntax{\paragraph{Syntax}\trivlist\parindent=.5in\item[\hskip.5in]}
-\let\endsyntax=\endtrivlist
-\newcommand{\lhs}[1]{\par{\emph{#1:}}\index{#1@{\emph{#1}}|italic}}
-\newcommand{\rhs}{\hfil\break\hbox{\hskip1in}}
-\newcommand{\oldlhs}[1]{\emph{#1: \ldots}\index{#1@{\emph{#1}}|italic}}
-\newcommand{\nonterm}[1]{\emph{#1\/}\index{#1@{\emph{#1}}|italic}}
-\newcommand{\opt}{$_{opt}$\ }
-
-% 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}}
-
-% CFA based on ANSI C
-\lstdefinelanguage{CFA}[ANSI]{C}%
-{morekeywords={_Alignas,_Alignof,__alignof,__alignof__,asm,__asm,__asm__,_At,_Atomic,__attribute,__attribute__,auto,
-    _Bool,catch,catchResume,choose,_Complex,__complex,__complex__,__const,__const__,disable,dtype,enable,__extension__,
-	fallthru,finally,forall,ftype,_Generic,_Imaginary,inline,__label__,lvalue,_Noreturn,otype,restrict,_Static_assert,
-	_Thread_local,throw,throwResume,trait,try,typeof,__typeof,__typeof__,},
-}%
-
-\lstset{
-language=CFA,
-columns=flexible,
-basicstyle=\sf\relsize{-1},
-tabsize=4,
-xleftmargin=\parindent,
-escapechar=@,
-mathescape=true,
-keepspaces=true,
-showstringspaces=false,
-showlines=true,
-aboveskip=6pt,
-belowskip=4pt,
-}%
-
-\makeatletter
-% replace/adjust listings characters that look bad in sanserif
-\lst@CCPutMacro
-\lst@ProcessOther{"22}{\lst@ttfamily{"}{\raisebox{0.3ex}{\ttfamily\upshape "}}} % replace double quote
-\lst@ProcessOther{"27}{\lst@ttfamily{'}{\raisebox{0.3ex}{\ttfamily\upshape '\hspace*{-2pt}}}} % replace single quote
-\lst@ProcessOther{"2D}{\lst@ttfamily{-}{\ttfamily\upshape -}} % replace minus
-\lst@ProcessOther{"3C}{\lst@ttfamily{<}{\texttt{<}}} % replace less than
-\lst@ProcessOther{"3E}{\lst@ttfamily{<}{\texttt{>}}} % replace greater than
-\lst@ProcessOther{"5E}{\raisebox{0.4ex}{$\scriptstyle\land\,$}} % replace circumflex
-\lst@ProcessOther{"5F}{\lst@ttfamily{\char95}{{\makebox[1.2ex][c]{\rule{1ex}{0.1ex}}}}} % replace underscore
-\lst@ProcessOther{"60}{\lst@ttfamily{`}{\raisebox{0.3ex}{\ttfamily\upshape \hspace*{-2pt}`}}} % replace backquote
-\lst@ProcessOther{"7E}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}} % replace tilde
-%\lst@ProcessOther{"7E}{\raisebox{-.4ex}[1ex][0pt]{\textasciitilde}} % lower tilde
-\@empty\z@\@empty
-\makeatother
+\input{common}
 
 \setcounter{secnumdepth}{3}     % number subsubsections
@@ -248,5 +84,5 @@
 
 This document is a reference manual and rationale for \CFA, a polymorphic extension of the C programming language.
-It makes frequent reference to the {\c11} standard \cite{ANS:C11}, and occasionally compares \CFA to {\CC} \cite{c++}.
+It makes frequent reference to the {\c11} standard \cite{C11}, and occasionally compares \CFA to {\CC} \cite{C++}.
 
 The manual deliberately imitates the ordering of the {\c11} standard (although the section numbering differs).
@@ -742,5 +578,5 @@
 
 There are two notable differences between \CFA's overload resolution rules and the rules for
-{\CC} defined in \cite{c++}.
+{\CC} defined in \cite{C++}.
 First, the result type of a function plays a role.
 In {\CC}, a function call must be completely resolved based on the arguments to the call in most circumstances.
@@ -3406,14 +3242,14 @@
 \begin{itemize}
 \item
-Inside a Clu cluster \cite{clu}, the declaration of an instance states which view applies.
+Inside a Clu cluster \cite{CLU}, the declaration of an instance states which view applies.
 Two primitives called \lstinline$up$ and \lstinline$down$ can be used to convert between the views.
 \item
-The Simula class \cite{Simula87} is essentially a record type.
+The Simula class \cite{SIMULA87} is essentially a record type.
 Since the only operations on a record are member selection and assignment, which can not be overloaded, there is never any ambiguity as to whether the abstraction or the implementation view is being used.
 In {\CC}
-\cite{c++}, operations on class instances include assignment and ``\lstinline$&$'', which can be overloaded.
+\cite{C++}, operations on class instances include assignment and ``\lstinline$&$'', which can be overloaded.
 A ``scope resolution'' operator can be used inside the class to specify whether the abstract or implementation version of the operation should be used.
 \item
-An Ada derived type definition \cite{ada} creates a new type from an old type, and also implicitly declares derived subprograms that correspond to the existing subprograms that use the old type as a parameter type or result type.
+An Ada derived type definition \cite{Ada} creates a new type from an old type, and also implicitly declares derived subprograms that correspond to the existing subprograms that use the old type as a parameter type or result type.
 The derived subprograms are clones of the existing subprograms with the old type replaced by the derived type.
 Literals and aggregates of the old type are also cloned.
@@ -4028,5 +3864,5 @@
 
 \bibliographystyle{plain}
-\bibliography{refrat}
+\bibliography{cfa}
 
 
Index: doc/user/Makefile
===================================================================
--- doc/user/Makefile	(revision 9827c7ba5413abbccb22da6f8446abc970030c2e)
+++ doc/user/Makefile	(revision e55ca0532660df6b168cbfe023499f87bda57a53)
@@ -1,7 +1,7 @@
 ## Define the appropriate configuration variables.
 
-TeXLIB = .::
+TeXLIB = .:../bibliography/:../LaTeXmacros/:
 LaTeX  = TEXINPUTS=${TeXLIB} && export TEXINPUTS && latex
-BibTeX = BSTINPUTS=${TeXLIB} && export BSTINPUTS && bibtex
+BibTeX = BIBINPUTS=${TeXLIB} && export BIBINPUTS && bibtex
 
 ## Define the text source files.
@@ -43,5 +43,6 @@
 	dvips $< -o $@
 
-${basename ${DOCUMENT}}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} ${basename ${DOCUMENT}}.tex ${basename ${DOCUMENT}}.bib /usr/local/bibliographies/pl.bib
+${basename ${DOCUMENT}}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} ${basename ${DOCUMENT}}.tex \
+		../LaTeXmacros/common.tex ../LaTeXmacros/indexstyle ../bibliography/cfa.bib
 	# Conditionally create an empty *.ind (index) file for inclusion until makeindex is run.
 	if [ ! -r ${basename $@}.ind ] ; then touch ${basename $@}.ind ; fi
@@ -53,5 +54,5 @@
 	-${BibTeX} ${basename $@}
 	# Make index from *.aux entries and input index at end of document
-	makeindex -s indexstyle ${basename $@}.idx
+	makeindex -s ../LaTeXmacros/indexstyle ${basename $@}.idx
 	${LaTeX} ${basename $@}.tex
 	# Run again to get index title into table of contents
Index: c/user/indexstyle
===================================================================
--- doc/user/indexstyle	(revision 9827c7ba5413abbccb22da6f8446abc970030c2e)
+++ 	(revision )
@@ -1,2 +1,0 @@
-preamble ""
-postamble ""
Index: doc/user/user.tex
===================================================================
--- doc/user/user.tex	(revision 9827c7ba5413abbccb22da6f8446abc970030c2e)
+++ doc/user/user.tex	(revision e55ca0532660df6b168cbfe023499f87bda57a53)
@@ -11,6 +11,6 @@
 %% Created On       : Wed Apr  6 14:53:29 2016
 %% Last Modified By : Peter A. Buhr
-%% Last Modified On : Wed Apr  6 17:37:39 2016
-%% Update Count     : 34
+%% Last Modified On : Fri Apr  8 11:40:53 2016
+%% Update Count     : 42
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -43,8 +43,4 @@
 % Names used in the document.
 
-\newcommand{\CFA}{C$\mathbf\forall$\xspace}	% set language symbolic name
-\newcommand{\CFL}{Cforall\xspace}		% set language text name
-\newcommand{\CC}{C\kern-.1em\hbox{+\kern-.25em+}\xspace} % CC symbolic name
-\def\c11{ISO/IEC C} % C11 name (cannot have numbers in latex command name)
 \newcommand{\CS}{C\raisebox{-0.9ex}{\large$^\sharp$}\xspace}
 
@@ -52,170 +48,5 @@
 
 % Bespoke macros used in the document.
-
-\makeatletter
-% allow escape sequence in lstinline
-%\usepackage{etoolbox}
-%\patchcmd{\lsthk@TextStyle}{\let\lst@DefEsc\@empty}{}{}{\errmessage{failed to patch}}
-
-\renewcommand\small{%
-   \@setfontsize\small{8.5}{11}%
-   \abovedisplayskip 8.5pt \@plus 3pt \@minus 4pt
-   \abovedisplayshortskip \z@ \@plus 2pt
-   \belowdisplayshortskip 4pt \@plus 2pt \@minus 2pt
-   \def\@listi{\leftmargin\leftmargini
-               \topsep 4pt \@plus 2pt \@minus 2pt
-               \parsep 2pt \@pluspt \@minuspt
-               \itemsep \parsep}%
-   \belowdisplayskip \abovedisplayskip
-}
-\usepackage{relsize}            % must be after change to small
-
-\renewcommand{\labelitemi}{{\raisebox{0.25ex}{\footnotesize$\bullet$}}}
-\renewenvironment{itemize}{\begin{list}{\labelitemi}{\topsep=5pt\itemsep=5pt\parsep=0pt}}{\end{list}}
-
-%  Reduce size of section titles
-\renewcommand\section{\@startsection{section}{1}{\z@}{-3.0ex \@plus -1ex \@minus -.2ex}{1.0ex \@plus .2ex}{\normalfont\large\bfseries}}
-\renewcommand\subsection{\@startsection{subsection}{2}{\z@}{-2.5ex \@plus -1ex \@minus -.2ex}{1.0ex \@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}}
-
-% index macros
-\newcommand{\italic}[1]{\emph{\hyperpage{#1}}}
-\newcommand{\definition}[1]{\textbf{\hyperpage{#1}}}
-\newcommand{\see}[1]{\emph{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}
-% inline text and as-in index: \Index[as-is index text]{inline text}
-% inline text but index with different as-is text: \Index[index text]{inline text}
-\newcommand{\Index}{\@ifstar\@sIndex\@Index}
-\newcommand{\@Index}[2][\@empty]{\lowercase{\def\temp{#2}}#2\ifx#1\@empty\index{\temp}\else\index{#1@{\protect#2}}\fi}
-\newcommand{\@sIndex}[2][\@empty]{#2\ifx#1\@empty\index{#2}\else\index{#1@{\protect#2}}\fi}
-
-\newcommand{\newtermFontInline}{\emph}
-\newcommand{\newterm}{\@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}
-\makeatother
-
-% blocks and titles
-\newenvironment{quote2}{%
-	\list{}{\lstset{resetmargins=true}\leftmargin=\parindent\rightmargin\leftmargin}%
-	\item\relax
-}{%
-	\endlist
-}% quote2
-\newenvironment{rationale}{%
-  \begin{quotation}\noindent$\Box$\enspace
-}{%
-  \hfill\enspace$\Box$\end{quotation}
-}%
-\newcommand{\define}[1]{\emph{#1\/}\index{#1}}
-\newcommand{\rewrite}{\(\Rightarrow\)}
-\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
-\def\syntax{\paragraph{Syntax}\trivlist\parindent=.5in\item[\hskip.5in]}
-\let\endsyntax=\endtrivlist
-\newcommand{\lhs}[1]{\par{\emph{#1:}}\index{#1@{\emph{#1}}|italic}}
-\newcommand{\rhs}{\hfil\break\hbox{\hskip1in}}
-\newcommand{\oldlhs}[1]{\emph{#1: \ldots}\index{#1@{\emph{#1}}|italic}}
-\newcommand{\nonterm}[1]{\emph{#1\/}\index{#1@{\emph{#1}}|italic}}
-\newcommand{\opt}{$_{opt}$\ }
-
-% 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}}
-
-% Go programming language
-\lstdefinelanguage{Golang}%
-  {morekeywords=[1]{package,import,func,type,struct,return,defer,panic, recover,select,var,const,iota,},%
-   morekeywords=[2]{string,uint,uint8,uint16,uint32,uint64,int,int8,int16, int32,int64,
-		bool,float32,float64,complex64,complex128,byte,rune,uintptr, error,interface},%
-   morekeywords=[3]{map,slice,make,new,nil,len,cap,copy,close,true,false, delete,append,real,imag,complex,chan,},%
-   morekeywords=[4]{for,break,continue,range,goto,switch,case,fallthrough,if, else,default,},%
-   morekeywords=[5]{Println,Printf,Error,},%
-   sensitive=true,%
-   morecomment=[l]{//},%
-   morecomment=[s]{/*}{*/},%
-   morestring=[b]',%
-   morestring=[b]",%
-   morestring=[s]{`}{`},%
-}
-
-% CFA based on ANSI C
-\lstdefinelanguage{CFA}[ANSI]{C}%
-{morekeywords={_Alignas,_Alignof,__alignof,__alignof__,asm,__asm,__asm__,_At,_Atomic,__attribute,__attribute__,auto,
-    _Bool,catch,catchResume,choose,_Complex,__complex,__complex__,__const,__const__,disable,dtype,enable,__extension__,
-	fallthru,finally,forall,ftype,_Generic,_Imaginary,inline,__label__,lvalue,_Noreturn,otype,restrict,_Static_assert,
-	_Thread_local,throw,throwResume,trait,try,typeof,__typeof,__typeof__,},
-  moredelim=**[is][\color{red}]{`}{`},
-}%
-
-\lstset{
-language=CFA,
-columns=flexible,
-basicstyle=\sf\relsize{-1},
-tabsize=4,
-xleftmargin=\parindent,
-escapechar=@,
-mathescape=true,
-keepspaces=true,
-showstringspaces=false,
-showlines=true,
-aboveskip=6pt,
-belowskip=4pt,
-literate={\\`}{\raisebox{0.3ex}{\ttfamily\upshape \hspace*{-2pt}`}}1, % escape \`, otherwise used to highlight in red
-%extendedchars=true,
-}%
-
-\makeatletter
-% replace/adjust listings characters that look bad in sanserif
-\lst@CCPutMacro
-\lst@ProcessOther{"22}{\lst@ttfamily{"}{\raisebox{0.3ex}{\ttfamily\upshape "}}} % replace double quote
-\lst@ProcessOther{"27}{\lst@ttfamily{'}{\raisebox{0.3ex}{\ttfamily\upshape '\hspace*{-2pt}}}} % replace single quote
-\lst@ProcessOther{"2D}{\lst@ttfamily{-}{\ttfamily\upshape -}} % replace minus
-\lst@ProcessOther{"3C}{\lst@ttfamily{<}{\texttt{<}}} % replace less than
-\lst@ProcessOther{"3E}{\lst@ttfamily{<}{\texttt{>}}} % replace greater than
-\lst@ProcessOther{"5E}{\raisebox{0.4ex}{$\scriptstyle\land\,$}} % replace circumflex
-\lst@ProcessOther{"5F}{\lst@ttfamily{\char95}{{\makebox[1.2ex][c]{\rule{1ex}{0.1ex}}}}} % replace underscore
-\lst@ProcessOther{"60}{\lst@ttfamily{`}{\raisebox{0.3ex}{\ttfamily\upshape \hspace*{-2pt}`}}} % replace backquote
-\lst@ProcessOther{"7E}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}} % replace tilde
-%\lst@ProcessOther{"7E}{\raisebox{-.4ex}[1ex][0pt]{\textasciitilde}} % lower tilde
-\@empty\z@\@empty
-\makeatother
+\input{common}
 
 \setcounter{secnumdepth}{3}     % number subsubsections
@@ -4573,6 +4404,58 @@
 
 
+\section{Rational Numbers}
+\label{s:RationalNumbers}
+
+Rational numbers are numbers written as a ratio, i.e., as a fraction, where the numerator (top number) and the denominator (bottom number) are whole numbers.
+When creating and computing with rational numbers, results are constantly reduced to keep the numerator and denominator as small as possible.
+
+\begin{lstlisting}
+// implementation
+struct Rational {
+	long int numerator, denominator;					// invariant: denominator > 0
+}; // Rational
+
+// constants
+extern struct Rational 0;
+extern struct Rational 1;
+
+// constructors
+Rational rational();
+Rational rational( long int n );
+Rational rational( long int n, long int d );
+
+// getter/setter for numerator/denominator
+long int numerator( Rational r );
+long int numerator( Rational r, long int n );
+long int denominator( Rational r );
+long int denominator( Rational r, long int d );
+
+// comparison
+int ?==?( Rational l, Rational r );
+int ?!=?( Rational l, Rational r );
+int ?<?( Rational l, Rational r );
+int ?<=?( Rational l, Rational r );
+int ?>?( Rational l, Rational r );
+int ?>=?( Rational l, Rational r );
+
+// arithmetic
+Rational -?( Rational r );
+Rational ?+?( Rational l, Rational r );
+Rational ?-?( Rational l, Rational r );
+Rational ?*?( Rational l, Rational r );
+Rational ?/?( Rational l, Rational r );
+
+// conversion
+double widen( Rational r );
+Rational narrow( double f, long int md );
+
+// I/O
+forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, Rational * );
+forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, Rational );
+\end{lstlisting}
+
+
 \bibliographystyle{plain}
-\bibliography{/usr/local/bibliographies/pl.bib}
+\bibliography{cfa}
 
 
