Index: doc/theses/jiada_liang_MMath/conclusion.tex
===================================================================
--- doc/theses/jiada_liang_MMath/conclusion.tex	(revision dcfcf368f79594eb9cffea05e52b6e6ca5967954)
+++ doc/theses/jiada_liang_MMath/conclusion.tex	(revision 17fdf6f6ed88bf5f9f491b7bf6839322f151fd58)
@@ -27,6 +27,7 @@
 Fixing some of these corner cases requires changes to the \CFA resolver or extensions to \CFA. %, like compile-time constant-expression evaluation.
 When these changes are made, it should be straightforward to update the \CFA enumeration implementation to work with them.
+
 \item
-Currently, some aspects of the enumeration trait system require explicitly including the file @enum.hfa@, which can lead to problems.
+Currently, some aspects of the enumeration trait system require explicitly including the file \lstinline[deletekeywords={enum}]{enum.hfa}, which can lead to problems.
 It should be possible to have this file included implicitly by updating the \CFA prelude.
 \item
@@ -35,4 +36,5 @@
 Enumerations may have to be modified to dovetail with these features.
 For example, enumerating with range loops does not align with the current iterator design, so some changes will be necessary.
+
 \item
 C already provides @const@-style aliasing using the \emph{unnamed} enumerator \see{\VRef{s:TypeName}}, even if the name @enum@ is misleading (@const@ would be better).
@@ -50,4 +52,5 @@
 enum( wchar_t * ) { Jack = L"John" };
 \end{cfa}
+
 \item
 Currently, enumeration scoping is all or nothing. In some cases, it might be useful to
@@ -61,114 +64,130 @@
 For @E2@, @A@, and @C@ are scoped; @B@ is unscoped.
 Finding a use case is important to justify this extension.
+
 \item
 An extension mentioned in \VRef{s:Ada} is using @typedef@ to create an enumerator alias.
 \begin{cfa}
-enum(int) RGB { @Red@, @Green@, Blue };
-enum(int) Traffic_Light { @Red@, Yellow, @Green@ };
+enum( int ) RGB { @Red@, @Green@, Blue };
+enum( int ) Traffic_Light { @Red@, Yellow, @Green@ };
 typedef RGB.Red OtherRed; // alias
 \end{cfa}
+
 \item
-Label arrays are auxiliary data structures that are always generated for \CFA enumeration, which is a considerable program overhead. 
-It is helpful to provide a new syntax or annotation for a \CFA enumeration definition that tells the compiler the labels will not be used 
-throughout the execution. Therefore, \CFA optimizes the label array away. The @label()@ function can still be used on an enumeration constant, 
-and the function called is reduced to a @char *@ constant expression that holds the name of the enumerator. But if @label()@ is called on 
-a variable with an enumerated type, it returns an empty string since the label information is lost for the runtime.
+Label and values arrays are auxiliary data structures that are always generated for \CFA enumeration, which is a program overhead when unused. 
+It might be possible to provide a new syntax or annotation for a \CFA enumeration definition indicating these arrays are not used.
+Therefore, \CFA does not generated them.
+@label@ can still be used on an enumeration constant, as the call reduces to a @char *@ constant expression that holds the name of the enumerator.
+But calls on an enumeration variable, generate a compile-time error.
+The best alternative is for the linker to discard these arrays if unused.
+
 \item
-\CFA enumeration has its limitation in separate compilation. Consider the followings example:
+The \CFA enumeration has limitations with separate compilation.
+Consider the following:
+\begin{cquote}
+\setlength{\tabcolsep}{20pt}
+\begin{tabular}{@{}ll@{}}
 \begin{cfa}
