Index: doc/theses/jiada_liang_MMath/relatedwork.tex
===================================================================
--- doc/theses/jiada_liang_MMath/relatedwork.tex	(revision 486caad7c0e53d562d8675ebf6836c087eaa427b)
+++ doc/theses/jiada_liang_MMath/relatedwork.tex	(revision d734fa163c9d26bc71c1c73b4619ec33417506ca)
@@ -2215,7 +2215,12 @@
 
 % https://ocaml.org/docs/basic-data-types#enumerated-data-types
+% https://dev.realworldocaml.org/runtime-memory-layout.html
 
 OCaml provides a variant (union) type, where multiple heterogeneously-typed objects share the same storage.
 The simplest form of the variant type is a list of nullary datatype constructors, which is like an unscoped, pure enumeration.
+
+(I think the value of a ocaml variants are types not object, so I am not sure about this line)
+OCaml provides a variant (union) type, which is an aggregation of heterogeneous types.
+A basic variant is a list of nullary datatype constructors, which is like an unscoped, pure enumeration. 
 \begin{ocaml}
 type weekday = Mon | Tue | Wed | Thu | Fri | Sat | Sun
@@ -2230,5 +2235,6 @@
 @CS442@
 \end{ocaml}
-The only operations are binding and pattern matching (equality), where the variant name is logically the implementation tag stored in the union for discriminating the vale in the object storage.
+The only operations are binding and pattern matching (equality), where the variant name is logically the implementation tag stored in the union for discriminating the value in the object storage.
+OCaml compile store tags as ascending int, starting from 0. Variants @Mon@ to @Sun@ are stored as int value 0 to 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.
@@ -2240,4 +2246,5 @@
 type colour = Red | Green of @string@ | Blue of @int * float@
 \end{ocaml}
+A variant with parameter is stored in a memory block, prefixed by an int tag and has its parameters stores as words in the block. 
 @colour@ is a summation of a nullary type, a unary product type of @string@, and a cross product of @int@ and @float@.
 (Mathematically, a @Blue@ value is a Cartesian product of the types @int@ type and @float@.)
@@ -2252,4 +2259,5 @@
 @Red, abc, 1 1.5@
 \end{ocaml}
+
 
 A variant type can have a recursive definition.
