Example #1
0
        public override bool Propagate(FloatVariable changed, bool isUpper, Queue <Tuple <FloatVariable, bool> > q)
        {
            if (ReferenceEquals(changed, Result))
            {
                return(lhs.NarrowTo(Result.Bounds / rhs.Bounds, q) &&
                       rhs.NarrowTo(Result.Bounds / lhs.Bounds, q));
            }

            // It was lhs or rhs that changed.
            Debug.Assert(ReferenceEquals(changed, lhs) || ReferenceEquals(changed, rhs));
            FloatVariable other = ReferenceEquals(changed, lhs) ? rhs : lhs;

            return(Result.NarrowTo(lhs.Bounds * rhs.Bounds, q) &&
                   other.NarrowTo(Result.Bounds / changed.Bounds, q));
        }