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

            weaker = true;
            return(TopValue);
        }
Exemple #2
0
        public bool Equals(FlatDomain <T> that)
        {
            if (!this.IsNormal())
            {
                return(state == that.state);
            }

            return(that.IsNormal() && Value.Equals(that.Value));
        }
Exemple #3
0
		public bool LessEqual (FlatDomain<T> that)
		{
			if (that.IsTop || IsBottom)
				return true;
			if (IsTop || that.IsBottom)
				return false;

			//less equal means equality of values
			return this.Concrete.Equals (that.Concrete);
		}
Exemple #4
0
		public FlatDomain<T> Meet (FlatDomain<T> that)
		{
			if (IsTop || that.IsBottom)
				return that;
			if (that.IsTop || IsBottom)
				return this;
			if (this.Concrete.Equals (that.Concrete))
				return that;

			return BottomValue;
		}
Exemple #5
0
        public bool LessEqual(FlatDomain <T> that)
        {
            bool result;

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

            return(Value.Equals(that.Value));
        }
Exemple #6
0
        public FlatDomain <T> Meet(FlatDomain <T> that)
        {
            FlatDomain <T> result;

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

            return(Value.Equals(that.Value) ? this : BottomValue);
        }
Exemple #7
0
        public FlatDomain <T> Join(FlatDomain <T> that)
        {
            FlatDomain <T> result;

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

            // this and that must be normal here
            return(Value.Equals(that.Value) ? this : TopValue);
        }
Exemple #8
0
		public bool Equals (FlatDomain<T> that)
		{
			if (!this.IsNormal)
				return this._kind == that._kind;

			if (!that.IsNormal)
				return false;

			if (this.Concrete.Equals (that.Concrete))
				return true;

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

			weaker = true;
			return TopValue;
		}
Exemple #10
0
        public FlatDomain <T> Widen(FlatDomain <T> that)
        {
            // no widening - it's finite lattice

            return(Join(that));
        }