Exemplo n.º 1
0
 public static bool HasSubSetOf(this List <AttributeList> list, AttributeList attrs)
 {
     foreach (var a in list)
     {
         if (attrs.Contains(a) && a.Count < attrs.Count)
         {
             return(true);
         }
     }
     return(false);
 }
        public static AttributeList ComputeClosure(
            AttributeList attr, List <FunctionalDependency> fdList)
        {
            var size   = 0;
            var result = new AttributeList(attr);

            do
            {
                size = result.Count;
                foreach (var fd in fdList)
                {
                    if (result.Contains(fd.LeftHandSide))
                    {
                        result.Add(fd.RightHandSide);
                    }
                }
            } while (size != result.Count);

            return(result);
        }