Index: doc/proposals/enum.tex
===================================================================
--- doc/proposals/enum.tex	(revision 8c13ca8142cd08bd07508ef52c311b80b56b6d46)
+++ doc/proposals/enum.tex	(revision 66d92e3cc3e75781be55e344dbdf9ca4e58f9872)
@@ -14,4 +14,12 @@
 \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}}
+
+% 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}
 \makeatother
 
@@ -38,4 +46,6 @@
 \newcommand{\CFAIcon}{\textsf{C\raisebox{\depth}{\rotatebox{180}A}}} % Cforall icon
 \newcommand{\CFA}{\protect\CFAIcon\xspace}				% CFA symbolic name
+\newcommand{\CCIcon}{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}} % C++ icon
+\newcommand{\CC}[1][]{\protect\CCIcon{#1}\xspace}		% C++ symbolic name
 \newcommand{\PAB}[1]{{\color{red}PAB: #1}}
 
@@ -58,4 +68,5 @@
     captionpos=b,                    
     keepspaces=true,                 
+	escapechar=\$,							% LaTeX escape in CFA code
 %    numbers=left,                    
 %    numbersep=5pt,                  
@@ -83,5 +94,5 @@
 \begin{abstract}
 An enumeration is a type that defines a list of named constant values in C (and other languages).
-C uses an integral type as the underlying representation of an enumeration.
+C and \CC use an integral type as the underlying representation of an enumeration.
 \CFA extends C enumerations to allow all basic and custom types for the inner representation.
 \end{abstract}
@@ -92,28 +103,32 @@
 \begin{lstlisting}[label=lst:weekday]
 enum Weekday { Monday, Tuesday, Wednesday, Thursday=10, Friday, Saturday, Sunday };
-\end{lstlisting}
-The example defines an @enum@ type @Weekday@ with ordered enumerators @Monday@, @Tuesday@, @Wednesday@, @Thursday@, @Friday@, @Saturday@ and @Sunday@.
+                $\(\uparrow\)$                                                                      $\(\uparrow\)$
+    ${\rm \newterm{enumeration name}}$                                        ${\rm \newterm{enumerator names}}
+\end{lstlisting}
+The example defines an enumeration type @Weekday@ with ordered enumerators @Monday@, @Tuesday@, @Wednesday@, @Thursday@, @Friday@, @Saturday@ and @Sunday@.
 The successor of @Tuesday@ is @Monday@ and the predecessor of @Tuesday@ is @Wednesday@.
-A C enumeration has an integral type, with consecutive enumerator values assigned by the compiler starting at zero or explicitly initialized by the programmer.
-For example, @Monday@ to @Wednesday@ have values 0--2, @Thursday@ is set to @10@, and after it, @Friday@ to @Sunday@ have values 11--13.
-
-There are 3 attributes for an enumeration: position, label, and value:
+A C enumeration is an integral type, with consecutive enumerator values assigned by the compiler starting at zero or the next explicitly initialized value by the programmer.
+For example, @Monday@ to @Wednesday@ have values 0--2 implicitly set by the compiler, @Thursday@ is explicitly set to @10@ by the programmer, and @Friday@ to @Sunday@ have values 11--13 implicitly set by the compiler.
+
+There are 3 attributes for an enumeration: \newterm{position}, \newterm{label}, and \newterm{value}:
 \begin{cquote}
-\small\sf
+\small\sf\setlength{\tabcolsep}{3pt}
 \begin{tabular}{rccccccccccc}
-enum Weekday \{	& Monday,	& Tuesday,	& Wednesday,	& Thursday=10,	& Friday, 	& Saturday,	& Sunday \}; \\
-position		& 0			& 1			& 2				& 3				& 4			& 5			& 6			\\
-label			& Monday	& Tuesday	& Wednesday		& Thursday		& Friday 	& Saturday	& Sunday	\\
-value			& 0			& 1			& 2				& 10			& 11		& 12		& 13
+@enum@ Weekday \{	& Monday,	& Tuesday,	& Wednesday,	& Thursday=10,	& Friday, 	& Saturday,	& Sunday \}; \\
+\it position		& 0			& 1			& 2				& 3				& 4			& 5			& 6			\\
+\it label			& Monday	& Tuesday	& Wednesday		& Thursday		& Friday 	& Saturday	& Sunday	\\
+\it value			& 0			& 1			& 2				& 10			& 11		& 12		& 13
 \end{tabular}
 \end{cquote}
 
-The enumerators of an enum are unscoped, i.e., enumerators declared inside of an enum are visible in the enclosing scope of the enum class.
+The enumerators of an enumeration are unscoped, i.e., enumerators declared inside of an @enum@ are visible in the enclosing scope of the @enum@ type.
 \begin{lstlisting}[label=lst:enum_scope]
 {
-	enum RGB { R, G, B };
-	int i = R  // i == 0
-}
-int j = G; // ERROR! G is not declared in this scope
+	enum Weekday { ... };	// enumerators implicitly projected into local scope
+	Weekday weekday = Monday;
+	weekday = Friday;
+	int i = Sunday  // i == 13
+}
+int j = Wednesday; // ERROR! Wednesday is not declared in this scope
 \end{lstlisting}
 
@@ -121,11 +136,10 @@
 
 A \CFA enumeration is parameterized by a type, which specifies the type for each enumerator.
-\CFA allows any object type for the enumerators, and values assigned to enumerators must be in the declared type.
+\CFA allows any object type for the enumerators, and values assigned to enumerators must be from the declared type.
 \begin{lstlisting}[label=lst:color]
 enum Colour( @char *@ ) { Red = "R", Green = "G", Blue = "B"  };
 \end{lstlisting}
 The type of @Colour@ is @char *@ and each enumerator is initialized with a C string.
-Only types have define an ordering can be automatically initialized (see Section~\ref{s:AutoInitializable}).
-
+Only types with a defined ordering can be automatically initialized (see Section~\ref{s:AutoInitializable}).
 
 % An instance of \CFA-enum (denoted as @<enum_instance>@) is a label for the defined enum name.
@@ -133,33 +147,55 @@
 % Similarly, the @value()@ function returns the value used to initialize the \CFA-enum.
 
-A \CFA-enum is scoped: enumeration constants are not automatically exposed to the global scope.
-Enumeration constant can be referenced using qualified expressions like an aggregate that supports qualified references to its fields. The syntax of $qualified\_expression$ for \CFA-enum is the following:
-$$<qualified\_expression> := <enum\_type>.<enumerator>$$
-
-
-\subsection{enumeration instance}
-\begin{lstlisting}[label=lst:sample_cforall_enum_usage]
-Colour green = Colour.Green;
-\end{lstlisting}
-The ~\ref{lst:sample_cforall_enum_usage} example declares a $enumeration\ instance$ named @red@ and initializes it with $enumeration\ constant$ @Color.Red@.
-An enumeration instance is a data structure that captures attributes of an enumeration constant, which can be retrieved by functions $position( enumeration\ instance )$, $value( enumeration\ instance )$, and $label( enumeration\ instance )$. 
-\begin{lstlisting}
-int green_pos = position( green ); // 1
-char * green_value = value( green ); // "G"
-char * green_label = label( green ); // "Green"
-\end{lstlisting}
-An enumeration instance can be assigned to a variable or used as its position with type integer, its value with declared type T, or its label with type char *, and the compiler will resolve the usage as a type fits the context. 
+\subsection{Enumerator Scoping}
+
+A \CFA-enum can be scoped, meaning the enumerator constants are not projected into the enclosing scope.
+\begin{lstlisting}
+enum Colour( char * ) @!@ { ... };
+\end{lstlisting}
+where the @'!'@ implies the enumerators are \emph{not} projected.
+The enumerators of a scoped enumeration are accessed using qualification, like the fields of an aggregate.
+% The syntax of $qualified\_expression$ for \CFA-enum is the following:
+% $$<qualified\_expression> := <enum\_type>.<enumerator>$$
+\begin{lstlisting}
+Colour colour = @Colour.@Red;	// qualification
+colour = @Colour.@Blue;
+\end{lstlisting}
+
+\subsection{Enumerator Attributes}
+
+The attributes of an enumerator are accessed by pseudo-functions @position@, @value@, and @label@, i.e., like @sizeof@. 
+\begin{lstlisting}
+int green_pos = @position@( Colour.Green );	// 1
+char * green_value = @value@( Colour.Green );	// "G"
+char * green_label = @label@( Colour.Green );	// "Green"
+\end{lstlisting}
+There are implicit conversions from an enumerator to its attributes.
 \begin{lstlisting}[label=lst:enum_inst_assign_int]
-int green_pos = green; // equivalent to position( green ); 
-\end{lstlisting}
-A resolution of an enumeration constant is $unambigious$ if only one of the attributes has the resolvable type.
-In example~\ref{lst:enum_inst_assign_int}, the right-hand side of the assignment expression expects integer type.
-The position of an enumeration is @int@, while the other two cannot be resolved as integers.
-The expression unambiguously returns the position of @green@.
-\begin{lstlisting}[label=lst:enum_inst_assign_string]
-char * green_value = green; // equivalent to value( green ); 
-\end{lstlisting}
-On the other hand, the resolution of an enumeration constant is $ambigious$ if multiple attributes have the expected type.
-In example~\ref{lst:enum_inst_assign_string}, both value and label have the expected type @char *@.
+int green_pos = Colour.Green;  // 1
+char * green_value = Colour.Green;  // ambiguous
+char * green_label = Colour.Green;  // ambiguous
+\end{lstlisting}
+where a conversion is ambiguous, if the enumerator's type is same as an attribute's type.
+For example, @value( Colour.Green )@ and @label( Colour.Green )@ both have type @char *@.
+Further examples are:
+\begin{cquote}
+\begin{tabular}{ll}
+\begin{lstlisting}
+int monday_pos = Monday;  // ambiguous
+int monday_value = Monday;  // ambiguous
+char * monday_label = Monday;  // "Monday"
+
+\end{lstlisting}
+&
+\begin{lstlisting}
+enum(double) Math { PI = 3.14159, E = 2.718 };
+int pi_pos = PI;  // 0
+double pi_value = PI;  // 3.14159
+char * pi_label = PI;  // "PI"
+\end{lstlisting}
+\end{tabular}
+\end{cquote}
+Here, @position( Monday )@ and @value( Monday )@ both have type @int@, while all attribute types are unique for enumerator @PI@.
+
 When a resolution is ambiguous, a \textit{resolution precedence} applies: $$value > position > label$$
 \CFA uses resolution distance to describe if one type can be used as another. While \CFA calculates the resolution distance between the expected type and types of all three attributes, it would not choose the attribute with the closest distance. Instead, when resolving an enumeration constant, \CFA always chooses value whenever it is a possible resolution (resolution distance is not infinite), followed by position, then label. 
@@ -170,6 +206,10 @@
 In the example~\ref{lst:enum_inst_precedence}, while $position( Bar )$ has the closest resolution among the three attributes, $Foo.Bar$ is resolved as $value( Bar )$ because of the resolution precedence.
 
-Although \CFA enumeration captures three different attributes, an instance of enumeration does not occupy extra memory.
-The @sizeof@ \CFA enumeration instance is always 4 bytes, the same amount of memory to store a C enumeration instance.
+\PAB{Not sure this is going to work.}
+
+\subsection{Enumerator Storage}
+
+Although \CFA enumeration captures three different attributes, an enumeration instance does not store all this information.
+The @sizeof@ a \CFA enumeration instance is always 4 bytes, the same size as a C enumeration instance (@sizeof( int )@).
 It comes from the fact that:
 \begin{enumerate}
@@ -179,5 +219,5 @@
 it is always resolved as one of its attributes in terms of real usage.
 \end{enumerate}
-When creating the enumeration instance green and assigns it with the enumeration constant @Color.Green@, the compilers essentially allocate an integer variables and store the position 1.
+When creating an enumeration instance @colour@ and assigning it with the enumerator @Color.Green@, the compiler allocates an integer variable and stores the position 1.
 The invocations of $positions()$, $value()$, and $label()$ turn into calls to special functions defined in the prelude:
 \begin{lstlisting}[label=lst:companion_call]
@@ -195,17 +235,18 @@
 
 \begin{lstlisting}[caption={Enum Type Functions}, label=lst:cforall_enum_functions]
-forall( T )  {
-	struct Companion {
-		const T * const values;
-		const char** const labels;
-			int length;
-	};
-}
-\end{lstlisting}
-\CFA creates an object of Companion for every \CFA-enumeration. A companion object has the same name as the enumeration is defined for.
+forall( T )
+struct Companion {
+	const T * const values;
+	const char ** const labels;
+	int length;
+};
+\end{lstlisting}
+\CFA creates a @Companion@ object for every \CFA enumeration.
+A companion object has the same name as the enumeration is defined for.
 A companion object stores values and labels of enumeration constants, in the order of the constants defined in the enumeration.
 
-\CFA generates the definition of companion functions. Because \CFA implicitly stores enumeration instance as its position, the companion function $position$ does nothing but returns the position it passes it.
-Companions function $value$ and $label$ return the array item at the given position of $values$ and $labels$, respectively.
+\CFA generates the definition of companion functions.
+Because \CFA implicitly stores enumeration instance as its position, the companion function @position@ does nothing but return the position it is passed.
+Companions function @value@ and @label@ return the array item at the given position of @values@ and @labels@, respectively.
 \begin{lstlisting}[label=lst:companion_definition]
 int position( Companion o, int pos ) { return pos; }
@@ -213,21 +254,20 @@
 char * label( Companion o, int pos ) { return o.labels[ pos ]; }
 \end{lstlisting}
-Notably, the Companion structure definition, and all companion objects, are visible to the users.
-A user can retrieve values and labels defined in an enumeration by accessing the values and labels directly, or indirectly by calling Companion functions $values$ and $labels$
+Notably, the @Companion@ structure definition, and all companion objects, are visible to users.
+A user can retrieve values and labels defined in an enumeration by accessing the values and labels directly, or indirectly by calling @Companion@ functions @values@ and @labels@
 \begin{lstlisting}[label=lst:companion_definition_values_labels]
 Colour.values; // read the Companion's values
-values( Colour ); // Same as Colour.values
+values( Colour ); // same as Colour.values
 \end{lstlisting}
 
 \subsection{User Define Enumeration Functions}
 
-The Companion objects make extending features for \CFA enumeration easy. 
-
+Companion objects make extending features for \CFA enumeration easy. 
 \begin{lstlisting}[label=lst:companion_user_definition]
 char * charastic_string( Companion o, int position ) { 
-	return sprintf("Label: %s; Value: %s", label( o, position ), value( o, position) ); 
+	return sprintf( "Label: %s; Value: %s", label( o, position ), value( o, position) ); 
 }
 printf( charactic_string ( Color, 1 ) );
->>> Label: G; Value: G
+>>> Label: Green; Value: G
 \end{lstlisting}
 Defining a function takes a Companion object effectively defines functions for all \CFA enumeration.
@@ -236,6 +276,6 @@
 Therefore, a user can use the syntax with a user-defined enumeration function call:
 \begin{lstlisting}[label=lst:companion_user_definition]
-charactic_string ( Color.Green ); // equivalent to charactic_string ( Color, 1 )
->>> Label: G; Value: G
+charactic_string( Color.Green ); // equivalent to charactic_string( Color, 1 )
+>>> Label: Green; Value: G
 \end{lstlisting}
 Similarly, the user can work with the enumeration type itself: (see section ref...)
@@ -251,9 +291,9 @@
 \subsection{Runtime Enumeration}
 
-The Companion structure definition is visible to users, and users can create an instance of Companion object themselves, which effectively constructs a \textit{Runtime Enumeration}.
+The companion structure definition is visible to users, and users can create an instance of companion object themselves, which effectively constructs a \textit{Runtime Enumeration}.
 \begin{lstlisting}[ label=lst:runtime_enum ]
-const char values[] = { "Hello", "World" };
-const char labels[] = { "First", "Second" };
-Companion (char *) MyEnum = { .values: values, .labels: labels, .length: 2 };
+const char values[$\,$] = { "Hello", "World" };
+const char labels[$\,$] = { "First", "Second" };
+Companion(char *) MyEnum = { .values: values, .labels: labels, .length: 2 };
 \end{lstlisting}
 A runtime enumeration can be used to call enumeration functions.
@@ -267,9 +307,12 @@
 			            // and MyEnum.First is not recognizable
 \end{lstlisting}
-During the compilation, \CFA adds enumeration declarations to an enumeration symbol table and creates specialized function definitions for \CFA enumeration. \CFA does not recognize runtime enumeration during compilation and would not add them to the enumeration symbol table, resulting in a lack of supports for runtime enumeration.
+During the compilation, \CFA adds enumeration declarations to an enumeration symbol table and creates specialized function definitions for \CFA enumeration.
+\CFA does not recognize runtime enumeration during compilation and would not add them to the enumeration symbol table, resulting in a lack of supports for runtime enumeration.
+
+\PAB{Not sure how useful this feature is.}
 
 \section{Enumeration Features}
 
-A trait is a collection of constraints in \CFA, which can be used to describe types.
+A trait is a collection of constraints in \CFA that can be used to describe types.
 The \CFA standard library defines traits to categorize types with related enumeration features.
 
@@ -279,9 +322,9 @@
 TODO: make the initialization rule a separate section. 
 
-If no explicit initializer is given to an enumeration constant, C initializes the first enumeration constant with value 0, and the other enumeration constant has a value equal to its $predecessor+1$.
+If no explicit initializer is given to an enumeration constant, C initializes the first enumeration constant with value 0, and the next enumeration constant has a value equal to its $predecessor + 1$.
 \CFA enumerations have the same rule in enumeration constant initialization.
-However, not all types can be automatically initialized by \CFA because the meaning of $zero$, $one$, and addition operator may not be well-defined.
-
-A type is auto-Initializable if it has defined @zero_t@, @one_t@, and an addition operator.
+However, only \CFA types that have defined traits for @zero_t@, @one_t@, and an addition operator can be automatically initialized by \CFA.
+
+Specifically, a type is auto-initializable only if it satisfies the trait @AutoInitializable@:
 \begin{lstlisting}
 forall(T)
@@ -292,68 +335,64 @@
 };
 \end{lstlisting}
-An example of user-defined @AutoInitializable@ would look like the following:
+An example of a user-defined @AutoInitializable@ is:
 \begin{lstlisting}[label=lst:sample_auto_Initializable]
 struct Odd { int i; };
 void ?()( Odd & t, zero_t ) { t.i = 1; };
 void ?()( Odd & t, one_t ) { t.i = 2; };
-Odd ?+?( Odd t1, Odd t2 ) 
-	{ return Odd( t1.i + t2.i); };
-\end{lstlisting}
-When an enumeration declares an AutoInitializable as its type, no explicit initialization is necessary. 
+Odd ?+?( Odd t1, Odd t2 ) { return Odd( t1.i + t2.i); };
+\end{lstlisting}
+When the type of an enumeration is @AutoInitializable@, implicit initialization is available. 
 \begin{lstlisting}[label=lst:sample_auto_Initializable_usage]
 enum AutoInitUsage(Odd) {
-	A, B, C = 6, D
-};
-\end{lstlisting}
-
-In the example~\ref{lst:sample_auto_Initializable_usage_gen}, because no initializer is specified for the first enumeration constant @A@, \CFA initializes it with the value of @zero_t@, which is 1.
-@B@ and @D@ have the values of their $predecessor + one_t$, while @one_t@ has the value 2.
-Therefore, the enumeration is initialized as the following:
+	A, B, C = 7, D
+};
+\end{lstlisting}
+In the example, there is no initializer specified for the first enumeration constant @A@, so \CFA initializes it with the value of @zero_t@, which is 1.
+@B@ and @D@ have the values of their $predecessor + one_t$, where @one_t@ has the value 2.
+Therefore, the enumeration is initialized as follows:
 \begin{lstlisting}[label=lst:sample_auto_Initializable_usage_gen]
 enum AutoInitUsage(Odd) {
-	A=1, B=3, C = 6, D=8
-};
-\end{lstlisting}
-In \CFA, integral types, float types, and imaginary numbers are example types that are AutoInitialiable.
+	A = 1, B = 3, C = 7, D = 9
+};
+\end{lstlisting}
+Note, there is no mechanism to prevent an even value for the direct initialization, such as @C = 6@.
+
+In \CFA, character, integral, float, and imaginary types are all @AutoInitialiable@.
 \begin{lstlisting}[label=lst:letter]
