@@ -1039,6 +1039,29 @@ module RangeStage<DeltaSig D, BoundSig<D> Bounds, LangSig<D> LangParam, UtilSig<
10391039 or
10401040 b = bRight and origdelta = odRight and reason = rRight and bLeft instanceof SemZeroBound
10411041 )
1042+ or
1043+ exists (
1044+ SemRemExpr rem , SemZeroBound b1 , SemZeroBound b2 , D:: Delta d_max , D:: Delta d1 , D:: Delta d2 ,
1045+ boolean fbe1 , boolean fbe2 , D:: Delta od1 , D:: Delta od2 , SemReason r1 , SemReason r2
1046+ |
1047+ rem = e and
1048+ not ( upper = true and semPositive ( rem .getRightOperand ( ) ) ) and
1049+ not ( upper = true and semPositive ( rem .getLeftOperand ( ) ) ) and
1050+ boundedRemExpr ( rem , b1 , true , d1 , fbe1 , od1 , r1 ) and
1051+ boundedRemExpr ( rem , b2 , false , d2 , fbe2 , od2 , r2 ) and
1052+ (
1053+ if D:: toFloat ( d1 ) .abs ( ) > D:: toFloat ( d2 ) .abs ( )
1054+ then (
1055+ b = b1 and d_max = d1 and fromBackEdge = fbe1 and origdelta = od1 and reason = r1
1056+ ) else (
1057+ b = b2 and d_max = d2 and fromBackEdge = fbe2 and origdelta = od2 and reason = r2
1058+ )
1059+ )
1060+ |
1061+ upper = true and delta = D:: fromFloat ( D:: toFloat ( d_max ) .abs ( ) - 1 )
1062+ or
1063+ upper = false and delta = D:: fromFloat ( - D:: toFloat ( d_max ) .abs ( ) + 1 )
1064+ )
10421065 )
10431066 }
10441067
@@ -1065,4 +1088,11 @@ module RangeStage<DeltaSig D, BoundSig<D> Bounds, LangSig<D> LangParam, UtilSig<
10651088 bounded ( add .getRightOperand ( ) , b , delta , upper , fromBackEdge , origdelta , reason )
10661089 )
10671090 }
1091+
1092+ private predicate boundedRemExpr (
1093+ SemRemExpr rem , SemZeroBound b , boolean upper , D:: Delta delta , boolean fromBackEdge ,
1094+ D:: Delta origdelta , SemReason reason
1095+ ) {
1096+ bounded ( rem .getRightOperand ( ) , b , delta , upper , fromBackEdge , origdelta , reason )
1097+ }
10681098}
0 commit comments