Index: doc/theses/jiada_liang_MMath/conclusion.tex
===================================================================
--- doc/theses/jiada_liang_MMath/conclusion.tex	(revision b0069a30901fd809ec219ff7ac4592aff6c44ac1)
+++ doc/theses/jiada_liang_MMath/conclusion.tex	(revision a8f44c83c718e40d2e0e570f7ed20e3d0093f30b)
@@ -4,5 +4,5 @@
 The goal of this work is to extend the simple and unsafe enumeration type in the C programming-language into a complex and safe enumeration type in the \CFA programming-language, while maintaining backwards compatibility with C.
 Within this goal, the new \CFA enumeration should align with the analogous enumeration features in other languages to match modern programming expectations.
-Hence, the \CFA enumeration features are burrowed from a number of programming languages, but engineered to work and play with \CFA's type system and feature set.
+Hence, the \CFA enumeration features are borrowed from a number of programming languages, but engineered to work and play with \CFA's type system and feature set.
 
 Additional safety is provided by strong type-checking of enumeration initialization and assignment, ensuring an enumeration only contains its enumerators.
@@ -42,2 +42,4 @@
 enum( wchar_t * ) { Jack = L"John" };
 \end{cfa}
+The enumerating feature was developed in parallel with the \CFA iterator. In the forseeable future when iterator come to matuity, \CFA enumeration can adapt iterator-related traits and 
+be rewritten with iterator. 
Index: doc/theses/jiada_liang_MMath/relatedwork.tex
===================================================================
--- doc/theses/jiada_liang_MMath/relatedwork.tex	(revision b0069a30901fd809ec219ff7ac4592aff6c44ac1)
+++ doc/theses/jiada_liang_MMath/relatedwork.tex	(revision a8f44c83c718e40d2e0e570f7ed20e3d0093f30b)
@@ -150,5 +150,5 @@
 
 The underlying type is an implementation-defined integral-type large enough to hold all enumerated values; it does not have to be the smallest possible type.
-The integral size can be explicitly specified using compiler directive @$PACKENUM@~$N$, where $N$ is the number of bytes, \eg:
+The integral size can be explicitly specified using compiler directive \$@PACKENUM@~$N$, where $N$ is the number of bytes, \eg:
 \begin{pascal}
 Type @{$\color{red}\$$PACKENUM 1}@ SmallEnum = ( one, two, three );
@@ -167,5 +167,5 @@
 \end{ada}
 Object initialization and assignment are restricted to the enumerators of this type.
-While Ada enumerators are unscoped, like C, Ada enumerators are overloadable.
+While Ada enumerators are unscoped, Ada enumerators are overloadable.
 \begin{ada}
 type RGB is ( @Red@, @Green@, Blue );
@@ -438,5 +438,7 @@
 \end{tabular}
 \end{cquote}
-However, there is no mechanism to iterate through an enumeration without an unsafe cast and it does not understand the enumerator values.
+% However, there is no mechanism to iterate through an enumeration without an unsafe cast and it does not understand the enumerator values.
+\CC enumerators are not relational: the only comparator defined for \CC is the value comparison. The define order of enumerator has no 
+impact on its behaviour. As a consequnce, \CC has no meaningful enumerating mechanism. 
 \begin{c++}
 enum Week { Mon, Tue, Wed, Thu = 10, Fri, Sat, Sun };
@@ -444,4 +446,7 @@
 0 1 2 @3 4 5 6 7 8 9@ 10 11 12 13
 \end{c++}
+An approximation of enumerating an enum in \CC is to use the last enumerator value as a range. But it inevitably
+fails the enumeration value does not assemble auto-initialization. 
+
 An enumeration type cannot declare an array dimension but an enumerator can be used as a subscript.
 There is no mechanism to subtype or inherit from an enumeration.
@@ -457,8 +462,8 @@
 \Csharp is a dynamically-typed programming-language with a scoped, integral enumeration similar to \CC \lstinline[language=C++]{enum class}.
 \begin{csharp}
-enum Week : @long@ { Mon, Tue, Wed, Thu@ = 10@, Fri, Sat, Sun@,@ } // terminating comma
+enum Week : @long@ { Mon, Tue, Wed, Thu@ = 10@, Fri, Sat, Sun }
 enum RGB { Red, Green, Blue }
 \end{csharp}