-enum Alphabet(int) {
-	A='A', B, C, D, E, F, G, H, I, J, K, L, M,
-	N, O, P, Q, R, S, T, U, V, W, X, Y, Z,
-	a='a', b, c, d, e, f, g, h, i, j, k, l, m,
-	n, o, p, q, r, s, t, u, v, w, x, y, z
-};
-print( "%c, %c, %c", Alphabet.F, Alphabet.o, Alphabet.o );
->>> F, o, o
+enum Alphabet( int ) {
+	A = 'A', B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,
+	a = 'a', b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z
+};
+print( "%c, %c, %c", Alphabet.F, Alphabet.o, Alphabet.z );
+>>> F, o, z
 \end{lstlisting}
 
 \subsection{Iteration and Range}
 
-It is convenient to iterate over a \CFA enumeration.
-Here is the basic usage:
+It is convenient to iterate over a \CFA enumeration, e.g.:
 \begin{lstlisting}[label=lst:range_functions]
-for ( Alphabet ah; Alphabet; ) {
-	printf( "%d ", ah );
-}
->>> A B C (...omit the rest)
-\end{lstlisting}
-The for-loop uses the enumeration type @Alphabet@ as range.
-When that happens, \CFA iterates all enumerators in the order they defined in the enumeration.
-@'ch'@ is the iterating enumerator, and it returns the value of an Alphabet in this context according to the precedence rule.
+for ( Alphabet alph; Alphabet ) {
+	printf( "%d ", alph );
+}
+>>> A B C ...
+\end{lstlisting}
+The for-loop uses the enumeration type @Alphabet@ its range, and iterates through all enumerators in the order defined in the enumeration.
+@alph@ is the iterating enumeration object, which returns the value of an @Alphabet@ in this context according to the precedence rule.
 
 \CFA offers a shorthand for iterating all enumeration constants: 
 \begin{lstlisting}[label=lst:range_functions]