-// libvacodec.h: v1
-enum(int) C_Codec ! {
-    FIRST_VIDEO = 0,
-    VP8 = 2,
-    VP9 = 4,
-    LAST_VIDEO = 8,
+enum C_Codec {
+	FIRST_VIDEO = 0,
+	VP8 = 0,
+	VP9,
+	LAST_VIDEO,
 
-    FIRST_AUDIO = 3,
-    VORBIS = 9,
-    OPUS = 27,
-    LAST_AUDIO = 81
+	FIRST_AUDIO = 64,
+	VORBIS = 64,
+	OPUS,
+	LAST_AUDIO
 };
+\end{cfa}
+&
+\begin{cfa}
+enum( int ) CFA_Codec {
+	FIRST_VIDEO = 0,
+	VP8 = 0,
+	VP9,
+	LAST_VIDEO,
 
-enum(int) CFA_Codec ! {
-    FIRST_VIDEO = 0,
-    VP8 = 2,
-    VP9 = 4,
-    LAST_VIDEO = 8,
+	FIRST_AUDIO = 64,
+	VORBIS = 64,
+	OPUS,
+	LAST_AUDIO
+};
+\end{cfa}
+\\
+\begin{cfa}
+C_Codec c_code = OPUS;
+CFA_Codec cfa_code = OPUS;
+\end{cfa}
+\end{tabular}
+\end{cquote}
+@c_code@ has value 65, the integral value of @c_code.OPUS@, while @cfa_code@ has value 6, the position of @CFA_Codec.OPUS@.
 
-    FIRST_AUDIO = 3,
-    VORBIS = 9,
-    OPUS = 27,
-    LAST_AUDIO = 81
+If the enumerator @AV1@ is inserted in @C_Codec@ and @CFA_Codec@,
+\begin{cquote}
+\setlength{\tabcolsep}{20pt}
+\begin{tabular}{@{}ll@{}}
+\begin{cfa}
+enum C_Codec {
+	FIRST_VIDEO = 0,
+	VP8 = 0,
+	VP9,
+	@AV1@,
+	LAST_VIDEO,
+
+	FIRST_AUDIO = 64,
+	VORBIS = 64,
+	OPUS,
+	LAST_AUDIO
 };
+\end{cfa}
+&
+\begin{cfa}
+enum( int ) CFA_Codec {
+	FIRST_VIDEO = 0,
+	VP8 = 0,
+	VP9,
+	@AV1@,
+	LAST_VIDEO,
 
-// main.c
-C_Codec c_code = C_Codec.VORBIS;
-CFA_Codec cfa_code = CFA_Codec.VORBIS;
+	FIRST_AUDIO = 64,
+	VORBIS = 64,
+	OPUS,
+	LAST_AUDIO
+};
 \end{cfa}
-The memory location of @c_code@ stores a value 9, the integral value of VORBIS. 
-The memory of @cfa_code@ stores 5, which is the position of @CFA_Codec.VORBIS@ and can be mapped to value 9.
+\end{tabular}
+\end{cquote}
+the assignments still result in @c_code@ with value 65, but @cfa_code@ is now 7.
+For \CFA, if all translation units including @CFA_Codec@ are not recompiled, some could assign the old 6 and some the new 7, while partially compiled C translation units all continue to assign 65.
 
-If to insert a new enumerator in both @C_Codec@ and @CFA_Codec@ 
-before the relative position of VORBIS, without a re-compilation of @main.c@, variable @cfa_code@ would be mapped 
-to an unintented value.
+For \CFA to achieve the same behaviour for positions as C does with value for partial recompilation, enumeration positions could be represented as @const@ declarations with corresponding @extern@ declarations in the include file.
+\begin{cquote}
+\setlength{\tabcolsep}{20pt}
+\begin{tabular}{@{}ll@{}}
 \begin{cfa}
-// libvacodec.h: v2
-enum(int) C_Codec ! {
-    FIRST_VIDEO = 0,
-    VP8 = 2,
-    VP9 = 4,
-    @AV1@,
-    LAST_VIDEO = 8,
+const int FIRST_VIDEO_posn = 0;
+const int VP8_posn = 1;
+const int VP9_posn = 2;
 
-    FIRST_AUDIO = 3,
-    VORBIS = 9,
-    OPUS = 27,
-    LAST_AUDIO = 81
-};
-
-enum(int) CFA_Codec ! {
-    FIRST_VIDEO = 0,
-    VP8 = 2,
-    VP9 = 4,
-    @AV1@,
-    LAST_VIDEO = 8,
-
-    FIRST_AUDIO = 3,
-    VORBIS = 9,
-    OPUS = 27,
-    LAST_AUDIO = 81
-};
-
+const int LAST_VIDEO_posn = 3;
+const int FIRST_AUDIO_posn = 4;
+const int VORBIS_posn = 5;
+const int OPUS_posn = 6;
+const int LAST_AUDIO_posn = 7;
 \end{cfa}
-While @c_code@ still has the correct value of 9, @cfa_code@ (5) is now mapped to @First_AUDIO@. In other words, it is 
-necessary to to recompile @main.c@ when to update @libvacodec.h@. 
-
-To avoid a recompilation, enumeration positions can be represented as @extern const@. For example, \CFA-cc can generate the following code for @CFA_Codec@: 
-\begin{cfa}
-// CFA-cc transpile: libvacodec.h
-const int FIRST_VIDEO = 0;
-const int VP8 = 1;
-const int VP9 = 2;
-const int LAST_VIDEO = 3;
-const int FIRST_AUDIO = 4;
-const int VORBIS = 5;
-const int OPUS = 6;
-const int LAST_AUDIO = 7;
-
-// CFA-cc transpile: main.c
-extern const int FIRST_VIDEO;
-extern const int VP8;
-extern const int VP9;
-extern const int LAST_VIDEO;
-extern const int FIRST_AUDIO;
-extern const int VORBIS;
-extern const int OPUS;
-extern const int LAST_AUDIO;
-
-int cfa_code = VORBIS;
+&\begin{cfa}
+const int FIRST_VIDEO_posn = 0;
+const int VP8_posn = 1;
+const int VP9_posn = 2;
+const int AV1_posn = 3;
+const int LAST_VIDEO_posn = 4;
+const int FIRST_AUDIO_posn = 5;
+const int VORBIS_posn = 6;
+const int OPUS_posn = 7;
+const int LAST_AUDIO_posn = 8;
 \end{cfa}
-If later a position of an enumerator is changed, the generated expression @int cfa_code = VORBIS;@ will still have the correct 
-value, because it is linked to a external constant @VORBIS@ from @libvacodec.h@. This implementation requires extra memory to store position, but 
-solve the separate compilation problem. 
-
+\end{tabular}
+\end{cquote}
+Then the linker always uses the most recent object file with the up-to-date positions.
+However, this implementation means the equivalent of a position array is generated using more storage.
 \end{enumerate}
