Properties of Relations

Below is the code we used in class. In the cslab, it can also be found in /cslab/class/cs243/closures.ml.

val immediatelyPrecede =
  [(Reuben, Simeon), (Simeon, Judah), (Judah, Issachar), (Issachar, Zebulun)];


fun transitiveClosure(relation) =
  if isTransitive(relation) 
  then relation
  else transitiveClosure(relation @ makeNoRepeats(counterTransitive(relation)))

Thomas VanDrunen
Last modified: Fri Nov 2 10:55:21 CDT 2007