-for ( Alphabet ch ) {
-	printf( "%d ", ch );
-}
->>> A B C (...omit the rest)
-\end{lstlisting}
-
-Enumeration supports the \CFA loop control syntax for for-loop.
+for ( Alphabet alph ) {
+	printf( "%d ", alph );
+}
+>>> A B C ...
+\end{lstlisting}
+The following different loop-control syntax is supported:
 \begin{lstlisting}[label=lst:range_functions]
 for ( Alphabet.D )
-for ( ch; Alphabet.g ~ Alphabet.z )
-for ( Alphabet ch; Alphabet.R ~ Alphabet.X ~ 2 )
-\end{lstlisting}
-Notably, the meaning of "step" of iteration has changed for enumeration.
+for ( alph; Alphabet.g ~ Alphabet.z )
+for ( Alphabet alph; Alphabet.R ~ Alphabet.X ~ 2 )
+\end{lstlisting}
+\PAB{Explain what each loop does.}
+Notably, the meaning of ``step'' for an iteration has changed for enumeration.
 Consider the following example:
 \begin{lstlisting}[label=lst:range_functions]
@@ -364,5 +403,4 @@
 	printf( "%d ", s ); 
 }
-
 >>> 10 12 14
 
@@ -378,5 +416,5 @@
 It is also possible to iterate over an enumeration's labels, implicitly or explicitly:
 \begin{lstlisting}[label=lst:range_functions_label_implicit]
