Index: doc/theses/jiada_liang_MMath/CFAenum.tex
===================================================================
--- doc/theses/jiada_liang_MMath/CFAenum.tex	(revision de3a579300a8b9d3a7728dab02abe44c972da598)
+++ doc/theses/jiada_liang_MMath/CFAenum.tex	(revision 35897fb34306b8aedf6e4f502519debba8b7ec7b)
@@ -24,5 +24,5 @@
 \label{s:EnumeratorUnscoping}
 
-In C, unscoped enumerators presents a \Newterm{naming problem} when multiple enumeration types appear in the same scope with duplicate enumerator names.
+In C, unscoped enumerators presents a \newterm{naming problem} when multiple enumeration types appear in the same scope with duplicate enumerator names.
 There is no mechanism in C to resolve these naming conflicts other than renaming one of the duplicates, which may be impossible.
 
@@ -265,13 +265,20 @@
 
 \VRef[Figure]{f:PlanetExample} shows an archetypal enumeration example illustrating most of the \CFA enumeration features.
-Enumeration @Planet@ is a typed enumeration of type @MR@.
+@Planet@ is an enumeration of type @MR@.
 Each of the planet enumerators is initialized to a specific mass/radius, @MR@, value.
-The unnamed enumeration projects the gravitational-constant enumerator @G@.
-The program main iterates through the planets computing the weight on each planet for a given earth weight.
+The unnamed enumeration provides the gravitational-constant enumerator @G@.
+Function @surfaceGravity@ uses the @with@ clause to remove @p@ qualification from fields @mass@ and @radius@.
+The program main uses @SizeE@ to obtain the number of enumerators in @Planet@, and safely converts the random value into a @Planet@ enumerator.
+The resulting random orbital body is used in a @choose@ statement.
+The enumerators in the @case@ clause use position for testing.
+The prints use @labelE@ to print the enumerators label.
+Finally, a loop iterates through the planets computing the weight on each planet for a given earth weight.
+The print statement does an equality comparison with an enumeration variable and enumerator.
 
 \begin{figure}
+\small
 \begin{cfa}
 struct MR { double mass, radius; };
