narrow method

  1. @override
IntervalDomain narrow(
  1. IntervalDomain other
)
override

Narrowing operation (△): refines over-approximation after widening.

Implementation

@override
IntervalDomain narrow(IntervalDomain other) {
  if (isBottom) return bottomValue;
  if (other.isBottom) return bottomValue;

  // Narrow: replace infinity with finite bound from other
  final newMin = (min == null && other.min != null) ? other.min : min;
  final newMax = (max == null && other.max != null) ? other.max : max;

  return IntervalDomain(newMin, newMax);
}