-for ( char * ch; Alphabet )
+for ( char * alph; Alphabet )
 \end{lstlisting}
 This for-loop implicitly iterates every label of the enumeration, because a label is the only valid resolution to the ch with type @char *@ in this case.
@@ -399,5 +437,5 @@
 During the $Validation$ pass, the compiler links the type declaration to the type's definition.
 It ensures that the name of an enumerator is unique within the enumeration body, and checks if all values of the enumerator have the declaration type.
-If the declared type is not @Auto Initializable@, \CFA rejects the enumeration definition.
+If the declared type is not @AutoInitializable@, \CFA rejects the enumeration definition.
 Otherwise, it attempts to initialize enumerators with the enumeration initialization pattern. (a reference to a future initialization pattern section) 
 
@@ -429,5 +467,5 @@
 But the result is computed at run time, and the compiler ensures the @values@ are not changed.
 
-\subsection{qualified expression}
+\subsection{Qualified Expression}
 
 \CFA uses qualified expression to address the scoping of \CFA-enumeration. 
@@ -441,9 +479,9 @@
 If the @aggregation_name@ is identified as a \CFA enumeration, the compiler checks if @field@ presents in the declared \CFA enumeration.
 
-\subsection{\lstinline{with} statement/statement}
+\subsection{\lstinline{with} Statement}
 
 \emph{Work in Progress}
 
