/// <summary> /// Given the previous state of the domain and the result of a join operations, add to the third parameter all the constraints that have been dropped /// during the join /// </summary> /// <param name="thiscloned">The old state</param> /// <param name="result">The result of the join</param> /// <param name="dropped">The variable on which the constraints must be added</param> private static void ExtractDroppedConstraints(StripeForUnsafeCode thiscloned, StripeForUnsafeCode result, StripeForUnsafeCode dropped) { foreach (BoxedExpression key in thiscloned.Keys) { foreach (AtMostTwoExpressions <BoxedExpression> constr in thiscloned[key].EmbeddedValues_Unsafe) { if (result.ContainsKey(key) == false || result[key].Contains(constr) == false) { dropped.AddConstraint(key, constr); } } } }
/// <summary> /// It checks for each dropped constraints if it can be validated by the intervals domain state /// </summary> private void addConstraints(IntervalsForUnsafeCode intervalsPrev, StripeForUnsafeCode thiscloned, StripeForUnsafeCode result) { StripeForUnsafeCode dropped = (StripeForUnsafeCode)this.Factory(); ExtractDroppedConstraints(thiscloned, result, dropped); foreach (BoxedExpression key in dropped.Keys) { foreach (AtMostTwoExpressions <BoxedExpression> constr in dropped[key].EmbeddedValues_Unsafe) { if (!constr.IsTop && !constr.IsBottom) { BoxedExpression toBeChecked = StripeWithIntervalsForUnsafeCode.MakeCondition(key, constr, this.mdDecoder); FlatAbstractDomain <bool> test = intervalsPrev.CheckIfHolds(toBeChecked); if (!test.IsBottom && !test.IsTop && test.BoxedElement == true) { result.AddConstraint(key, constr); } } } } }