Index: doc/proposals/enum.tex
===================================================================
--- doc/proposals/enum.tex	(revision fc12f0538e95e9c017d414a9a9c10748cc02bacd)
+++ doc/proposals/enum.tex	(revision 25f2798eafbbfb4bb8b7940f48998f59c55a7e12)
@@ -15,4 +15,13 @@
 \renewcommand\subparagraph{\@startsection{subparagraph}{4}{\z@}{-1.5ex \@plus -1ex \@minus -.2ex}{-1em}{\normalfont\normalsize\bfseries\itshape}}
 \makeatother
+
+\usepackage[ignoredisplayed]{enumitem}	% do not affect trivlist
+\setlist{labelsep=1ex}% global
+\setlist[itemize]{topsep=0.5ex,parsep=0.25ex,itemsep=0.25ex,listparindent=\parindent,leftmargin=\parindent}% global
+\setlist[itemize,1]{label=\textbullet}% local
+%\renewcommand{\labelitemi}{{\raisebox{0.25ex}{\footnotesize$\bullet$}}}
+\setlist[enumerate]{topsep=0.5ex,parsep=0.25ex,itemsep=0.25ex,listparindent=\parindent}% global
+\setlist[enumerate,2]{leftmargin=\parindent,labelsep=*,align=parleft,label=\alph*.}% local
+\setlist[description]{topsep=0.5ex,itemsep=0pt,listparindent=\parindent,leftmargin=\parindent,labelsep=1.5ex}
 
 \newenvironment{cquote}{%
@@ -124,5 +133,6 @@
 % 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:
+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>$$
 
@@ -132,6 +142,6 @@
 Colour green = Colour.Green;
 \end{lstlisting}
-The ~\ref{lst:sample_cforall_enum_usage} example declares a $enumeration\ instance$ named \textit{red} and initializes it with $enumeration\ constant$ \textit{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 )$. 
-
+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
@@ -139,20 +149,19 @@
 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. 
-
 \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 the 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.
-
+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 the example~\ref{lst:enum_inst_assign_string}, both value and label have the expected type char *. When a resolution is ambiguous, a \textit{resolution precedence} applies:
-$$value > position > label$$
+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 *@.
+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. 
-
 \begin{lstlisting}[label=lst:enum_inst_precedence]
 enum(double) Foo { Bar };
@@ -161,7 +170,15 @@
 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. It comes from the fact that: 1. a \CFA enumeration is always statically typed; 2. it is always resolved as one of its attributes in terms of real usage.
-
-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. The invocations of $positions()$, $value()$, and $label()$ turn into calls to special functions defined in the prelude:
+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.
+It comes from the fact that:
+\begin{enumerate}
+\item
+a \CFA enumeration is always statically typed;
+\item
+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.
+The invocations of $positions()$, $value()$, and $label()$ turn into calls to special functions defined in the prelude:
 \begin{lstlisting}[label=lst:companion_call]
 position( green );
@@ -172,8 +189,9 @@
 >>> label( Colour, 1) -> char *
 \end{lstlisting}
-T represents the type declared in the \CFA enumeration defined and char * in the example. 
+@T@ represents the type declared in the \CFA enumeration defined and @char *@ in the example. 
 These generated functions are $Companion Functions$, they take an $companion$ object and the position as parameters.
 
 \subsection{Companion Object and Companion Function}
+
 \begin{lstlisting}[caption={Enum Type Functions}, label=lst:cforall_enum_functions]
 forall( T )  {
@@ -181,12 +199,13 @@
 		const T * const values;
 		const char** const labels;
-            int length;
+			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. 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 creates an object of Companion 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.
 \begin{lstlisting}[label=lst:companion_definition]
 int position( Companion o, int pos ) { return pos; }
@@ -194,6 +213,6 @@
 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 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$
 \begin{lstlisting}[label=lst:companion_definition_values_labels]
 Colour.values; // read the Companion's values
@@ -202,9 +221,10 @@
 
 \subsection{User Define Enumeration Functions}
+
 The 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 ) );
@@ -213,16 +233,16 @@
 Defining a function takes a Companion object effectively defines functions for all \CFA enumeration.
 
-The \CFA compiler turns a function call that takes an enumeration instance as a parameter into a function call with a companion object plus a position. Therefore, a user can use the syntax with a user-defined enumeration function call:
+The \CFA compiler turns a function call that takes an enumeration instance as a parameter into a function call with a companion object plus a position.
+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
 \end{lstlisting}
