Index: doc/theses/colby_parsons_MMAth/Makefile
===================================================================
--- doc/theses/colby_parsons_MMAth/Makefile	(revision ff710572842ce13bd9317182ab348bb093af5256)
+++ doc/theses/colby_parsons_MMAth/Makefile	(revision e02e13fc53b4a6d659a7753b2c843a4b7e203c0d)
@@ -96,5 +96,5 @@
 
 ${BASE}.dvi : Makefile ${GRAPHS} ${PROGRAMS} ${PICTURES} ${FIGURES} ${SOURCES} ${DATA} \
-		${Macros}/common.tex ${Macros}/indexstyle local.bib ../../bibliography/pl.bib | ${Build}
+		style/style.tex ${Macros}/common.tex ${Macros}/indexstyle local.bib ../../bibliography/pl.bib | ${Build}
 	# Must have *.aux file containing citations for bibtex
 	if [ ! -r ${basename $@}.aux ] ; then ${LaTeX} ${basename $@}.tex ; fi
Index: doc/theses/colby_parsons_MMAth/style/style.tex
===================================================================
--- doc/theses/colby_parsons_MMAth/style/style.tex	(revision ff710572842ce13bd9317182ab348bb093af5256)
+++ doc/theses/colby_parsons_MMAth/style/style.tex	(revision e02e13fc53b4a6d659a7753b2c843a4b7e203c0d)
@@ -1,73 +1,7 @@
 \input{common}
+\CFAStyle						% CFA code-style
+\lstset{language=CFA}					% default language
 
