@@ -28,14 +28,17 @@ void applyReturnsNullForNullImplication() {
2828
2929 @ Test
3030 void foldsIntegerArithmeticAndComparisons () {
31- assertSimplificationSteps (vc ("1 + 2 == 3" ), VCFolding ::apply , "1 + 2 == 3" , "3 == 3" , "true" );
31+ assertSimplificationSteps (VCFolding ::apply , vc ("1 + 2 == 3" ), simplified ("3 == 3" , "1 + 2 == 3" ),
32+ simplified ("true" , "1 + 2 == 3" ));
3233 assertFolded ("4 > 7" , "false" );
3334 }
3435
3536 @ Test
3637 void foldsRealAndMixedNumericExpressions () {
37- assertSimplificationSteps (vc ("1.5 + 2.0 == 3.5" ), VCFolding ::apply , "1.5 + 2.0 == 3.5" , "3.5 == 3.5" , "true" );
38- assertSimplificationSteps (vc ("2 + 0.5 > 2" ), VCFolding ::apply , "2 + 0.5 > 2" , "2.5 > 2" , "true" );
38+ assertSimplificationSteps (VCFolding ::apply , vc ("1.5 + 2.0 == 3.5" ),
39+ simplified ("3.5 == 3.5" , "1.5 + 2.0 == 3.5" ), simplified ("true" , "1.5 + 2.0 == 3.5" ));
40+ assertSimplificationSteps (VCFolding ::apply , vc ("2 + 0.5 > 2" ), simplified ("2.5 > 2" , "2 + 0.5 > 2" ),
41+ simplified ("true" , "2 + 0.5 > 2" ));
3942 }
4043
4144 @ Test
@@ -76,7 +79,8 @@ void foldsPartialComparisonsWithoutDroppingSymbolicTerms() {
7679 @ Test
7780 void foldsUnaryExpressions () {
7881 assertFolded ("!true" , "false" );
79- assertSimplificationSteps (vc ("-3 < 0" ), VCFolding ::apply , "-3 < 0" , "-3 < 0" , "true" );
82+ assertSimplificationSteps (VCFolding ::apply , vc ("-3 < 0" ), simplified ("-3 < 0" , "-3 < 0" ),
83+ simplified ("true" , "-3 < 0" ));
8084 }
8185
8286 @ Test
@@ -88,7 +92,8 @@ void foldsIteExpressions() {
8892
8993 @ Test
9094 void foldsIteBranchesBeforeComparingThem () {
91- assertSimplificationSteps (vc ("cond ? 1 + 2 : 3" ), VCFolding ::apply , "cond ? 1 + 2 : 3" , "cond ? 3 : 3" , "3" );
95+ assertSimplificationSteps (VCFolding ::apply , vc ("cond ? 1 + 2 : 3" ),
96+ simplified ("cond ? 3 : 3" , "cond ? 1 + 2 : 3" ), simplified ("3" , "cond ? 1 + 2 : 3" ));
9297 }
9398
9499 @ Test
@@ -112,7 +117,7 @@ void foldsResolvedEnumLiterals() {
112117 VCImplication implication = new VCImplication (
113118 new Predicate (new BinaryExpression (limit , "==" , new LiteralInt (3 ))));
114119
115- assertSimplificationSteps (implication , VCFolding ::apply , simplified ("3 == 3" , "Config.LIMIT == 3" ),
120+ assertSimplificationSteps (VCFolding ::apply , implication , simplified ("3 == 3" , "Config.LIMIT == 3" ),
116121 simplified ("true" , "Config.LIMIT == 3" ));
117122 }
118123
@@ -124,15 +129,15 @@ void foldsResolvedEnumLiteralsInsideLargerExpression() {
124129 VCImplication implication = new VCImplication (
125130 new Predicate (new BinaryExpression (arithmetic , "==" , new LiteralInt (5 ))));
126131
127- assertSimplificationSteps (implication , VCFolding ::apply , simplified ("3 + 2 == 5" , "Config.LIMIT + 2 == 5" ),
132+ assertSimplificationSteps (VCFolding ::apply , implication , simplified ("3 + 2 == 5" , "Config.LIMIT + 2 == 5" ),
128133 simplified ("5 == 5" , "Config.LIMIT + 2 == 5" ), simplified ("true" , "Config.LIMIT + 2 == 5" ));
129134 }
130135
131136 @ Test
132137 void preservesOriginFromExistingSimplifiedImplication () {
133138 VCImplication substituted = VCSubstitution .apply (vc ("∀x:int. x == 1" , "x + 1 + 2 > 0" ));
134139
135- assertSimplificationSteps (substituted , VCFolding ::apply , simplified ("2 + 2 > 0" , "∀x:int. x + 1 + 2 > 0" ),
140+ assertSimplificationSteps (VCFolding ::apply , substituted , simplified ("2 + 2 > 0" , "∀x:int. x + 1 + 2 > 0" ),
136141 simplified ("4 > 0" , "∀x:int. x + 1 + 2 > 0" ), simplified ("true" , "∀x:int. x + 1 + 2 > 0" ));
137142 }
138143
0 commit comments