Index: doc/theses/fangren_yu_MMath/background.tex
===================================================================
--- doc/theses/fangren_yu_MMath/background.tex	(revision 2572addbb8aee3c5431c49eb112bb76eed2c97b2)
+++ doc/theses/fangren_yu_MMath/background.tex	(revision 51b72bf5e7f607988a82979a430dd2c50753063c)
@@ -1,5 +1,3 @@
 \chapter{Background}
-
-\cite{Melo17} \cite{Odersky01} \cite{Pierce00}
 
 \section{Polymorphism}
Index: doc/theses/fangren_yu_MMath/resolution.tex
===================================================================
--- doc/theses/fangren_yu_MMath/resolution.tex	(revision 2572addbb8aee3c5431c49eb112bb76eed2c97b2)
+++ doc/theses/fangren_yu_MMath/resolution.tex	(revision 51b72bf5e7f607988a82979a430dd2c50753063c)
@@ -626,2 +626,16 @@
 \end{cfa}
 forces the desired type binding, since the cast only compiles when the expression type matches exactly with the target.
+
+\section{Related Work}
+
+\CFA expression resolution may deal with extensive overloading and inference of polymorphic types with assertions, and we want to keep the base algorithm used in type unification simple enough so that resolving a complicated expression can still be done reasonably fast.
+In this section, we look at some related work that handles the aforementioned bidirectional subtyping relations concisely.
+
+Melo, et. al.~\cite{Melo17} developed PsycheC, a tool built for inferencing missing type and variable declarations of incomplete C programs, which can also be viewed as a dialect of C with type inferencing. As PsycheC is built for analyzing standard C programs, it does not have any kind of overloading or polymorphism. Instead, all top-level variables and function parameters may have indeterminate types. The scope of the problem PsycheC deals with is quite the opposite of that in \CFA, but the techniques used to solve for the unknown types are similar. 
+In PsycheC, a unification variable is assigned to every identifier with unknown type, and each use of a variable generates a constraint on its type. Just like in \CFA, the most common kinds of expression contexts PsycheC deals with are assignments and function calls, which creates inequality constraints: the right hand side of the assignment is a subtype of the left hand side; function argument passing is treated the same as assignment. Since both sides of the inequality can have unknown types, type resolution needs to handle both upper bound and lower bound constraints. 
+Instead of directly solving with lower and upper bounds, the authors developed a two-phase unification algorithm where the equivalences are first resolved and substituted into the inequalities, and showed that by ordering the inequalities using the partial order of concrete types involved, a second pass of unification treating inequalities as equivalences will be sufficient to resolve all type variables.
+Note that, however, PsycheC does not consider the hierarchy of arithmetic types, as they are all mutually convertible in C and therefore considered "equivalent" in unification, and it also lacks structured types except simple pointers, meaning this strategy of unifying subtypes as equivalences will not work in a more general setting such as in \CFA. 
+
+Pierce and Turner~\cite{Pierce00} presented a \textit{local} type inference method that restricts the propagation of types and use of unification variables within adjacent syntax tree nodes. The technique is developed to provide sufficient type checking and inference in the ML family of languages. Odersky, Zenger and Zenger~\cite{Odersky01} refined their method by introducing a colored type system which distinguishes inherited types (given directly by context) and synthesized types (deducted from the term itself), to handle bidirectional type propagation in a more concise manner. 
+Their algorithms are designed for functional programming, where first-class (untyped) lambda expressions are common and type inference must also deduce the argument types of lambdas, and hence bidirectional inference must be supported. 
+Given that \CFA does not have lambda expressions, and the rest of type inference cases are quite similar, implementing this type inference algorithm for \CFA expression resolution might be promising. Moreover, the current \CFA implementation also keeps unification variables \textit{almost} local, with the exception that whenever a type variable does not appear in the parameter list and therefore cannot be given a value by the argument types, it is passed upwards as a free variable. In all other cases, the substituted minimal types are passed upwards as the result types. This means that the current implementation of \CFA expression resolution semantically agrees with Pierce's type inference system in most of the cases. A question remains whether these methods can be adapted to handle \CFA assertion resolution.