-
 Similarly, the user can work with the enumeration type itself: (see section ref...)
 \begin{lstlisting}[ label=lst:companion_user_definition]
 void print_enumerators ( Companion o ) { 
-    for ( c : Companion o ) {
-        sout | label (c) | value( c ) ;
-    } 
+	for ( c : Companion o ) {
+		sout | label (c) | value( c ) ;
+	} 
 }
 print_enumerators( Colour );
@@ -230,4 +250,5 @@
 
 \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}.
 \begin{lstlisting}[ label=lst:runtime_enum ]
@@ -244,20 +265,23 @@
 \begin{lstlisting}[ label=lst:runtime_enum_usage ]
 MyEnum e = MyEnum.First; // Does not work: cannot create an enumeration instance e, 
-                        // and MyEnum.First is not recognizable
+			            // 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.
 
 \section{Enumeration Features}
+
 A trait is a collection of constraints in \CFA, which can be used to describe types.
 The \CFA standard library defines traits to categorize types with related enumeration features.
 
-
 \subsection{Auto Initializable}
 \label{s:AutoInitializable}
+
 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$. \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.
+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$.
+\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.
 \begin{lstlisting}
 forall(T)
@@ -268,36 +292,34 @@
 };
 \end{lstlisting}
-
 An example of user-defined @AutoInitializable@ would look like the following:
-\begin{lstlisting}[label=lst:sample_auto_initializable]
+\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}
-
+	{ return Odd( t1.i + t2.i); };
+\end{lstlisting}
 When an enumeration declares an AutoInitializable as its type, no explicit initialization is necessary. 
-\begin{lstlisting}[label=lst:sample_auto_initializable_usage]
+\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}, 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:
-
-\begin{lstlisting}[label=lst:sample_auto_initializable_usage_gen]
+	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:
+\begin{lstlisting}[label=lst:sample_auto_Initializable_usage_gen]
 enum AutoInitUsage(Odd) {
-    A=1, B=3, C = 6, D=8
-};
-\end{lstlisting}
-
+	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.
 \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
+	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 );
@@ -307,18 +329,20 @@
 \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.
+Here is the basic usage:
 \begin{lstlisting}[label=lst:range_functions]
