@@ -337,8 +337,6 @@ signature module LangSig<Semantic Sem, DeltaSig D> {
337337}
338338
339339signature module UtilSig< Semantic Sem, DeltaSig DeltaParam> {
340- Sem:: Expr semSsaRead ( Sem:: SsaVariable v , DeltaParam:: Delta delta ) ;
341-
342340 Sem:: Guard semEqFlowCond (
343341 Sem:: SsaVariable v , Sem:: Expr e , DeltaParam:: Delta delta , boolean isEq , boolean testIsTrue
344342 ) ;
@@ -409,6 +407,7 @@ module RangeStage<
409407 private import OverflowParam
410408 private import SignAnalysis
411409 private import ModulusAnalysis
410+ private import internal.RangeUtils:: MakeUtils< Sem , D >
412411
413412 /**
414413 * An expression that does conversion, boxing, or unboxing
@@ -522,27 +521,27 @@ module RangeStage<
522521 private predicate boundCondition (
523522 Sem:: RelationalExpr comp , Sem:: SsaVariable v , Sem:: Expr e , D:: Delta delta , boolean upper
524523 ) {
525- comp .getLesserOperand ( ) = semSsaRead ( v , delta ) and
524+ comp .getLesserOperand ( ) = ssaRead ( v , delta ) and
526525 e = comp .getGreaterOperand ( ) and
527526 upper = true
528527 or
529- comp .getGreaterOperand ( ) = semSsaRead ( v , delta ) and
528+ comp .getGreaterOperand ( ) = ssaRead ( v , delta ) and
530529 e = comp .getLesserOperand ( ) and
531530 upper = false
532531 or
533532 exists ( Sem:: SubExpr sub , Sem:: ConstantIntegerExpr c , D:: Delta d |
534533 // (v - d) - e < c
535534 comp .getLesserOperand ( ) = sub and
536535 comp .getGreaterOperand ( ) = c and
537- sub .getLeftOperand ( ) = semSsaRead ( v , d ) and
536+ sub .getLeftOperand ( ) = ssaRead ( v , d ) and
538537 sub .getRightOperand ( ) = e and
539538 upper = true and
540539 delta = D:: fromFloat ( D:: toFloat ( d ) + c .getIntValue ( ) )
541540 or
542541 // (v - d) - e > c
543542 comp .getGreaterOperand ( ) = sub and
544543 comp .getLesserOperand ( ) = c and
545- sub .getLeftOperand ( ) = semSsaRead ( v , d ) and
544+ sub .getLeftOperand ( ) = ssaRead ( v , d ) and
546545 sub .getRightOperand ( ) = e and
547546 upper = false and
548547 delta = D:: fromFloat ( D:: toFloat ( d ) + c .getIntValue ( ) )
@@ -551,15 +550,15 @@ module RangeStage<
551550 comp .getLesserOperand ( ) = sub and
552551 comp .getGreaterOperand ( ) = c and
553552 sub .getLeftOperand ( ) = e and
554- sub .getRightOperand ( ) = semSsaRead ( v , d ) and
553+ sub .getRightOperand ( ) = ssaRead ( v , d ) and
555554 upper = false and
556555 delta = D:: fromFloat ( D:: toFloat ( d ) - c .getIntValue ( ) )
557556 or
558557 // e - (v - d) > c
559558 comp .getGreaterOperand ( ) = sub and
560559 comp .getLesserOperand ( ) = c and
561560 sub .getLeftOperand ( ) = e and
562- sub .getRightOperand ( ) = semSsaRead ( v , d ) and
561+ sub .getRightOperand ( ) = ssaRead ( v , d ) and
563562 upper = true and
564563 delta = D:: fromFloat ( D:: toFloat ( d ) - c .getIntValue ( ) )
565564 )
@@ -677,7 +676,7 @@ module RangeStage<
677676 Sem:: SsaVariable v1 , Sem:: SsaVariable v2 , float delta
678677 ) {
679678 exists ( Sem:: Guard guardEq , D:: Delta d1 , D:: Delta d2 , boolean eqIsTrue |
680- guardEq = semEqFlowCond ( v1 , semSsaRead ( v2 , d1 ) , d2 , true , eqIsTrue ) and
679+ guardEq = semEqFlowCond ( v1 , ssaRead ( v2 , d1 ) , d2 , true , eqIsTrue ) and
681680 delta = D:: toFloat ( d2 ) - D:: toFloat ( d1 ) and
682681 guardEq .directlyControls ( result , eqIsTrue )
683682 )
0 commit comments