-\lstdefinestyle{defaultStyle}{
-    escapeinside={@@},
-    %  basicstyle=\linespread{0.9}\tt\footnotesize,		% reduce line spacing and use typewriter font
-      basicstyle=\linespread{0.9}\sf,		% reduce line spacing and use typewriter font
-    %  keywordstyle=\bfseries\color{blue},
-    %  keywordstyle=[2]\bfseries\color{Plum},
-    %  commentstyle=\sf\itshape\color{OliveGreen},		  % green and italic comments
-    %  identifierstyle=\color{identifierCol},
-    %  stringstyle=\sf\color{Mahogany},			          % use sanserif font
-      stringstyle=\tt,			          % use sanserif font
-      mathescape=true,
-    %  columns=fixed,
-      columns=fullflexible,
-    %  aboveskip=4pt,                                  % spacing above/below code block
-    %  belowskip=3pt,
-      keepspaces=true,
-      tabsize=4,
-      % frame=lines,
-      literate=,
-      showlines=true,                                 % show blank lines at end of code
-      showspaces=false,
-      showstringspaces=false,
-      showlines=true,							% show blank lines at end of code
-      escapechar=\$,
-      xleftmargin=\parindentlnth,                     % indent code to paragraph indentation
-      moredelim=[is][\color{red}\bfseries]{**R**}{**R**},    % red highlighting
-      morekeywords=[2]{accept, signal, signal_block, wait, waitfor, waituntil},
-      abovecaptionskip=5pt,
-}
-
-\lstdefinestyle{cfaStyle}{
-  escapeinside={@@},
-  basicstyle=\linespread{0.9}\sf,		% reduce line spacing and use typewriter font
-  stringstyle=\tt,			          % use sanserif font
-  mathescape=true,
-  columns=fullflexible,
-  keepspaces=true,
-  tabsize=4,
-  literate=,
-  showlines=true,                                 % show blank lines at end of code
-  showspaces=false,
-  showstringspaces=false,
-  showlines=true,							% show blank lines at end of code
-  escapechar=\$,
-  xleftmargin=\parindentlnth,                     % indent code to paragraph indentation
-  moredelim=[is][\color{red}\bfseries]{**R**}{**R**},    % red highlighting
-  morekeywords=[2]{accept, signal, signal_block, wait, waitfor, waituntil},
-  abovecaptionskip=5pt,
-}
-
-\lstnewenvironment{cfacode}[1][]{
-  \lstset{
-    language = CFA,
-    style=cfaStyle,
-    captionpos=b,
-    #1
-  }
-}{}
-
-\lstnewenvironment{cppcode}[1][]{
-  \lstset{
-    language = c++,
-    style=defaultStyle,
-    captionpos=b,
-    #1
-  }
-}{}
-
-\newcommand{\code}[1]{\lstinline[language=CFA,style=cfaStyle]{#1}}
+\newcommand{\code}[1]{\lstinline[language=CFA]{#1}}
 \newcommand{\uC}{$\mu$\CC}
 
Index: doc/theses/colby_parsons_MMAth/text/CFA_concurrency.tex
===================================================================
--- doc/theses/colby_parsons_MMAth/text/CFA_concurrency.tex	(revision ff710572842ce13bd9317182ab348bb093af5256)
+++ doc/theses/colby_parsons_MMAth/text/CFA_concurrency.tex	(revision e02e13fc53b4a6d659a7753b2c843a4b7e203c0d)
@@ -1,35 +1,38 @@
 \chapter{Concurrency in \CFA}\label{s:cfa_concurrency}
 
-The groundwork for concurrency in \CFA was laid by Thierry Delisle in his Master's Thesis\cite{Delisle18}. 
-In that work he introduced coroutines, user level threading, and monitors. 
-Not listed in that work were the other concurrency features that were needed as building blocks, such as locks, futures, and condition variables which he also added to \CFA.
+The groundwork for concurrency in \CFA was laid by Thierry Delisle in his Master's Thesis~\cite{Delisle18}. 
+In that work, he introduced generators, coroutines, monitors, and user-level threading. 
+Not listed in that work were basic concurrency features needed as building blocks, such as locks, futures, and condition variables, which he also added to \CFA.
 
 \section{Threading Model}\label{s:threading}
-\CFA has user level threading and supports a $M:N$ threading model where $M$ user threads are scheduled on $N$ cores, where both $M$ and $N$ can be explicitly set by the user. 
-Cores are used by a program by creating instances of a \code{processor} struct. 
-User threads types are defined using the \code{thread} keyword, in the place where a \code{struct} keyword is typically used. 
-For each thread type a corresponding main must be defined, which is where the thread starts running once it is created. 
-Listing~\ref{l:cfa_thd_init} shows an example of processor and thread creation. 
-When processors are added, they are added alongside the existing processor given to each program. 
-Thus if you want $N$ processors you need to allocate $N-1$. 
-To join a thread the thread must be deallocated, either deleted if it is allocated on the heap, or go out of scope if stack allocated. 
-The thread performing the deallocation will wait for the thread being deallocated to terminate before the deallocation can occur. 
-A thread terminates by returning from the main routine where it starts.
+\CFA provides user-level threading and supports an $M$:$N$ threading model where $M$ user threads are scheduled on $N$ kernel threads, where both $M$ and $N$ can be explicitly set by the user. 
+Kernel threads are created by instancing a @processor@ structure. 
+User-thread types are defined by creating a @thread@ aggregate-type, \ie replace @struct@ with @thread@. 
+For each thread type a corresponding @main@ routine must be defined, which is where the thread starts running once it is created. 
+Examples of \CFA  user thread and processor creation are shown in \VRef[Listing]{l:cfa_thd_init}. 
 
-\begin{cfacode}[tabsize=3,caption={\CFA user thread and processor creation},label={l:cfa_thd_init}]
-
-thread my_thread {}     // user thread type
-void main( my_thread & this ) { // thread start routine
-    printf("Hello threading world\n");
+\begin{cfa}[caption={Example of \CFA user thread and processor creation},label={l:cfa_thd_init}]
+@thread@ my_thread {...};			$\C{// user thread type}$
+void @main@( my_thread & this ) {	$\C{// thread start routine}$
+	sout | "Hello threading world";
 }
 
 int main() {
-    // add 2 processors, now 3 total
-    processor p[2];    
-    {
-        my_thread t1;
-        my_thread t2;
-    } // waits for threads to end before going out of scope
+	@processor@ p[2];				$\C{// add 2 processors = 3 total with starting processor}$
+	{
+		my_thread t[2], * t3 = new();	$\C{// create 3 user threads, running in main routine}$
+		... // execute concurrently
+		delete( t3 );				$\C{// wait for thread to end and deallocate}$
+	} // wait for threads to end and deallocate
 }
+\end{cfa}
 
-\end{cfacode}
+When processors are added, they are added alongside the existing processor given to each program. 
+Thus, for $N$ processors, allocate $N-1$ processors. 
+A thread is implicitly joined at deallocated, either implicitly at block exit for stack allocation or explicitly at @delete@ for heap allocation. 
+The thread performing the deallocation must wait for the thread to terminate before the deallocation can occur. 
+A thread terminates by returning from the main routine where it starts.
+
+% Local Variables: %
+% tab-width: 4 %
+% End: %
Index: doc/theses/colby_parsons_MMAth/text/CFA_intro.tex
===================================================================
--- doc/theses/colby_parsons_MMAth/text/CFA_intro.tex	(revision ff710572842ce13bd9317182ab348bb093af5256)
+++ doc/theses/colby_parsons_MMAth/text/CFA_intro.tex	(revision e02e13fc53b4a6d659a7753b2c843a4b7e203c0d)
@@ -7,188 +7,152 @@
 \section{Overview}
 The following serves as an introduction to \CFA. 
-\CFA is a layer over C, is transpiled to C and is largely considered to be an extension of C. 
-Beyond C, it adds productivity features, libraries, a type system, and many other language constructions. 
-However, \CFA stays true to C as a language, with most code revolving around \code{struct}'s and routines, and respects the same rules as C. 
-\CFA is not object oriented as it has no notion of \code{this} and no classes or methods, but supports some object oriented adjacent ideas including costructors, destructors, and limited inheritance. 
-\CFA is rich with interesting features, but a subset that is pertinent to this work will be discussed.
+\CFA is a layer over C, is transpiled\footnote{Source to source translator.} to C, and is largely considered to be an extension of C. 
+Beyond C, it adds productivity features, extended libraries, an advanced type system, and many control-flow/concurrency constructions. 
+However, \CFA stays true to the C programming style, with most code revolving around @struct@'s and routines, and respects the same rules as C. 
+\CFA is not object oriented as it has no notion of @this@ (receiver) and no structures with methods, but supports some object oriented ideas including constructors, destructors, and limited containment inheritance. 
+While \CFA is rich with interesting features, only the subset pertinent to this work is discussed.
 
 \section{References}
-References in \CFA are similar to references in \CC, however in \CFA references are rebindable, and support multi-level referencing. 
+References in \CFA are similar to references in \CC; however \CFA references are rebindable, and support multi-level referencing. 
 References in \CFA are a layer of syntactic sugar over pointers to reduce the number of ref/deref operations needed with pointer usage. 
-Some examples of references in \CFA are shown in Listing~\ref{l:cfa_ref}. 
-Another related item to note is that the \CFA equivalent of \CC's \code{nullptr} is \code{0p}.
-
-\begin{cfacode}[caption={Example of \CFA references},label={l:cfa_ref}]
+Another difference is the use of @0p@ instead of C's @NULL@ or \CC's @nullptr@.
+Examples of references are shown in \VRef[Listing]{l:cfa_ref}. 
+
+\begin{cfa}[caption={Example of \CFA references},label={l:cfa_ref}]
 int i = 2;
-int & ref_i = i;            // declare ref to i
-int * ptr_i = &i;           // ptr to i
+int & ref_i = i;			$\C{// declare ref to i}$
+int * ptr_i = &i;			$\C{// ptr to i}$
 
 // address of ref_i is the same as address of i
 assert( &ref_i == ptr_i );
 
-int && ref_ref_i = ref_i;   // can have a ref to a ref
-ref_i = 3;                  // set i to 3
+int && ref_ref_i = ref_i;	$\C{// can have a ref to a ref}$
+ref_i = 3;					$\C{// set i to 3}$
 int new_i = 4;
 
 // syntax to rebind ref_i (must cancel implicit deref)
-&ref_i = &new_i; // (&*)ref_i = &new_i; (sets underlying ptr)
-\end{cfacode}
-
-
-\section{Overloading}
-In \CFA routines can be overloaded on parameter type, number of parameters, and return type. 
+&ref_i = &new_i;			$\C{// (\&*)ref\_i = \&new\_i; (sets underlying ptr)}$
+\end{cfa}
+
+
+\section{Overloading}\label{s:Overloading}
+\CFA routines can be overloaded on parameter type, number of parameters, and \emph{return type}. 
 Variables can also be overloaded on type, meaning that two variables can have the same name so long as they have different types. 
-The variables will be disambiguated via type, sometimes requiring a cast. 
-The code snippet in Listing~\ref{l:cfa_overload} contains examples of overloading.
-
-
-\begin{cfacode}[caption={Example of \CFA function overloading},label={l:cfa_overload}]
-int foo() { printf("A\n");  return 0;}
-int foo( int bar ) { printf("B\n"); return 1; }
-int foo( double bar ) { printf("C\n"); return 2; }
-double foo( double bar ) { printf("D\n"); return 3;}
-void foo( double bar ) { printf("%.0f\n", bar); }
-
-int main() {
-    foo();                  // prints A
-    foo( 0 );               // prints B
-    int a = foo( 0.0 );     // prints C
-    double a = foo( 0.0 );  // prints D
-    foo( a );               // prints 3
-}
-\end{cfacode}
+A routine or variable is disambiguated at each usage site via its type and surrounding expression context.
+A cast is used to disambiguate any conflicting usage. 
+Examples of overloading are shown in \VRef[Listing]{l:cfa_overload}. 
+
+\begin{cfa}[caption={Example of \CFA overloading},label={l:cfa_overload}]
+int foo() { sout | "A";  return 0;}
+int foo( int bar ) { sout | "B"; return 1; }
+int foo( double bar ) { sout | "C"; return 2; }
+double foo( double bar ) { sout | "D"; return 3; }
+void foo( double bar ) { sout | bar; }
+
+int main() {
+	foo();						$\C{// prints A}$
+	foo( 0 );					$\C{// prints B}$
+	int foo = foo( 0.0 );		$\C{// prints C}$
+	double foo = foo( 0.0 );	$\C{// prints D}$
+	foo( foo );					$\C{// prints 3., where left-hand side of expression is void}$
+}
+\end{cfa}
 
 
 \section{With Statement}
-The with statement is a tool for exposing members of aggregate types within a scope in \CFA. 
-It allows users to use fields of aggregate types without using their fully qualified name. 
-This feature is also implemented in Pascal. 
-It can exist as a stand-alone statement or it can be used on routines to expose fields in the body of the routine. 
-An example is shown in Listing~\ref{l:cfa_with}.
-
-
-\begin{cfacode}[tabsize=3,caption={Usage of \CFA with statement},label={l:cfa_with}]
-struct obj {
-    int a, b, c;
-};
-struct pair {
-    double x, y;
-};
-
-// Stand-alone with stmt:
+The \CFA @with@ statement is for exposing fields of an aggregate type within a scope, allowing field names without qualification.
+This feature is also implemented in Pascal~\cite{Pascal}. 
+It can exist as a stand-alone statement or wrap a routine body to expose aggregate fields. 
+Examples of the @with@ statement are shown in \VRef[Listing]{l:cfa_with}. 
+
+\begin{cfa}[caption={Example of \CFA \lstinline{with} statement},label={l:cfa_with}]
+struct pair {  double x, y;  };
+struct triple {  int a, b, c;  };
 pair p;
-with( p ) {
-    x = 6.28;
-    y = 1.73;
-}
-
-// Can be used on routines:
-void foo( obj o, pair p ) with( o, p ) {
-    a = 1;
-    b = 2;
-    c = 3;
-    x = 3.14;
-    y = 2.71;
-}
-
-// routine foo is equivalent to routine bar:
-void bar( obj o, pair p ) {
-    o.a = 1;
-    o.b = 2;
-    o.c = 3;
-    p.x = 3.14;
-    p.y = 2.71;
-}
-\end{cfacode}
+
+@with( p )@ {					$\C{// stand-alone with}$
+	p.x = 6.28;  p.y = 1.73;	$\C{// long form}$
+	   x = 6.28;     y = 1.73;	$\C{// short form}$
+}
+void foo( triple t, pair p ) @with( t, p )@ {  $\C{// routine with}$
+	t.a = 1;  t.b = 2;  t.c = 3;  p.x = 3.14;  p.y = 2.71;  $\C{// long form}$
+	  a = 1;    b = 2;    c = 3;     x = 3.14;     y = 2.71;  $\C{// short form}$
+}
+\end{cfa}
 
 
 \section{Operators}
 Operators can be overloaded in \CFA with operator routines. 
-Operators in \CFA are named using the operator symbol and '?' to respresent operands.
-An example is shown in Listing~\ref{l:cfa_operate}.
-
-
-\begin{cfacode}[tabsize=3,caption={Example of \CFA operators},label={l:cfa_operate}]
+Operators in \CFA are named using an operator symbol and '@?@' to represent operands.
+Examples of \CFA operators are shown in \VRef[Listing]{l:cfa_operate}. 
+
+\begin{cfa}[caption={Example of \CFA operators},label={l:cfa_operate}]
 struct coord {
-    double x;
-    double y;
-    double z;
-};
-coord ++?( coord & c ) with(c) {
-    x++;
-    y++;
-    z++;
-    return c;
-}
-coord ?<=?( coord op1, coord op2 ) with( op1 ) {
-    return (x*x + y*y + z*z) <= 
-        (op2.x*op2.x + op2.y*op2.y + op2.z*op2.z);
-}
-\end{cfacode}
+	double x, y, z;
+};
+coord ++@?@( coord & c ) with( c ) { $\C{// post increment}$
+	x++;  y++;  z++;
+	return c;
+}
+coord @?@<=@?@( coord op1, coord op2 ) with( op1 ) { $\C{// ambiguous with both parameters}$
+	return (x * x + y * y + z * z) <= (op2.x * op2.x + op2.y * op2.y + op2.z * op2.z);
+}
+\end{cfa}
 
 
 \section{Constructors and Destructors}
-Constructors and destructors in \CFA are two special operator routines that are used for creation and destruction of objects. 
-The default constructor and destructor for a type are called implicitly upon creation and deletion respectively if they are defined. 
-An example is shown in Listing~\ref{l:cfa_ctor}.
-
-
-\begin{cfacode}[tabsize=3,caption={Example of \CFA constructors and destructors},label={l:cfa_ctor}]
+Constructors and destructors in \CFA are special operator routines used for creation and destruction of objects. 
+The default constructor and destructor for a type are called implicitly upon creation and deletion, respectively. 
+Examples of \CFA constructors and destructors are shown in \VRef[Listing]{l:cfa_ctor}. 
+
+\begin{cfa}[caption={Example of \CFA constructors and destructors},label={l:cfa_ctor}]
 struct discrete_point {
-    int x;
-    int y;
-};
-void ?{}( discrete_point & this ) with(this) { // ctor
-    x = 0;
-    y = 0;
-}
-void ?{}( discrete_point & this, int x, int y ) { // ctor
-    this.x = x;
-    this.y = y;
-}
-void ^?{}( discrete_point & this ) with(this) { // dtor
-    x = 0;
-    y = 0;
-}
-
-int main() {
-    discrete_point d; // implicit call to ?{}
-    discrete_point p{}; // same call as line above
-    discrete_point dp{ 2, -4 }; // specialized ctor
-} // ^d{}, ^p{}, ^dp{} all called as they go out of scope
-\end{cfacode}
+	int x, y;
+};
+void ?{}( discrete_point & this ) with(this) { $\C{// default constructor}$
+	[x, y] = 0;
+}
+void ?{}( discrete_point & this, int x, int y ) { $\C{// explicit constructor}$
+	this.[x, y] = [x, y];
+}
+void ^?{}( discrete_point & this ) with(this) { $\C{// destructor}$
+	?{}( this );  $\C{// reset by calling default constructor}$
+}
+int main() {
+	discrete_point x, y{};  $\C{// implicit call to default ctor, ?\{\}}$
+	discrete_point s = { 2, -4 }, t{ 4, 2 };  $\C{// explicit call to specialized ctor}$
+} // ^t{}, ^s{}, ^y{}, ^x{} implicit calls in reverse allocation order
+\end{cfa}
 
 
 \section{Polymorphism}\label{s:poly}
-C does not natively support polymorphism, and requires users to implement polymorphism themselves if they want to use it. 
-\CFA extends C with two styles of polymorphism that it supports, parametric polymorphism and nominal inheritance.
+C supports limited polymorphism, often requiring users to implement polymorphism using a @void *@ (type erasure) approach.
+\CFA extends C with generalized overloading polymorphism (see \VRef{s:Overloading}), as well as, parametric polymorphism and nominal inheritance.
 
 \subsection{Parametric Polymorphism}
-\CFA provides parametric polymorphism in the form of \code{forall}, and \code{trait}s. 
-A \code{forall} takes in a set of types and a list of constraints. 
-The declarations that follow the \code{forall} are parameterized over the types listed that satisfy the constraints. 
-Sometimes the list of constraints can be long, which is where a \code{trait} can be used. 
-A \code{trait} is a collection of constraints that is given a name and can be reused in foralls. 
-An example of the usage of parametric polymorphism in \CFA is shown in Listing~\ref{l:cfa_poly}.
-
-\begin{cfacode}[tabsize=3,caption={Example of \CFA polymorphism},label={l:cfa_poly}]
+\CFA provides parametric polymorphism in the form of @forall@, and @trait@s. 
+A @forall@ takes in a set of types and a list of constraints. 
+The declarations that follow the @forall@ are parameterized over the types listed that satisfy the constraints. 
+A list of @forall@ constraints can be refactored into a named @trait@ and reused in @forall@s. 
+Examples of \CFA parametric polymorphism are shown in \VRef[Listing]{l:cfa_poly}. 
+
+\begin{cfa}[caption={Example of \CFA parametric polymorphism},label={l:cfa_poly}]
 // sized() is a trait that means the type has a size
-forall( V & | sized(V) )        // type params for trait
+forall( V & | sized(V) )		$\C{// type params for trait}$
 trait vector_space {
-    V add( V, V );              // vector addition
-    V scalar_mult( int, V );    // scalar multiplication
-
-    // dtor and copy ctor needed in constraints to pass by copy
-    void ?{}( V &, V & );       // copy ctor for return
-    void ^?{}( V & );           // dtor
-};
-
-forall( V & | vector_space( V )) {
-    V get_inverse( V v1 ) {
-        return scalar_mult( -1, v1 );  // can use ?*? routine defined in trait
-    }
-    V add_and_invert( V v1, V v2 ) {
-        return get_inverse( add( v1, v2 ) );  // can use ?*? routine defined in trait
-    }
+	// dtor and copy ctor needed in constraints to pass by copy
+	void ?{}( V &, V & );		$\C{// copy ctor for return}$
+	void ^?{}( V & );			$\C{// dtor}$
+	V ?+?( V, V );				$\C{// vector addition}$
+	V ?*?( int, V );			$\C{// scalar multiplication}$
+};
+
+forall( V & | vector_space( V ) ) {
+	V get_inverse( V v1 ) {
+		return -1 * v1;			$\C{// can use ?*? routine defined in trait}$
+	}
+	V add_and_invert( V v1, V v2 ) {
+		return get_inverse( v1 + v2 );  $\C{// can use ?+? routine defined in trait}$
+	}
 }
 struct Vec1 { int x; };
@@ -196,6 +160,6 @@
 void ?{}( Vec1 & this, int x ) { this.x = x; }
 void ^?{}( Vec1 & this ) {}
-Vec1 add( Vec1 v1, Vec1 v2 ) { v1.x += v2.x; return v1; }
-Vec1 scalar_mult( int c, Vec1 v1 ) { v1.x = v1.x * c; return v1; }
+Vec1 ?+?( Vec1 v1, Vec1 v2 ) { v1.x += v2.x; return v1; }
+Vec1 ?*?( int c, Vec1 v1 ) { v1.x = v1.x * c; return v1; }
 
 struct Vec2 { int x; int y; };
@@ -203,32 +167,30 @@
 void ?{}( Vec2 & this, int x ) { this.x = x; this.y = x; }
 void ^?{}( Vec2 & this ) {}
-Vec2 add( Vec2 v1, Vec2 v2 ) { v1.x += v2.x; v1.y += v2.y; return v1; }
-Vec2 scalar_mult( int c, Vec2 v1 ) { v1.x = v1.x * c; v1.y = v1.y * c; return v1; }
-
-int main() {
-    Vec1 v1{ 1 }; // create Vec1 and call ctor
-    Vec2 v2{ 2 }; // create Vec2 and call ctor
-
-    // can use forall defined routines since types satisfy trait
-    add_and_invert( get_inverse( v1 ), v1 );
-    add_and_invert( get_inverse( v2 ), v2 );
-}
-
-\end{cfacode}
+Vec2 ?+?( Vec2 v1, Vec2 v2 ) { v1.x += v2.x; v1.y += v2.y; return v1; }
+Vec2 ?*?( int c, Vec2 v1 ) { v1.x = v1.x * c; v1.y = v1.y * c; return v1; }
+
+int main() {
+	Vec1 v1{ 1 };				$\C{// create Vec1 and call ctor}$
+	Vec2 v2{ 2 };				$\C{// create Vec2 and call ctor}$
+	// can use forall defined routines since types satisfy trait
+	add_and_invert( get_inverse( v1 ), v1 );
+	add_and_invert( get_inverse( v2 ), v2 );
+}
+\end{cfa}
 
 \subsection{Inheritance}
-Inheritance in \CFA copies its style from Plan-9 C nominal inheritance. 
-In \CFA structs can \code{inline} another struct type to gain its fields and to be able to be passed to routines that require a parameter of the inlined type. 
-An example of \CFA inheritance is shown in Listing~\ref{l:cfa_inherit}.
-
-\begin{cfacode}[tabsize=3,caption={Example of \CFA inheritance},label={l:cfa_inherit}]
+Inheritance in \CFA is taken from Plan-9 C's containment inheritance. 
+In \CFA, @struct@s can @inline@ another struct type to gain its fields and masquerade as that type. 
+Examples of \CFA containment inheritance are shown in \VRef[Listing]{l:cfa_inherit}. 
+
+\begin{cfa}[caption={Example of \CFA containment inheritance},label={l:cfa_inherit}]
 struct one_d { double x; };
 struct two_d { 
-    inline one_d;
-    double y;
+	@inline@ one_d;
+	double y;
 };
 struct three_d { 
-    inline two_d;
-    double z;
+	@inline@ two_d;
+	double z;
 };
 double get_x( one_d & d ){ return d.x; }
@@ -236,29 +198,31 @@
 struct dog {};
 struct dog_food {
-    int count;
+	int count;
 };
 struct pet {
-    inline dog;
-    inline dog_food;
-};
-void pet_dog( dog & d ){printf("woof\n");}
-void print_food( dog_food & f ){printf("%d\n", f.count);}
-
-int main() {
-    one_d x;
-    two_d y;
-    three_d z;
-    x.x = 1;
-    y.x = 2;
-    z.x = 3;
-    get_x( x ); // returns 1;
-    get_x( y ); // returns 2;
-    get_x( z ); // returns 3;
-    pet p;
-    p.count = 5;
-    pet_dog( p );    // prints woof
-    print_food( p ); // prints 5
-}
-\end{cfacode}
-
-
+	@inline@ dog;
+	@inline@ dog_food;
+};
+void pet_dog( dog & d ) { sout | "woof"; }
+void print_food( dog_food & f ) { sout | f.count; }
+
+int main() {
+	one_d x;
+	two_d y;
+	three_d z;
+	x.x = 1;
+	y.x = 2;
+	z.x = 3;
+	get_x( x );					$\C{// returns 1;}$
+	get_x( y );					$\C{// returns 2;}$
+	get_x( z );					$\C{// returns 3;}$
+	pet p;
+	p.count = 5;
+	pet_dog( p );				$\C{// prints woof}$
+	print_food( p );			$\C{// prints 5}$
+}
+\end{cfa}
+
+% Local Variables: %
+% tab-width: 4 %
+% End: %
Index: doc/theses/colby_parsons_MMAth/text/actors.tex
===================================================================
--- doc/theses/colby_parsons_MMAth/text/actors.tex	(revision ff710572842ce13bd9317182ab348bb093af5256)
+++ doc/theses/colby_parsons_MMAth/text/actors.tex	(revision e02e13fc53b4a6d659a7753b2c843a4b7e203c0d)
@@ -88,5 +88,5 @@
 Similarly to create a message type a user must define a struct which \code{inline}'s the base \code{message} struct.
 
-\begin{cfacode}
+\begin{cfa}
 struct derived_actor {
     inline actor;       // Plan-9 C inheritance
@@ -118,5 +118,5 @@
     return 0;
 }
-\end{cfacode}
+\end{cfa}
 
 The above code is a simple actor program in \CFA. 
@@ -125,19 +125,19 @@
 Key things to highlight include the \code{receive} signature, and calls to \code{start_actor_system}, and \code{stop_actor_system}. 
 To define a behaviour for some derived actor and derived message type, one must declare a routine with the signature:
-\begin{cfacode}
+\begin{cfa}
 Allocation receive( derived_actor & receiver, derived_msg & msg )
-\end{cfacode}
+\end{cfa}
 Where \code{derived_actor} and \code{derived_msg} can be any derived actor and derived message types respectively. 
 The return value of \code{receive} must be a value from the \code{Allocation} enum:
-\begin{cfacode}
+\begin{cfa}
 enum Allocation { Nodelete, Delete, Destroy, Finished };
-\end{cfacode}
+\end{cfa}
 The \code{Allocation} enum is a set of actions that dictate what the executor should do with a message or actor after a given behaviour has been completed. 
 In the case of an actor, the \code{receive} routine returns the \code{Allocation} status to the executor which sets the status on the actor and takes the appropriate action. 
 For messages, they either default to \code{Nodelete}, or they can be passed an \code{Allocation} via the \code{message} constructor. 
 Message state can be updated via a call to:
-\begin{cfacode}
+\begin{cfa}
 void set_allocation( message & this, Allocation state )
-\end{cfacode}
+\end{cfa}
 
 The following describes the use of each of the \code{Allocation} values:
@@ -186,7 +186,7 @@
 All message sends are done using the left shift operater, \ie <<, similar to the syntax of \CC's output. 
 The signature of the left shift operator is:
-\begin{cfacode}
+\begin{cfa}
 Allocation ?<<?( derived_actor & receiver, derived_msg & msg )
-\end{cfacode}
+\end{cfa}
 
 An astute eye will notice that this is the same signature as the \code{receive} routine which is no coincidence. 
@@ -368,5 +368,5 @@
 To first verify sequential correctness, consider the equivalent sequential swap below:
 
-\begin{cfacode}
+\begin{cfa}
 void swap( uint victim_idx, uint my_idx  ) {
     // Step 0:
@@ -380,5 +380,5 @@
     request_queues[my_idx] = vic_queue;
 }
-\end{cfacode}
+\end{cfa}
 
 Step 1 is missing in the sequential example since in only matter in the concurrent context presented later. 
@@ -386,5 +386,5 @@
 Temporary copies of each pointer being swapped are stored, and then the original values of each pointer are set using the copy of the other pointer.
 
-\begin{cfacode}
+\begin{cfa}
 // This routine is atomic
 bool CAS( work_queue ** ptr, work_queue ** old, work_queue * new ) {
@@ -427,5 +427,5 @@
     return true;
 }
-\end{cfacode}\label{c:swap}
+\end{cfa}\label{c:swap}
 
 Now consider the concurrent implementation of the swap.
Index: doc/theses/colby_parsons_MMAth/text/channels.tex
===================================================================
--- doc/theses/colby_parsons_MMAth/text/channels.tex	(revision ff710572842ce13bd9317182ab348bb093af5256)
+++ doc/theses/colby_parsons_MMAth/text/channels.tex	(revision e02e13fc53b4a6d659a7753b2c843a4b7e203c0d)
@@ -118,5 +118,5 @@
 Also note that in the Go version~\ref{l:go_chan_bar}, the size of the barrier channels has to be larger than in the \CFA version to ensure that the main thread does not block when attempting to clear the barrier.
 
-\begin{cfacode}[tabsize=3,caption={\CFA channel barrier termination},label={l:cfa_chan_bar}]
+\begin{cfa}[tabsize=3,caption={\CFA channel barrier termination},label={l:cfa_chan_bar}]
 struct barrier {
     channel( int ) barWait;
@@ -171,7 +171,7 @@
     return 0;
 }
-\end{cfacode}
-
-\begin{cfacode}[tabsize=3,caption={Go channel barrier termination},label={l:go_chan_bar}]
+\end{cfa}
+
+\begin{cfa}[tabsize=3,caption={Go channel barrier termination},label={l:go_chan_bar}]
 
 struct barrier {
@@ -237,5 +237,5 @@
     return 0;
 }
-\end{cfacode}
+\end{cfa}
 
 In Listing~\ref{l:cfa_resume} an example of channel closing with resumption is used. 
@@ -244,5 +244,5 @@
 If the same program was implemented in Go it would require explicit synchronization with both producers and consumers by some mechanism outside the channel to ensure that all elements were removed before task termination.
 
-\begin{cfacode}[tabsize=3,caption={\CFA channel resumption usage},label={l:cfa_resume}]
+\begin{cfa}[tabsize=3,caption={\CFA channel resumption usage},label={l:cfa_resume}]
 channel( int ) chan{ 128 };
 
@@ -280,5 +280,5 @@
     return 0;
 }
-\end{cfacode}
+\end{cfa}
 
 \section{Performance}
Index: doc/theses/colby_parsons_MMAth/text/mutex_stmt.tex
===================================================================
--- doc/theses/colby_parsons_MMAth/text/mutex_stmt.tex	(revision ff710572842ce13bd9317182ab348bb093af5256)
+++ doc/theses/colby_parsons_MMAth/text/mutex_stmt.tex	(revision e02e13fc53b4a6d659a7753b2c843a4b7e203c0d)
@@ -12,5 +12,5 @@
 Additionally, it provides the safety guarantee of deadlock-freedom, both by acquiring the locks in a deadlock-free manner, and by ensuring that the locks release on error, or normal program execution via \gls{raii}.
 
-\begin{cfacode}[tabsize=3,caption={\CFA mutex statement usage},label={l:cfa_mutex_ex}]
+\begin{cfa}[tabsize=3,caption={\CFA mutex statement usage},label={l:cfa_mutex_ex}]
 owner_lock lock1, lock2, lock3;
 int count = 0; 
@@ -20,5 +20,5 @@
 }
 mutex( lock2, lock3 ) count++; // or inline statement
-\end{cfacode}
+\end{cfa}
 
 \section{Other Languages}
@@ -32,5 +32,5 @@
 An example of \CC scoped\_lock usage is shown in Listing~\ref{l:cc_scoped_lock}.
 
-\begin{cppcode}[tabsize=3,caption={\CC scoped\_lock usage},label={l:cc_scoped_lock}]
+\begin{cfa}[tabsize=3,caption={\CC scoped\_lock usage},label={l:cc_scoped_lock}]
 std::mutex lock1, lock2, lock3;
 {
@@ -38,5 +38,5 @@
     // locks are released via raii at end of scope
 }
-\end{cppcode}
+\end{cfa}
 
 \section{\CFA implementation}
@@ -58,8 +58,8 @@
 This use case is shown in Listing~\ref{l:sout}.
 
-\begin{cfacode}[tabsize=3,caption={\CFA sout with mutex statement},label={l:sout}]
+\begin{cfa}[tabsize=3,caption={\CFA sout with mutex statement},label={l:sout}]
 mutex( sout )
     sout | "This output is protected by mutual exclusion!"; 
-\end{cfacode}
+\end{cfa}
 
 \section{Deadlock Avoidance}
@@ -70,5 +70,5 @@
 The algorithm presented is taken directly from the source code of the \code{<mutex>} header, with some renaming and comments for clarity.
 
-\begin{cppcode}[caption={\CC scoped\_lock deadlock avoidance algorithm},label={l:cc_deadlock_avoid}]
+\begin{cfa}[caption={\CC scoped\_lock deadlock avoidance algorithm},label={l:cc_deadlock_avoid}]
 int first = 0;  // first lock to attempt to lock
 do {
@@ -86,5 +86,5 @@
 // if first lock is still held then all have been acquired
 } while (!locks[first].owns_lock());  // is first lock held?
-\end{cppcode}
+\end{cfa}
 
 The algorithm in \ref{l:cc_deadlock_avoid} successfully avoids deadlock, however there is a potential livelock scenario. 
Index: doc/theses/colby_parsons_MMAth/thesis.tex
===================================================================
--- doc/theses/colby_parsons_MMAth/thesis.tex	(revision ff710572842ce13bd9317182ab348bb093af5256)
+++ doc/theses/colby_parsons_MMAth/thesis.tex	(revision e02e13fc53b4a6d659a7753b2c843a4b7e203c0d)
@@ -98,7 +98,7 @@
 \hypersetup{
     plainpages=false,       % needed if Roman numbers in frontpages
-    unicode=false,          % non-Latin characters in Acrobat’s bookmarks
-    pdftoolbar=true,        % show Acrobat’s toolbar?
-    pdfmenubar=true,        % show Acrobat’s menu?
+    unicode=false,          % non-Latin characters in Acrobat's bookmarks
+    pdftoolbar=true,        % show Acrobat's toolbar?
+    pdfmenubar=true,        % show Acrobat's menu?
     pdffitwindow=false,     % window fit to page when opened
     pdfstartview={FitH},    % fits the width of the page to the window
@@ -110,5 +110,5 @@
     colorlinks=true,        % false: boxed links; true: colored links
     linkcolor=blue,         % color of internal links
-    citecolor=green,        % color of links to bibliography
+    citecolor=blue,        % color of links to bibliography
     filecolor=magenta,      % color of file links
     urlcolor=cyan           % color of external links