-for ( Alphabet ch; Alphabet; ) {
-    printf( "%d ", ch );
+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.
+\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.
 
 \CFA offers a shorthand for iterating all enumeration constants: 
 \begin{lstlisting}[label=lst:range_functions]
 for ( Alphabet ch ) {
-    printf( "%d ", ch );
+	printf( "%d ", ch );
 }
 >>> A B C (...omit the rest)
@@ -331,12 +355,12 @@
 for ( Alphabet ch; Alphabet.R ~ Alphabet.X ~ 2 )
 \end{lstlisting}
-
-Notably, the meaning of "step" of iteration has changed for enumeration. Consider the following example:
+Notably, the meaning of "step" of iteration has changed for enumeration.
+Consider the following example:
 \begin{lstlisting}[label=lst:range_functions]
 enum(int) Sequence {
-    A = 10, B = 12, C = 14;  
+	A = 10, B = 12, C = 14;  
 }
 for ( s; Sequence.A ~ Sequence.C ) {
-    printf( "%d ", s ); 
+	printf( "%d ", s ); 
 }
 
@@ -344,9 +368,11 @@
 
 for ( s; Sequence.A ~ Sequence.A ~ 2 ) {
-    printf( "%d ", s ); 
+	printf( "%d ", s ); 
 }
 >>> 10 14
 \end{lstlisting}
-The range iteration of enumeration does not return the $current\_value++$ until it reaches the upper bound. The semantics is to return the next enumeration constant. If a stepping is specified, 2 for example, it returns the 2 enumeration constant after the current one, rather than the $current+2$
+The range iteration of enumeration does not return the @current_value++@ until it reaches the upper bound.
+The semantics is to return the next enumeration constant.
+If a stepping is specified, 2 for example, it returns the 2 enumeration constant after the current one, rather than the @current+2@.
 
 It is also possible to iterate over an enumeration's labels, implicitly or explicitly:
@@ -354,5 +380,6 @@
 for ( char * ch; 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. If the value can also be resolved as the char *, you might iterate the labels explicitly with the array iteration.
+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.
+If the value can also be resolved as the @char *@, you might iterate the labels explicitly with the array iteration.
 \begin{lstlisting}[label=lst:range_functions_label_implicit]
 for ( char * ch; labels( Alphabet ) )
@@ -360,12 +387,18 @@
 
 \section{Implementation}
+
 \CFA places the definition of Companion structure and non-parameterized Companion functions in the prelude, visible globally.
 
-\subsection{declaration}
+\subsection{Declaration}
+
 The qualified enumeration syntax is dedicated to \CFA enumeration.
 \begin{lstlisting}[label=lst:range_functions]
 enum (type_declaration) name { enumerator = const_expr, enumerator = const_expr, ... }
 \end{lstlisting}
-A compiler stores the name, the underlying type, and all enumerators in an @enumeration table@. 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. Otherwise, it attempts to initialize enumerators with the enumeration initialization pattern. (a reference to a future initialization pattern section) 
+A compiler stores the name, the underlying type, and all enumerators in an @enumeration table@.
+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.
+Otherwise, it attempts to initialize enumerators with the enumeration initialization pattern. (a reference to a future initialization pattern section) 
 
 \begin{lstlisting}[label=lst:init]
@@ -376,40 +409,54 @@
 
 enum (T) Sample { 
-    Zero: 0 /* zero_t */, 
-    One: Zero + 1 /* ?+?( Zero, one_t ) */ , ...
-};
-\end{lstlisting}
-
-Challenge:
-The value of an enumerator, or the initializer, requires $const\_expr$. While previously getting around the issue by pushing it to the C compiler, it might not work anymore because of the user-defined types, user-defined $zero\_t$, $one\_t$, and addition operation. Might not be able to implement a *Correct* static check.
+	Zero: 0 /* zero_t */, 
+	One: Zero + 1 /* ?+?( Zero, one_t ) */ , ...
+};
+\end{lstlisting}
+Challenge: \\
+The value of an enumerator, or the initializer, requires @const_expr@.
+While previously getting around the issue by pushing it to the C compiler, it might not work anymore because of the user-defined types, user-defined @zero_t@, @one_t@, and addition operation.
+Might not be able to implement a \emph{correct} static check.
 
 \CFA $autogens$ a Companion object for the declared enumeration.
 \begin{lstlisting}[label=lst:companion]
 Companion( T ) Sample {
-    .values: { 0, 0+1, 0+1+1, 0+1+1+1, ... }, /* 0: zero_t, 1: one_t, +: ?+?{} */
-    .labels: { "Zero", "One", "Two", "Three", ...},
-    .length: /* number of enumerators */
-};
-\end{lstlisting}
-\CFA stores values as intermediate expressions because the result of the function call to the function $?+?{}(T\&, T\&)$ is statically unknown to \CFA. But the result will be computed in run time, and the compiler ensures the $values$ will not be changed.
+	.values: { 0, 0+1, 0+1+1, 0+1+1+1, ... }, /* 0: zero_t, 1: one_t, +: ?+?{} */
+	.labels: { "Zero", "One", "Two", "Three", ...},
+	.length: /* number of enumerators */
+};
+\end{lstlisting}
+\CFA stores values as intermediate expressions because the result of the function call to the function @?+?{}(T&, T&)@ is statically unknown to \CFA.
+But the result is computed at run time, and the compiler ensures the @values@ are not changed.
 
 \subsection{qualified expression}
+
 \CFA uses qualified expression to address the scoping of \CFA-enumeration. 
 \begin{lstlisting}[label=lst:qualified_expression]
 aggregation_name.field;
 \end{lstlisting}
-The qualified expression is not dedicated to \CFA enumeration. It is a feature that is supported by other aggregation in \CFA as well, including a C enumeration. When C enumerations are unscoped, the qualified expression syntax still helps to disambiguate names in the context. \CFA recognizes if the expression references a \CFA aggregation by searching the presence of $aggregation\_name$ in the \CFA enumeration table. If the $aggregation\_name$ is identified as a \CFA enumeration, the compiler checks if $field$ presents in the declared \CFA enumeration.
-
-\subsection{with statement/statement}
-@Working 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.
-
-\subsection{instance declaration}
-@Working in Progress@
+The qualified expression is not dedicated to \CFA enumeration.
+It is a feature that is supported by other aggregation in \CFA as well, including a C enumeration.
+When C enumerations are unscoped, the qualified expression syntax still helps to disambiguate names in the context.
+\CFA recognizes if the expression references a \CFA aggregation by searching the presence of @aggregation_name@ in the \CFA enumeration table.
+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}
+
+\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.
+
+\subsection{Instance Declaration}
+
+\emph{Work in Progress}
+
 \begin{lstlisting}[label=lst:declaration]
 enum Sample s1;
 Sample s2;
 \end{lstlisting}