-enum( MR ) Planet {
+enum( @MR@ ) Planet {
 	//                      mass (kg)   radius (km)
 	MERCURY = { 0.330_E24, 2.4397_E6 },
@@ -285,8 +292,7 @@
 	NEPTUNE  = { 102.4_E24, 24.746_E6 },
 };
-enum( double ) { G = 6.6743E-11 }; $\C{// universal gravitational constant (m3 kg-1 s-2)}$
-
-static double surfaceGravity( Planet p ) with( p ) {
-	return G * mass / ( radius * radius );
+enum( double ) { G = 6.6743_E-11 }; $\C{// universal gravitational constant (m3 kg-1 s-2)}$
+static double surfaceGravity( Planet p ) @with( p )@ {
+	return G * mass / ( radius \ 2u ); $\C{// exponentiation}$
 }
 static double surfaceWeight( Planet p, double otherMass ) {
@@ -297,14 +303,25 @@
 	double earthWeight = convert( argv[1] );
 	double mass = earthWeight / surfaceGravity( EARTH );
-	for ( p; Planet ) {
-		sout | "Your weight on" | labelE(p) | "is" | wd(1,1, surfaceWeight( p, mass )) | "kg";
+
+	Planet p = @fromInt@( prng( @SizeE@(Planet) ) ); $\C{// select a random orbiting body}$
+	@choose( p )@ {
+	  case MERCURY, VENUS, EARTH, MARS:
+		sout | @labelE( p )@ | "is a rocky planet";
+	  @case JUPITER, SATURN, URANUS, NEPTUNE:@
+		sout | labelE( p ) | "is a gas-giant planet";
+	  default:
+		sout | labelE( p ) | "is not a planet";
 	}
-}
-
+	for ( @p; Planet@ ) {
+		sout | "Your weight on" | (@p == MOON@ ? "the" : "") | labelE(p)
+			   | "is" | wd(1,1, surfaceWeight( p, mass )) | "kg";
+	}
+}
 $\$$ planet 100
+JUPITER is a gas-giant planet
 Your weight on MERCURY is 37.7 kg
 Your weight on VENUS is 90.5 kg
 Your weight on EARTH is 100.0 kg
-Your weight on MOON is 16.6 kg
+Your weight on the MOON is 16.6 kg
 Your weight on MARS is 37.9 kg
 Your weight on JUPITER is 252.8 kg
Index: doc/theses/jiada_liang_MMath/background.tex
===================================================================
--- doc/theses/jiada_liang_MMath/background.tex	(revision de3a579300a8b9d3a7728dab02abe44c972da598)
+++ doc/theses/jiada_liang_MMath/background.tex	(revision 35897fb34306b8aedf6e4f502519debba8b7ec7b)
@@ -78,8 +78,8 @@
 Here, the aliased constants are: 20, 10, 20, 21, and -7.
 Direct initialization is by a compile-time expression generating a constant value.
-An enumerator without initialization is \Newterm{auto-initialized}: from left to right, starting at zero or the next explicitly initialized constant, incrementing by @1@.
+An enumerator without initialization is \newterm{auto-initialized}: from left to right, starting at zero or the next explicitly initialized constant, incrementing by @1@.
 Because multiple independent enumerators can be combined, enumerators with the same values can occur.
 The enumerators are rvalues, so assignment is disallowed.
-Finally, enumerators are \Newterm{unscoped}, \ie enumerators declared inside of an @enum@ are visible (projected) into the enclosing scope of the @enum@ type.
+Finally, enumerators are \newterm{unscoped}, \ie enumerators declared inside of an @enum@ are visible (projected) into the enclosing scope of the @enum@ type.
 For unnamed enumeration this semantic is required because there is no type name for scoped qualification.
 
Index: doc/theses/jiada_liang_MMath/intro.tex
===================================================================
--- doc/theses/jiada_liang_MMath/intro.tex	(revision de3a579300a8b9d3a7728dab02abe44c972da598)
+++ doc/theses/jiada_liang_MMath/intro.tex	(revision 35897fb34306b8aedf6e4f502519debba8b7ec7b)
@@ -1,5 +1,5 @@
 \chapter{Introduction}
 
-All types in a programming language must have a set of constants, and these constants have \Newterm{primary names}, \eg integral types have constants @-1@, @17@, @0xff@, floating-point types have constants @5.3@, @2.3E-5@, @0xff.ffp0@, character types have constants @'a'@, @"abc\n"@, \mbox{\lstinline{u8"}\texttt{\guillemotleft{na\"{i}ve}\guillemotright}\lstinline{"}}, \etc.
+All types in a programming language must have a set of constants, and these constants have \newterm{primary names}, \eg integral types have constants @-1@, @17@, @0xff@, floating-point types have constants @5.3@, @2.3E-5@, @0xff.ffp0@, character types have constants @'a'@, @"abc\n"@, \mbox{\lstinline{u8"}\texttt{\guillemotleft{na\"{i}ve}\guillemotright}\lstinline{"}}, \etc.
 Con\-stants can be overloaded among types, \eg @0@ is a null pointer for all pointer types, and the value zero for integral and floating-point types.
 (In \CFA, the primary constants @0@ and @1@ can be overloaded for any type.)
@@ -7,15 +7,15 @@
 In theory, there are an infinite set of primary constant names per type.
 
-\Newterm{Secondary naming} is a common practice in mathematics, engineering and computer science, \eg $\pi$, $\tau$ (2$\pi$), $\phi$ (golden ratio), MB (megabyte, 1E6), and in general situations, \eg specific times (noon, New Years), cities (Big Apple), flowers (Lily), \etc.
-Many programming languages capture this important software-engineering capability through a mechanism called \Newterm{constant} or \Newterm{literal} naming, where a secondary name is aliased to a primary name.
+\newterm{Secondary naming} is a common practice in mathematics, engineering and computer science, \eg $\pi$, $\tau$ (2$\pi$), $\phi$ (golden ratio), MB (megabyte, 1E6), and in general situations, \eg specific times (noon, New Years), cities (Big Apple), flowers (Lily), \etc.
+Many programming languages capture this important software-engineering capability through a mechanism called \newterm{constant} or \newterm{literal} naming, where a secondary name is aliased to a primary name.
 Its purpose is for readability and to eliminate duplication of the primary constant throughout a program.
 For example, a meaningful secondary name replaces a primary name throughout a program;
 thereafter, changing the binding of the secondary to primary name automatically distributes the rebinding, preventing errors.
-In some cases, secondary naming is \Newterm{opaque}, where the matching internal representation can be chosen arbitrarily, and only equality operations are available, \eg @O_RDONLY@, @O_WRONLY@, @O_CREAT@, @O_TRUNC@, @O_APPEND@.
-Because a secondary name is a constant, it cannot appear in a mutable context, \eg \mbox{$\pi$ \lstinline{= 42}} is meaningless, and a constant has no address, \ie it is an \Newterm{rvalue}\footnote{
+In some cases, secondary naming is \newterm{opaque}, where the matching internal representation can be chosen arbitrarily, and only equality operations are available, \eg @O_RDONLY@, @O_WRONLY@, @O_CREAT@, @O_TRUNC@, @O_APPEND@.
+Because a secondary name is a constant, it cannot appear in a mutable context, \eg \mbox{$\pi$ \lstinline{= 42}} is meaningless, and a constant has no address, \ie it is an \newterm{rvalue}\footnote{
 The term rvalue defines an expression that can only appear on the right-hand side of an assignment expression.}.
 
 Secondary names can form an (ordered) set, \eg days of a week, months of a year, floors of a building (basement, ground, 1st), colours in a rainbow, \etc.
-Many programming languages capture these groupings through a mechanism called an \Newterm{enumeration}.
+Many programming languages capture these groupings through a mechanism called an \newterm{enumeration}.
 \begin{quote}
 enumerate (verb, transitive).
@@ -63,6 +63,6 @@
 \label{s:Terminology}
 
-The term \Newterm{enumeration} defines a type with a set of secondary names, and the term \Newterm{enumerator} represents an arbitrary secondary name \see{\VRef{s:CEnumeration} for the name derivation}.
-As well, an enumerated type can have three fundamental properties, \Newterm{label}, \Newterm{order}, and \Newterm{value}.
+The term \newterm{enumeration} defines a type with a set of secondary names, and the term \newterm{enumerator} represents an arbitrary secondary name \see{\VRef{s:CEnumeration} for the name derivation}.
+As well, an enumerated type can have three fundamental properties, \newterm{label}, \newterm{order}, and \newterm{value}.
 \begin{cquote}
 \sf\setlength{\tabcolsep}{3pt}
@@ -116,5 +116,5 @@
 foo( Size ); // take the address of (reference) Size
 \end{cfa}
-Taking the address of an immutable variable makes it an \Newterm{lvalue}, which implies it has storage.
+Taking the address of an immutable variable makes it an \newterm{lvalue}, which implies it has storage.
 With separate compilation, it is necessary to choose one translation unit to perform the initialization.
 If aliasing does require storage, its address and initialization are opaque (compiler only), similar to \CC rvalue reference @&&@.
@@ -185,5 +185,5 @@
 Here, the constructor name gives different meaning to the values in the common \lstinline[language=Haskell]{Int} type, \eg the value @3@ has different interpretations depending on the constructor name in the pattern matching.
 
-Note, the term \Newterm{variant} is often associated with ADTs.
+Note, the term \newterm{variant} is often associated with ADTs.
 However, there are multiple languages with a @variant@ type that is not an ADT \see{Algol68~\cite{Algol68} or \CC \lstinline{variant}}.
 In these languages, the variant is often a union using RTTI tags, which cannot be used to simulate an enumeration.
Index: doc/theses/jiada_liang_MMath/relatedwork.tex
===================================================================
--- doc/theses/jiada_liang_MMath/relatedwork.tex	(revision de3a579300a8b9d3a7728dab02abe44c972da598)
+++ doc/theses/jiada_liang_MMath/relatedwork.tex	(revision 35897fb34306b8aedf6e4f502519debba8b7ec7b)
@@ -12,6 +12,6 @@
 The definition of member types and their constructors are from the outer lexical scope.
 
-In general, an \Newterm{algebraic data type} (ADT) is a composite type, \ie, a type formed by combining other types.
-Three common classes of algebraic types are \Newterm{array type}, \ie homogeneous types, \Newterm{product type}, \ie heterogeneous tuples and records (structures), and \Newterm{sum type}, \ie tagged product-types (unions).
+In general, an \newterm{algebraic data type} (ADT) is a composite type, \ie, a type formed by combining other types.
+Three common classes of algebraic types are \newterm{array type}, \ie homogeneous types, \newterm{product type}, \ie heterogeneous tuples and records (structures), and \newterm{sum type}, \ie tagged product-types (unions).
 Enumerated types are a special case of product/sum types with non-mutable fields, \ie initialized (constructed) once at the type's declaration, possible restricted to compile-time initialization.
 Values of algebraic types are access by subscripting, field qualification, or type (pattern) matching.
@@ -51,5 +51,5 @@
 \section{Ada}
 
-An Ada enumeration type is a set of ordered unscoped identifiers (enumerators) bound to \emph{unique} \Newterm{literals}.\footnote{%
+An Ada enumeration type is a set of ordered unscoped identifiers (enumerators) bound to \emph{unique} \newterm{literals}.\footnote{%
 Ada is \emph{case-insensitive} so identifiers may appear in multiple forms and still be the same, \eg \lstinline{Mon}, \lstinline{moN}, and \lstinline{MON} (a questionable design decision).}
 \begin{ada}
@@ -2177,6 +2177,6 @@
 Here, function @take_class@ has a @weekday@ parameter, and returns @"CS442"@, if the weekday value is @Mon@ or @Wed@, @"CS343"@, if the value is @Tue@ or @Thu@, and @"Tutorial"@ for @Fri@.
 The ``@_@'' is a wildcard matching any @weekday@ value, so the function returns @"Take a break"@ for values @Sat@ or @Sun@, which are not matched by the previous cases.
-Since the variant has no type, it has a \Newterm{0-arity constructor}, \ie no parameters.
-Because @weekday@ is a union of values @Mon@ to @Sun@, it is a \Newterm{union type} in turns of the functional-programming paradigm. 
+Since the variant has no type, it has a \newterm{0-arity constructor}, \ie no parameters.
+Because @weekday@ is a union of values @Mon@ to @Sun@, it is a \newterm{union type} in turns of the functional-programming paradigm. 
 
 Each variant can have an associated heterogeneous type, with an n-ary constructor for creating a corresponding value.
@@ -2202,5 +2202,5 @@
 type @stringList@ = Empty | Pair of string * @stringList@
 \end{ocaml}
-which is a recursive sum of product of types, called an \Newterm{algebraic data-type}.
+which is a recursive sum of product of types, called an \newterm{algebraic data-type}.
 A recursive function is often used to pattern match against a recursive variant type.
 \begin{ocaml}
Index: doc/theses/jiada_liang_MMath/uw-ethesis-frontpgs.tex
===================================================================
--- doc/theses/jiada_liang_MMath/uw-ethesis-frontpgs.tex	(revision de3a579300a8b9d3a7728dab02abe44c972da598)
+++ doc/theses/jiada_liang_MMath/uw-ethesis-frontpgs.tex	(revision 35897fb34306b8aedf6e4f502519debba8b7ec7b)
@@ -30,5 +30,5 @@
         \normalsize
         A thesis \\
-        presented to the University of Waterloo \\ 
+        presented to the University of Waterloo \\
         in fulfillment of the \\
         thesis requirement for the degree of \\
@@ -63,13 +63,13 @@
 The following served on the Examining Committee for this thesis. The decision of the Examining Committee is by majority vote.
   \bigskip
-  
-  \noindent
-\begin{tabbing}
-Internal-External Member: \=  \kill % using longest text to define tab length
-External Examiner: \>  Bruce Bruce \\ 
+
+  \noindent
+\begin{tabbing}
+Internal-External Member: \=  \kill % using longest text to define tab length
+External Examiner: \>  Bruce Bruce \\
 \> Professor, Dept. of Philosophy of Zoology, University of Wallamaloo \\
-\end{tabbing} 
-  \bigskip
-  
+\end{tabbing}
+  \bigskip
+
   \noindent
 \begin{tabbing}
@@ -81,5 +81,5 @@
 \end{tabbing}
   \bigskip
-  
+
   \noindent
   \begin{tabbing}
@@ -89,5 +89,5 @@
 \end{tabbing}
   \bigskip
-  
+
   \noindent
 \begin{tabbing}
@@ -97,5 +97,5 @@
 \end{tabbing}
   \bigskip
-  
+
   \noindent
 \begin{tabbing}
@@ -114,10 +114,10 @@
  \addcontentsline{toc}{chapter}{Author's Declaration}
  \begin{center}\textbf{Author's Declaration}\end{center}
-  
+
  \noindent
 I hereby declare that I am the sole author of this thesis. This is a true copy of the thesis, including any required final revisions, as accepted by my examiners.
 
   \bigskip
-  
+
   \noindent
 I understand that my thesis may be made electronically available to the public.
@@ -182,4 +182,5 @@
 \phantomsection		% allows hyperref to link to the correct page
 
+\begin{comment}
 % L I S T   O F   A B B R E V I A T I O N S
 % ---------------------------
@@ -189,5 +190,4 @@
 \phantomsection		% allows hyperref to link to the correct page
 
-\begin{comment}
 % L I S T   O F   S Y M B O L S
 % ---------------------------
Index: doc/theses/jiada_liang_MMath/uw-ethesis.tex
===================================================================
--- doc/theses/jiada_liang_MMath/uw-ethesis.tex	(revision de3a579300a8b9d3a7728dab02abe44c972da598)
+++ doc/theses/jiada_liang_MMath/uw-ethesis.tex	(revision 35897fb34306b8aedf6e4f502519debba8b7ec7b)
@@ -112,7 +112,4 @@
 \newsavebox{\myboxB}
 
-\newcommand{\newtermFont}{\emph}
-\newcommand{\Newterm}[1]{\newtermFont{#1}}
-%\renewcommand{\newterm}[1]{\newtermFont{#1}}
 \newcommand{\uC}{$\mu$\CC}
 \newcommand{\PAB}[1]{{\color{red}PAB: #1}}
@@ -157,6 +154,6 @@
 \urlstyle{sf}
 
-\usepackage[automake,toc,abbreviations]{glossaries-extra} % Exception to the rule of hyperref being the last add-on package
-\renewcommand*{\glstextformat}[1]{\textcolor{black}{#1}}
+%\usepackage[automake,toc,abbreviations]{glossaries-extra} % Exception to the rule of hyperref being the last add-on package
+%\renewcommand*{\glstextformat}[1]{\textcolor{black}{#1}}
 % If glossaries-extra is not in your LaTeX distribution, get it from CTAN (http://ctan.org/pkg/glossaries-extra), 
 % although it's supposed to be in both the TeX Live and MikTeX distributions. There are also documentation and 
@@ -199,8 +196,8 @@
 
 % Define Glossary terms (This is properly done here, in the preamble and could also be \input{} from a separate file...)
-\usepackage[automake,toc,abbreviations]{glossaries-extra} % Exception to the rule of hyperref being the last add-on package
-\renewcommand*{\glstextformat}[1]{\textcolor{black}{#1}}
-\input{glossary}
-\makeglossaries
+%\usepackage[automake,toc,abbreviations]{glossaries-extra} % Exception to the rule of hyperref being the last add-on package
+%\renewcommand*{\glstextformat}[1]{\textcolor{black}{#1}}
+%\input{glossary}
+%\makeglossaries
 
 %======================================================================
@@ -276,7 +273,7 @@
 % GLOSSARIES (Lists of definitions, abbreviations, symbols, etc. provided by the glossaries-extra package)
 % -----------------------------
-\printglossary
-\cleardoublepage
-\phantomsection		% allows hyperref to link to the correct page
+%\printglossary
+%\cleardoublepage
+%\phantomsection		% allows hyperref to link to the correct page
 
 %----------------------------------------------------------------------
