Exemple #1
0
        public SetDomain <T> Join(SetDomain <T> that, bool widening, out bool weaker)
        {
            if (this.set == that.set)
            {
                weaker = false;
                return(this);
            }
            if (IsBottom)
            {
                weaker = !that.IsBottom;
                return(that);
            }
            if (that.IsBottom || IsTop)
            {
                weaker = false;
                return(this);
            }
            if (that.IsTop)
            {
                weaker = !IsTop;
                return(that);
            }

            IImmutableSet <T> join = this.set.Intersect(that.set);

            weaker = join.Count < this.set.Count;
            return(new SetDomain <T> (join));
        }
Exemple #2
0
        public SetDomain <T> Join(SetDomain <T> that)
        {
            SetDomain <T> result;

            if (this.TryTrivialJoin(that, out result))
            {
                return(result);
            }

            return(new SetDomain <T> (set.Intersect(that.set)));
        }
Exemple #3
0
        public SetDomain <T> Meet(SetDomain <T> that)
        {
            SetDomain <T> result;

            if (this.TryTrivialMeet(that, out result))
            {
                return(result);
            }

            return(new SetDomain <T> (set.Union(that.set)));
        }
Exemple #4
0
        public bool LessEqual(SetDomain <T> that)
        {
            if (IsBottom)
            {
                return(true);
            }
            if (that.IsBottom)
            {
                return(false);
            }

            return(that.set.IsContainedIn(this.set));
        }
Exemple #5
0
        public SetDomain <T> Meet(SetDomain <T> that)
        {
            if (this.set == that.set || IsBottom || that.IsTop)
            {
                return(this);
            }
            if (that.IsBottom || IsTop)
            {
                return(that);
            }

            return(new SetDomain <T> (this.set.Union(that.set)));
        }
Exemple #6
0
        public SetDomain <T> Widen(SetDomain <T> that)
        {
            //no widening - finite lattice

            return(Join(that));
        }