-A declaration of \CFA enumeration instance that has no difference than a C enumeration or other \CFA aggregation. The compiler recognizes the type of a variable declaration by searching the name in all possible types. The \textit{enum} keyword is not necessary but helps to disambiguate types (questionable). The generated code for a \CFA enumeration declaration is utterly an integer, which is meant to store the position.
+A declaration of \CFA enumeration instance that has no difference than a C enumeration or other \CFA aggregation.
+The compiler recognizes the type of a variable declaration by searching the name in all possible types.
+The @enum@ keyword is not necessary but helps to disambiguate types (questionable).
+The generated code for a \CFA enumeration declaration is utterly an integer, which is meant to store the position.
 \begin{lstlisting}[label=lst:declaration]
 int s1;
@@ -418,79 +465,83 @@
 
 \subsection{Compiler Representation}
-@Working in Progress@
-
-The internal representation of an enumeration constant is \textit{EnumInstType}. The minimum information an \textit{EnumInstType} stores is a reference to the \CFA-enumeration declaration and the position of the enumeration constant.
+
+\emph{Work in Progress}
+
+The internal representation of an enumeration constant is @EnumInstType@.
+The minimum information an @EnumInstType@ stores is a reference to the \CFA-enumeration declaration and the position of the enumeration constant.
 \begin{lstlisting}[label=lst:EnumInstType]
 class EnumInstType {
-    EnumDecl enumDecl;
-    int position;
-};
-\end{lstlisting}
-
-
-\subsection{unification and resolution }
-@Working in Progress@
+	EnumDecl enumDecl;
+	int position;
+};
+\end{lstlisting}
+
+\subsection{Unification and Resolution }
+
+\emph{Work in Progress}
 
 \begin{lstlisting}
 enum Colour( char * ) { Red = "R", Green = "G", Blue = "B"  };
 \end{lstlisting}
-The EnumInstType is convertible to other types. A \CFA enumeration expression is implicitly "overloaded" with its three different attributes: value, position, and label. The \CFA compilers need to resolve an EnumInstType as one of its attributes based on the current context. 
+The @EnumInstType@ is convertible to other types.
+A \CFA enumeration expression is implicitly \emph{overloaded} with its three different attributes: value, position, and label.
+The \CFA compilers need to resolve an @EnumInstType@ as one of its attributes based on the current context. 
 
 \begin{lstlisting}[caption={Null Context}, label=lst:null_context]
 {
-    Colour.Green;
-}
-\end{lstlisting}
-In the example~\ref{lst:null_context}, the environment gives no information to help with the resolution of $Colour.Green$. In this case, any of the attributes is resolvable. According to the \textit{precedence rule}, the expression with EnumInstType will be resolved as $value( Colour.Green )$. The EnumInstType is converted to the type of the value, which is statically known to the compiler as char *. When the compilation reaches the code generation, the compiler outputs code for type char * with the value "G".
+	Colour.Green;
+}
+\end{lstlisting}
+In example~\ref{lst:null_context}, the environment gives no information to help with the resolution of @Colour.Green@.
+In this case, any of the attributes is resolvable.
+According to the \textit{precedence rule}, the expression with @EnumInstType@ resolves as @value( Colour.Green )@.
+The @EnumInstType@ is converted to the type of the value, which is statically known to the compiler as @char *@.
+When the compilation reaches the code generation, the compiler outputs code for type @char *@ with the value @"G"@.
 \begin{lstlisting}[caption={Null Context Generated Code}, label=lst:null_context]
 {
-    "G";
-}
-\end{lstlisting}
-
- 
+	"G";
+}
+\end{lstlisting}
 \begin{lstlisting}[caption={int Context}, label=lst:int_context]
 {
-    int g = Colour.Green;
-}
-\end{lstlisting}
-
-The assignment expression gives a context for the EnumInstType resolution. The EnumInstType is used as an int, and \CFA needs to determine which of the attributes can be resolved as an int type.
-The functions $Unify( T1, T2 ): bool$ take two types as parameters and determine if one type can be used as another. In the example\ref{lst:int_context} example, the compiler is trying to unify int and EnumInstType of Colour.
-$$Unification( int, EnumInstType<Colour> )$$
-which turns into three Unification call
+	int g = Colour.Green;
+}
+\end{lstlisting}
+The assignment expression gives a context for the EnumInstType resolution.
+The EnumInstType is used as an @int@, and \CFA needs to determine which of the attributes can be resolved as an @int@ type.
+The functions $Unify( T1, T2 ): bool$ take two types as parameters and determine if one type can be used as another.
+In example~\ref{lst:int_context}, the compiler is trying to unify @int@ and @EnumInstType@ of @Colour@.
+$$Unification( int, EnumInstType<Colour> )$$ which turns into three Unification call
 \begin{lstlisting}[label=lst:attr_resolution_1]
 {
-    Unify( int, char * ); // unify with the type of value
-    Unify( int, int ); // unify with the type of position
-    Unify( int, char * ); // unify with the type of label
-}
-\end{lstlisting}
-
+	Unify( int, char * ); // unify with the type of value
+	Unify( int, int ); // unify with the type of position
+	Unify( int, char * ); // unify with the type of label
+}
+\end{lstlisting}
 \begin{lstlisting}[label=lst:attr_resolution_precedence]
 {
-    Unification( T1, EnumInstType<T2> ) {
-        if ( Unify( T1, T2 ) ) return T2;
-        if ( Unify( T1, int ) ) return int;
-        if ( Unify( T1, char * ) ) return char *;
-        Error: Cannot Unify T1 with EnumInstType<T2>;
-    }
-}
-\end{lstlisting}
-After the unification, EnumInstType will be replaced by its attributes.
+	Unification( T1, EnumInstType<T2> ) {
+		if ( Unify( T1, T2 ) ) return T2;
+		if ( Unify( T1, int ) ) return int;
+		if ( Unify( T1, char * ) ) return char *;
+		Error: Cannot Unify T1 with EnumInstType<T2>;
+	}
+}
+\end{lstlisting}
+After the unification, @EnumInstType@ is replaced by its attributes.
 
 \begin{lstlisting}[caption={Unification Functions}, label=lst:unification_func_call]
 {
-    T2 foo ( T1 ); // function take variable with T1 as a parameter
-    foo( EnumInstType<T3> ); // Call foo with a variable has type EnumInstType<T3>
-    >>>> Unification( T1, EnumInstType<T3> )
-}
-\end{lstlisting}
-
+	T2 foo ( T1 ); // function take variable with T1 as a parameter
+	foo( EnumInstType<T3> ); // Call foo with a variable has type EnumInstType<T3>
+	>>>> Unification( T1, EnumInstType<T3> )
+}
+\end{lstlisting}
 % The conversion can work backward: in restrictive cases, attributes of can be implicitly converted back to the EnumInstType. 
 Backward conversion:
 \begin{lstlisting}[caption={Unification Functions}, label=lst:unification_func_call]
 {
-    enum Colour colour = 1;
+	enum Colour colour = 1;
 }
 \end{lstlisting}
