[svn] r7615: nemerle/trunk/ncc/typing/TyVar.n

malekith svnadmin at nemerle.org
Mon Apr 23 18:15:41 CEST 2007


Log:
More comments.

Author: malekith
Date: Mon Apr 23 18:15:40 2007
New Revision: 7615

Modified:
   nemerle/trunk/ncc/typing/TyVar.n

Modified: nemerle/trunk/ncc/typing/TyVar.n
==============================================================================
--- nemerle/trunk/ncc/typing/TyVar.n	(original)
+++ nemerle/trunk/ncc/typing/TyVar.n	Mon Apr 23 18:15:40 2007
@@ -45,7 +45,25 @@
 namespace Nemerle.Compiler 
 {
   /** Represents a node in constraint graph. Used during type
-      inference. */
+      inference.
+
+      Each node in the constraint graph (TyVar) can have an upper_bound
+      and lower_bound , expressed in terms of a MType. It can also have
+      links up (upper_tyvars) and down (lower_tyvars) to other nodes
+      in the constraint graph. We are interested in finding a solution,
+      that assigns a MType (m) to each TyVar, such that upper_bound <:
+      m, m <: lower_bound, and for each t in upper_tyvars, t <: m,
+      and for each t in lower_tyvars, m <: t.
+
+      Such a solution is found by the Fixate() function, by taking
+      upper_bound (if defined), lower_bound (if defined) or System.Object
+      (if neither is defined).
+
+      The data structure maintains invariant that this is indeed the
+      correct solution (by transitively closing upper/lower_bound
+      when new upper/lower_tyvars are added, and propagating
+      changes in upper/lower_bound to upper/lower_tyvars).
+    */
   [ManagerAccess]
   public class TyVar : System.IComparable [TyVar]
   {



More information about the svn mailing list