public static IEnumerable<Hypothesis> SmallestGeneralizers(IEnumerable<Hypothesis> generalBorder,
                                                            Example example,
                                                            Hypothesis h)
 {
     var generalized = h + example;
     yield return generalized;
 }
 public static IEnumerable<Hypothesis> SmallestSpecifiers(IEnumerable<Hypothesis> specificBorder,
                                                          Example example,
                                                          Hypothesis h)
 {
     if (h.Left <= example.X - 1) yield return new Hypothesis(h.Left, example.X - 1, h.Bottom, h.Top);
     if (example.X + 1 <= h.Right) yield return new Hypothesis(example.X + 1, h.Right, h.Bottom, h.Top);
     if (example.Y + 1 <= h.Top) yield return new Hypothesis(h.Left, h.Right, example.Y + 1, h.Top);
     if (h.Bottom <= example.Y - 1) yield return new Hypothesis(h.Left, h.Right, h.Bottom, example.Y - 1);
 }
 public bool Contains(Hypothesis h)
 {
     if (IsEmpty())
     {
         return false;
     }
     return h.IsEmpty() ||
            (
                (h.Left > Left || (float.IsInfinity(h.Left) && float.IsInfinity(Left))) &&
                (h.Right < Right || (float.IsInfinity(h.Right) && float.IsInfinity(Right))) &&
                (h.Bottom > Bottom || (float.IsInfinity(h.Bottom) && float.IsInfinity(Bottom))) &&
                (h.Top < Top || (float.IsInfinity(h.Top) && float.IsInfinity(Top)))
            );
 }