@@ -501,5 +552,6 @@
 }
 \end{lstlisting}
-int can be unified with the label of Colour. "5" is a constant expression -> Compiler knows the value during the compilation -> turns it into 
+@int@ can be unified with the label of Colour.
+@5@ is a constant expression $\Rightarrow$ Compiler knows the value during the compilation $\Rightarrow$ turns it into 
 \begin{lstlisting}
 {
@@ -508,20 +560,28 @@
 \end{lstlisting}
 Steps:
-1: identify "1" as a constant expression with type int, and the value is statically known as 1
-2. unification( EnumInstType<Colour>, int ): position( EnumInstType< Colour > )
-3. return the enumeration constant at the position 1
-
+\begin{enumerate}
+\item
+identify @1@ as a constant expression with type @int@, and the value is statically known as @1@
+\item
+@unification( EnumInstType<Colour>, int )@: @position( EnumInstType< Colour > )@
+\item
+return the enumeration constant at the position 1
+\end{enumerate}
 \begin{lstlisting}
 {
-    enum T (int) { ... } // Declaration
-    enum T t = 1; 
+	enum T (int) { ... } // Declaration
+	enum T t = 1; 
 }
 \end{lstlisting}
 Steps:
-1: identify "1" as a constant expression with type int, and the value is statically known as 1
-2. unification( EnumInstType<Colour>, int ): value( EnumInstType< Colour > )
-3. return the FIRST enumeration constant that has the value 1, by searching through the values array
-
-The downside of the precedence rule: EnumInstType -> int ( value ) -> EnumInstType may return a different EnumInstType because the value can be repeated and there is no way to know which one is expected -> want uniqueness 
+\begin{enumerate}
+\item
+identify @1@ as a constant expression with type @int@, and the value is statically known as @1@
+\item
+@unification( EnumInstType<Colour>, int )@: @value( EnumInstType< Colour > )@
+\item
+return the FIRST enumeration constant that has the value 1, by searching through the values array
+\end{enumerate}
+The downside of the precedence rule: @EnumInstType@ $\Rightarrow$ @int ( value )@ $\Rightarrow$ @EnumInstType@ may return a different @EnumInstType@ because the value can be repeated and there is no way to know which one is expected $\Rightarrow$ want uniqueness 
 
 \end{document}
