public IAbstractDomain /*!*/ Join(IAbstractDomain /*!*/ a)
        {
            IAbstractDomain /*!*/ result;

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

            Debug.Assert(a is SymbolicExpressionsAbstractDomain <Expression>, "Expecting an instance of SymbolicExpressionsAbstractDomain. Found " + a);
            //^ assert a is SymbolicExpressionsAbstractDomain<Expression>;

            SymbolicExpressionsAbstractDomain <Expression> right = a as SymbolicExpressionsAbstractDomain <Expression>;

            FunctionalAbstractDomain <Expression, FlatAbstractDomainWithComparer <Expression> > joinSymbolicExpressions =
                (FunctionalAbstractDomain <Expression, FlatAbstractDomainWithComparer <Expression> >) this.var2exp.Join(right.var2exp); // Join the symbolic expression bindings

            Debug.Assert(!joinSymbolicExpressions.IsBottom, "The join of two non-bottom expression environments cannot be bottom");
            //^ assert !joinSymbolicExpressions.IsBottom;

            /*
             * if (joinSymbolicExpressions.IsTop)
             * {
             *  return this.Top;
             * }
             * else
             * {*/
            return(new SymbolicExpressionsAbstractDomain <Expression>(joinSymbolicExpressions, this.decoder, this.encoder));
            //}
        }
        public IAbstractDomain /*!*/ Meet(IAbstractDomain /*!*/ a)
        {
            IAbstractDomain trivialMeet;

            if (AbstractDomainsHelper.TryTrivialMeet(this, a, out trivialMeet))
            {
                return(trivialMeet);
            }

            Debug.Assert(a is SymbolicExpressionsAbstractDomain <Expression>,
                         "Expecting an instance of SymbolicExpressionsAbstractDomain. Found " + a); //^ assert a is SymbolicExpressionsAbstractDomain<Expression>;

            SymbolicExpressionsAbstractDomain <Expression> right = a as SymbolicExpressionsAbstractDomain <Expression>;

            FunctionalAbstractDomain <Expression, FlatAbstractDomainWithComparer <Expression> > meetSymbolicExpressions =
                (FunctionalAbstractDomain <Expression, FlatAbstractDomainWithComparer <Expression> >) this.var2exp.Meet(right.var2exp); // Meet the symbolic expression bindings

            Debug.Assert(!meetSymbolicExpressions.IsTop, "The meet of two non-top expression environments cannot be top ");
            // ^ assert !joinSymbolicExpressions.IsTop;

            if (meetSymbolicExpressions.IsBottom)
            {
                return(this.Bottom);
            }
            else
            {
                return(new SymbolicExpressionsAbstractDomain <Expression>(meetSymbolicExpressions, this.decoder, this.encoder));
            }
        }
        /// <summary>
        /// Pointwise order
        /// </summary>
        public bool LessEqual(IAbstractDomain /*!*/ a)
        {
            bool result;

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

            Debug.Assert(a is SymbolicExpressionsAbstractDomain <Expression>
                         , "Expecting an instance of SymbolicExpressionsAbstractDomain. Found " + a); //^ assert a is SymbolicExpressionsAbstractDomain<Expression>;

            SymbolicExpressionsAbstractDomain <Expression> right = a as SymbolicExpressionsAbstractDomain <Expression>;

            return(this.var2exp.LessEqual(right.var2exp));    // We do not need to compare the free variables, as they are a consequence
        }
 private SymbolicExpressionsAbstractDomain(SymbolicExpressionsAbstractDomain <Expression> s)
 {
     this.decoder = s.decoder;
     this.encoder = s.encoder;
     this.var2exp = s.var2exp;
 }