1010class VCSubstitutionTest {
1111
1212 @ Test
13- void applyReturnsNullForNullImplication () {
14- assertNull (VCSubstitution .apply (null ));
13+ void applyOnceReturnsNullForNullImplication () {
14+ assertNull (VCSubstitution .applyOnce (null ));
1515 }
1616
1717 @ Test
1818 void substitutesBinderEqualityIntoWholeChain () {
1919 VCImplication implication = vc ("∀x:int. x == 3" , "x > 0" );
2020
21- VCImplication result = VCSubstitution .apply (implication );
21+ VCImplication result = VCSubstitution .applyOnce (implication );
2222
2323 assertSimplifiedVC (result , simplified ("3 > 0" , "x > 0" , "x:int" ));
2424 }
@@ -27,7 +27,7 @@ void substitutesBinderEqualityIntoWholeChain() {
2727 void substitutesReverseBinderEquality () {
2828 VCImplication implication = vc ("∀x:int. 3 == x" , "x > 0" );
2929
30- VCImplication result = VCSubstitution .apply (implication );
30+ VCImplication result = VCSubstitution .applyOnce (implication );
3131
3232 assertSimplifiedVC (result , simplified ("3 > 0" , "x > 0" , "x:int" ));
3333 }
@@ -36,7 +36,7 @@ void substitutesReverseBinderEquality() {
3636 void substitutesCompoundKnownValue () {
3737 VCImplication implication = vc ("∀x:int. x == y + 1" , "x > y" );
3838
39- VCImplication result = VCSubstitution .apply (implication );
39+ VCImplication result = VCSubstitution .applyOnce (implication );
4040
4141 assertSimplifiedVC (result , simplified ("y + 1 > y" , "x > y" , "x:int" ));
4242 }
@@ -45,7 +45,7 @@ void substitutesCompoundKnownValue() {
4545 void usesFirstSubstitutionFoundInChain () {
4646 VCImplication implication = vc ("∀x:int. x > 0" , "∀y:int. y == 4" , "x + y > 0" );
4747
48- VCImplication result = VCSubstitution .apply (implication );
48+ VCImplication result = VCSubstitution .applyOnce (implication );
4949
5050 assertSimplifiedVC (result , simplified ("x > 0" , "x > 0" , "" ), simplified ("x + 4 > 0" , "x + y > 0" , "y:int" ));
5151 }
@@ -54,7 +54,7 @@ void usesFirstSubstitutionFoundInChain() {
5454 void substitutesInnerKnownValueAcrossNestedImplications () {
5555 VCImplication implication = vc ("∀x:int. true" , "∀y:int. y == 1" , "∀z:int. z > y" , "y + z > 0" );
5656
57- VCImplication result = VCSubstitution .apply (implication );
57+ VCImplication result = VCSubstitution .applyOnce (implication );
5858
5959 assertSimplifiedVC (result , simplified ("true" , "true" , "" ), simplified ("z > 1" , "z > y" , "y:int" ),
6060 simplified ("1 + z > 0" , "y + z > 0" , "y:int" ));
@@ -64,16 +64,17 @@ void substitutesInnerKnownValueAcrossNestedImplications() {
6464 void substitutesOuterKnownValueIntoNestedBinderRefinements () {
6565 VCImplication implication = vc ("∀x:int. x == 3" , "∀y:int. y == x + 1" , "y > x" );
6666
67- VCImplication result = VCSubstitution .apply (implication );
67+ VCImplication result = VCSubstitution .applyOnce (implication );
6868
69- assertSimplifiedVC (result , simplified ("3 + 1 > 3" , "y > x" , "x:int, y:int" ));
69+ assertSimplifiedVC (result , simplified ("y == 3 + 1" , "y == x + 1" , "x:int" ),
70+ simplified ("y > 3" , "y > x" , "x:int" ));
7071 }
7172
7273 @ Test
7374 void ignoresRecursiveBinderEquality () {
7475 VCImplication implication = vc ("∀x:int. x == x + 1" , "x > 0" );
7576
76- VCImplication result = VCSubstitution .apply (implication );
77+ VCImplication result = VCSubstitution .applyOnce (implication );
7778
7879 assertNotSame (implication , result );
7980 assertVC (result , "x == x + 1" , "x > 0" );
@@ -83,7 +84,7 @@ void ignoresRecursiveBinderEquality() {
8384 void ignoresNonEqualityBinderRefinement () {
8485 VCImplication implication = vc ("∀x:int. x > 3" , "x > 0" );
8586
86- VCImplication result = VCSubstitution .apply (implication );
87+ VCImplication result = VCSubstitution .applyOnce (implication );
8788
8889 assertNotSame (implication , result );
8990 assertVC (result , "x > 3" , "x > 0" );
@@ -93,7 +94,7 @@ void ignoresNonEqualityBinderRefinement() {
9394 void ignoresEqualityWithoutBinder () {
9495 VCImplication implication = vc ("x == 3" , "x > 0" );
9596
96- VCImplication result = VCSubstitution .apply (implication );
97+ VCImplication result = VCSubstitution .applyOnce (implication );
9798
9899 assertVC (result , "x == 3" , "x > 0" );
99100 }
0 commit comments