Пример #1
0
        public NonRelationalValueAbstraction(
            DisInterval interval, SymbolicExpressionTracker <Variable, Expression> symbolicConditions,
            SetOfConstraints <Variable> equalities, SetOfConstraints <Variable> disequalities,
            SetOfConstraints <Variable> weakUpperBounds, SetOfConstraints <Variable> strictUpperBounds,
            SetOfConstraints <Variable> existential)
        {
            Contract.Requires(interval != null);
            Contract.Requires(symbolicConditions != null);
            Contract.Requires(disequalities != null);
            Contract.Requires(equalities != null);
            Contract.Requires(weakUpperBounds != null);
            Contract.Requires(strictUpperBounds != null);
            Contract.Requires(existential != null);

            disInterval             = interval;
            this.symbolicConditions = symbolicConditions;
            weaklyRelationalDomains = new SetOfConstraints <Variable>[WeaklyRelationalDomainsCount]
            {
                equalities,
                disequalities,
                weakUpperBounds,
                strictUpperBounds,
                existential
            };
        }
Пример #2
0
        public SymbolicExpressionTracker <Variable, Expression> Widening(SymbolicExpressionTracker <Variable, Expression> other)
        {
            Contract.Requires(other != null);
            Contract.Ensures(Contract.Result <SymbolicExpressionTracker <Variable, Expression> >() != null);

            return(this.Join(other));
        }
Пример #3
0
        public bool LessEqual(SymbolicExpressionTracker <Variable, Expression> other)
        {
            Contract.Requires(other != null);

            bool result;

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

            other = this.UnifySlackVariableWith(other);

            return(symbolicConditions.LessEqual(other.symbolicConditions));
        }
Пример #4
0
        private NonRelationalValueAbstraction(
            DisInterval interval, SymbolicExpressionTracker <Variable, Expression> symbolicConditions,
            SetOfConstraints <Variable>[] domains)
        {
            Contract.Requires(interval != null);
            Contract.Requires(symbolicConditions != null);
            Contract.Requires(domains != null);

            Contract.Requires(domains.Length == WeaklyRelationalDomainsCount);
            Contract.Requires(Contract.ForAll(domains, el => el != null));

            disInterval             = interval;
            this.symbolicConditions = symbolicConditions;
            weaklyRelationalDomains = domains;
        }
Пример #5
0
        public SymbolicExpressionTracker <Variable, Expression> Meet(SymbolicExpressionTracker <Variable, Expression> other)
        {
            Contract.Requires(other != null);
            Contract.Ensures(Contract.Result <SymbolicExpressionTracker <Variable, Expression> >() != null);

            SymbolicExpressionTracker <Variable, Expression> result;

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

            other = UnifySlackVariableWith(other);

            return(new SymbolicExpressionTracker <Variable, Expression>(slackVar, symbolicConditions.Meet(other.symbolicConditions)));
        }
Пример #6
0
        public NonRelationalValueAbstraction <Variable, Expression> UpdateSymbolicCondition(SymbolicExpressionTracker <Variable, Expression> sc)
        {
            #region Contracts

            Contract.Requires(sc != null);

            Contract.Ensures(Contract.Result <NonRelationalValueAbstraction <Variable, Expression> >() != null);

            #endregion

            return(new NonRelationalValueAbstraction <Variable, Expression>(disInterval,
                                                                            sc,
                                                                            weaklyRelationalDomains));
        }
Пример #7
0
        private SymbolicExpressionTracker <Variable, Expression> UnifySlackVariableWith(SymbolicExpressionTracker <Variable, Expression> other)
        {
            Contract.Requires(other != null);
            Contract.Ensures(Contract.Result <SymbolicExpressionTracker <Variable, Expression> >() != null);

            if (!other.IsNormal() || object.Equals(other.slackVar, slackVar))
            {
                return(other);
            }

            var result = new Set <Expression>();

            foreach (var exp in other.symbolicConditions.Values)
            {
                result.AddIfNotNull(variableReplacer(exp, other.slackVar, slackVar));
            }

            return(result.Count != 0 ?
                   new SymbolicExpressionTracker <Variable, Expression>(slackVar, new SetOfConstraints <Expression>(result, false)) :
                   this.Top);
        }