@@ -1425,10 +1425,9 @@ public void testStringVariableReplacePrefix() throws SolverException, Interrupte
1425
1425
public void testStringVariableReplaceSubstring () throws SolverException , InterruptedException {
1426
1426
requireVariableStringLiterals ();
1427
1427
1428
- assume ()
1429
- .withMessage ("Regression from Z3 4.13.4 to 4.14.0" )
1430
- .that (solverToUse ())
1431
- .isNotEqualTo (Solvers .Z3 );
1428
+ // TODO: Z3 had a regression from Z3 4.13.4 to 4.14.0 in the first implication, running
1429
+ // indefinitely. We fixed this by reordering the arguments of the AND expression in the left
1430
+ // hand side of the implication. Check if this is persisting after 4.14.0 and possibly report.
1432
1431
1433
1432
// I couldn't find stronger constraints in the implication that don't run endlessly.....
1434
1433
StringFormula original = smgr .makeVariable ("original" );
@@ -1440,25 +1439,25 @@ public void testStringVariableReplaceSubstring() throws SolverException, Interru
1440
1439
// comes after the prefix is replaced
1441
1440
assertThatFormula (
1442
1441
bmgr .and (
1443
- smgr .prefix (prefix , original ),
1444
- imgr .equal (
1445
- smgr .length (prefix ),
1446
- smgr .indexOf (
1447
- original ,
1448
- smgr .substring (original , smgr .length (prefix ), smgr .length (original )),
1449
- imgr .makeNumber (0 ))),
1450
1442
imgr .greaterThan (smgr .length (original ), smgr .length (prefix )),
1451
1443
imgr .greaterThan (smgr .length (prefix ), imgr .makeNumber (0 )),
1452
1444
imgr .greaterThan (
1453
1445
smgr .length (
1454
1446
smgr .substring (original , smgr .length (prefix ), smgr .length (original ))),
1455
1447
imgr .makeNumber (0 )),
1448
+ imgr .equal (
1449
+ smgr .length (prefix ),
1450
+ smgr .indexOf (
1451
+ original ,
1452
+ smgr .substring (original , smgr .length (prefix ), smgr .length (original )),
1453
+ imgr .makeNumber (0 ))),
1456
1454
smgr .equal (
1457
1455
replaced ,
1458
1456
smgr .replace (
1459
1457
original ,
1460
1458
smgr .substring (original , smgr .length (prefix ), smgr .length (original )),
1461
- replacement ))))
1459
+ replacement )),
1460
+ smgr .prefix (prefix , original )))
1462
1461
.implies (
1463
1462
smgr .equal (
1464
1463
replacement , smgr .substring (replaced , smgr .length (prefix ), smgr .length (replaced ))));
0 commit comments