-Instead of qualifying an enumeration expression every time, one can use the @with@ to expose enumerators to the current scope so that they are directly accessible.
+Instead of qualifying an enumeration expression every time, the @with@ can be used to expose enumerators to the current scope, making them directly accessible.
 
 \subsection{Instance Declaration}
Index: driver/demangler.cc
===================================================================
--- driver/demangler.cc	(revision 66d92e3cc3e75781be55e344dbdf9ca4e58f9872)
+++ driver/demangler.cc	(revision 66d92e3cc3e75781be55e344dbdf9ca4e58f9872)
@@ -0,0 +1,25 @@
+#include "Demangle.h"
+#include <iostream>
+#include <fstream>
+
+void demangleAndPrint(const std::string & mangleName) {
+	char * demangleName = cforall_demangle(mangleName.c_str(), 0);
+	std::cout << mangleName << " => " << demangleName << std::endl;
+	free(demangleName);
+}
+
+int main(int argc, char * argv[]) {
+	char const * fileName = (1 < argc) ? argv[1] : "in-demangle.txt";
+	std::ifstream in(fileName);
+
+	std::string line;
+	while (std::getline(in, line)) {
+		if (line.empty()) {
+			std::cout << "=================================" << std::endl;
+		} else if (line[0] == '#') {
+			continue;
+		} else {
+			demangleAndPrint(line);
+		}
+	}
+}
Index: c/SymTab/demangler.cc
===================================================================
--- src/SymTab/demangler.cc	(revision 8c13ca8142cd08bd07508ef52c311b80b56b6d46)
+++ 	(revision )
@@ -1,25 +1,0 @@
-#include "Demangle.h"
-#include <iostream>
-#include <fstream>
-
-void demangleAndPrint(const std::string & mangleName) {
-	char * demangleName = cforall_demangle(mangleName.c_str(), 0);
-	std::cout << mangleName << " => " << demangleName << std::endl;
-	free(demangleName);
-}
-
-int main(int argc, char * argv[]) {
-	char const * fileName = (1 < argc) ? argv[1] : "in-demangle.txt";
-	std::ifstream in(fileName);
-
-	std::string line;
-	while (std::getline(in, line)) {
-		if (line.empty()) {
-			std::cout << "=================================" << std::endl;
-		} else if (line[0] == '#') {
-			continue;
-		} else {
-			demangleAndPrint(line);
-		}
-	}
-}