-The default underlying integral type is @int@ (no @char@), with auto-incrementing, implicit/explicit initialization, and terminating comma.
+The default underlying integral type is @int@ (no @char@), with auto-incrementing, implicit/explicit initialization.
 A method cannot be defined in an enumeration type (extension methods are possible).
 There is an explicit bidirectional conversion between an enumeration and its integral type, and an implicit conversion to the enumerator label in display contexts.
@@ -471,8 +476,19 @@
 Console.WriteLine( Week.Fri );		$\C{// print label Fri}$
 \end{csharp}
-The majority of the integral operators (relational and arithmetic) work with enumerations, except @*@ and @/@.
+% The majority of the integral operators (relational and arithmetic) work with enumerations, except @*@ and @/@.
+% Relational and arithmetic operators are defined in terms of its numeric value only. 
+% Therefore, enumerators are not ordered and not enumerable like \CC.
+Like \CC, \Csharp defines enumeration relational and arithemtic operators in terms of value.
+Enumerators has no defined positional meaning.
 \begin{csharp}
 day = day++ - 5;					$\C{// unsafe}$
 day = day & day;
+\end{csharp}
+
+\begin{csharp}
+for ( Week d = Mon; d <= Sun; @d += 1@ ) {
+	Console.Write( d + " " );
+}
+Mon Tue Wed @3 4 5 6 7 8 9@ Thu Fri Sat Sun
 \end{csharp}
 
@@ -502,12 +518,6 @@
 \end{tabular}
 \end{cquote}
-However, there is no mechanism to iterate through an enumeration without an unsafe cast to increment and positions versus values is not handled.
-\begin{csharp}
-for ( Week d = Mon; d <= Sun; @d += 1@ ) {
-	Console.Write( d + " " );
-}
-Mon Tue Wed @3 4 5 6 7 8 9@ Thu Fri Sat Sun
-\end{csharp}
-The @Enum.GetValues@ pseudo-method retrieves an array of the enumeration constants for looping over an enumeration type or variable (expensive operation).
+
+As a compliment, \Csharp's Enum library has @Enum.GetValues@ pseudo-method that retrieves an array of the enumeration constants for looping over an enumeration type or variable (expensive operation).
 \begin{csharp}
 foreach ( Week d in @Enum.GetValues@( typeof(Week) ) ) {
@@ -782,5 +792,5 @@
 #[repr(u8)]
 enum ADT {
-	I(isize) @= 5@,  // ???
+	I(isize) @= 5@,
 	F(f64) @= 10@,
 	S(S) @= 0@,
@@ -1288,5 +1298,9 @@
 As seen, a type tag can be used in the @if@ and \lstinline[language=ocaml]{match} statements, where \lstinline[language=ocaml]{match} must be exhaustive or have a default case.
 
-Enumerating is accomplished by deriving from @enumerate@.
+% Enumerating is accomplished by deriving from @enumerate@.
+OCaml enumerators has an ordering following the definition order, but they are not enumerable.
+To iterate over all enumerators, an OCaml type needs to derive @enumerate@ proprocessor, which appends a list of all enumerators to the program 
+abstract syntax tree (AST). The list of value may not persist the define ordering. Given that it needs tools that is outside of the native language to facilate, 
+we claim it has no capability of enumerating.
 
 Enumeration subtyping is allowed but inheritance is restricted to classes not types.
@@ -1529,36 +1543,50 @@
 \newcommand{\CM}{\checkmark}
 \begin{tabular}{r|c|c|c|c|c|c|c|c|c|c|c|c|c}
-				&Pascal	& Ada	&\Csharp& OCaml	& Java	&Modula-3&Golang& Rust	& Swift	& Python& C		& \CC	& \CFA	\\
+				&Pascal	& Ada			&\Csharp   & OCaml & Java	&Golang& Rust		& Swift			& Python& C		& \CC	& \CFA	\\
 \hline
-@const@			& \CM	&		&		&		&		&		& \CM	&	  	&		&		&		& \CM	&		\\
+enum			&Dialect& \CM    		& \CM      & ADT  & \CM   & @const@&ADT/\CM	&ADT/\CM		& \CM   &\CM    &\CM   &\CM\\
 \hline
 \hline
-opaque			&		&		&		&		&		&		&		&	  	&		&		&		&		& \CM	\\
+opaque			& 		&				&		   & \CM   & \CM   &		&	  		& \CM   		&		&		&		& \CM	\\
 \hline
-typed			&		&		&		&		&		&		&		&	  	&		&		& @int@	& integral	& @T@	\\
+typed			&Int    & Int   		& Integral  & H     & U    & H     & U/H        & U/H           & H	    & Int	& Integral& U	\\
 \hline
-safe			&		&		&		&		&		&		&		&	  	&		&		&		& \CM	& \CM	\\
+safety          & \CM   & \CM   		&          & \CM 	& \CM   &		& \CM  		& \CM    		&		&		& \CM	& \CM	\\
 \hline
-ordered			&		&		&		&		&		&		&		&	  	&		&		& \CM	& \CM	& \CM	\\
+posn ordered	& \CM   & \CM   		& \CM      & \CM   & \CM   &		&	  		& \CM   		&       & 	    &       & \CM	\\
 \hline
-dup. values		&		&		&		&		&		&		&		&	  	&		& alias	& \CM	& \CM	& \CM	\\
+unique values	& \CM   &				& \CM      &		& \CM   & \CM   &	  		& \CM   		& alias	& \CM	& \CM	& \CM	\\
 \hline
-setable			&		&		&		&		&		&		&		&	  	&		&		& \CM	& \CM	& \CM	\\
+% setable	repr.	& \CM   & \CM   		& \CM      &		& \CM   & \CM   & \CM   	& \CM   		& \CM   & \CM	& \CM	& \CM	\\
+% \hline
+auto-init		& \CM   & @all or none@   & \CM      &       &       & \CM   & \CM   	& \CM   		   & \CM   & \CM	& \CM	& \CM	\\
+% This one is tricky: C/C++/CC has auto-init value. Some have auto-init underlying representation
 \hline
-auto-init		&		&		&		&		&		&		&		&	  	&		&		& \CM	& \CM	& \CM	\\
+(Un)Scoped		& U 	& U     		& S        & S      & S 	& U 	& S 		& S 			& S 	& U		& U/S	& U/S	\\
 \hline
-(Un)Scoped		&		&		&		&		&		&		&		&	  	&		&		& U		& U/S	& U/S	\\
+overload 		&		& \CM			& n/a	    & n/a 	&n/a    &		& n/a		& n/a			&n/a	&		&   	& \CM	\\
 \hline
-overload		&		& \CM	&		&		&		&		&		&	  	&		&		&		& \CM	& \CM	\\
+loop			& \CM 	& \CM 			&		   &		&		&		&	  		&		        & \CM	&		&		& \CM	\\
 \hline
-switch			&		&		&		&		&		&		&		&	  	&		&		& \CM	& \CM	& \CM	\\
+% array/subscript	&		&		&		&				&		&		&	  	&		&		& \CM	&		& \CM	\\
+% \hline
+subset			& \CM   & \CM    		&         & \CM     &		&		&	  		&		        &		&		&		& \CM	\\
 \hline
-loop			&		&		&		&		&		&		&		&	  	&		&		&		&		& \CM	\\
-\hline
-array/subscript	&		&		&		&		&		&		&		&	  	&		&		& \CM	&		& \CM	\\
-\hline
-subtype			&		&		&		&		&		&		&		&	  	&		&		&		&		& \CM	\\
-\hline
-inheritance		&		&		&		&		&		&		&		&	  	&		&		&		&		& \CM	\\
+superset		&		&				&		  &		    &		&		&	  		&               &		&		&		& \CM	\\
 \end{tabular}
 \end{table}
+
+\begin{enumerate}
+\item Opaque: Language has opaque enum if its enumerator cannot be used as its underlying representation or its enum is implemented as ADT.
+\item Typed: The type of value. H: heterogeneous type; enumerators from the same enum need not be has the same type. 
+U: uni-type; enumerators must have the same type.
+\item Safe: A enumeration variable can only hold a value from its defined enumerators.
+\item Posn ordered: enumerators have defined ordering based on enuemrator declaration order.
+\item Unique value: enumerators must have unique value.
+\item Auto-init: Value are auto initializable.
+\item (Un)Scoped: U: unscoped enuemrators and does not need qualification; S: Scoped enumerators and requires qualification
+\item Overload: An enumerator label can be used without type qualification in a context where the label has defined by multiple enumerations
+\item Loop: Enumerate enum members without explicitly convert it to other data structures
+\item Subset: Name a subset of enumerator as a new type.
+\item Superset: Create a new enumeration that contain all enumerators from pre-defined enuemration.
+\end{enumerate}
