File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
src/org/sosy_lab/java_smt/test Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -1605,4 +1605,29 @@ protected TraversalProcess visitDefault(Formula pF) {
16051605 // check UF-equality. This check went wrong in CVC4 and was fixed.
16061606 assertThat (usedDecls .get (1 )).isEqualTo (usedDecls .get (3 ));
16071607 }
1608+
1609+ @ Test
1610+ public void testSl () throws SolverException , InterruptedException {
1611+ requireSeparationLogic ();
1612+
1613+ // check constants
1614+ ConstantsVisitor visitor = new ConstantsVisitor (true );
1615+ mgr .visit (slmgr .makePointsTo (imgr .makeNumber (3 ), imgr .makeNumber (5 )), visitor );
1616+ assertThat (visitor .found ).containsExactly (BigInteger .valueOf (3 ), BigInteger .valueOf (5 ));
1617+
1618+ // check variables
1619+ ImmutableMap <String , Formula > vars =
1620+ mgr .extractVariables (
1621+ slmgr .makePointsTo (imgr .makeVariable ("pointer" ), imgr .makeVariable ("value" )));
1622+ assertThat (vars .keySet ()).containsExactly ("pointer" , "value" );
1623+
1624+ // check trasnformation
1625+ BooleanFormula f =
1626+ slmgr .makeStar (
1627+ slmgr .makePointsTo (imgr .makeNumber (3 ), imgr .makeNumber (5 )),
1628+ slmgr .makePointsTo (imgr .makeVariable ("pointer" ), imgr .makeVariable ("value" )));
1629+ BooleanFormula f2 = mgr .transformRecursively (f , new FormulaTransformationVisitor (mgr ) {});
1630+ assertThat (f2 ).isEqualTo (f );
1631+ assertThatFormula (f ).isEquivalentTo (f2 );
1632+ }
16081633}
You can’t perform that action at this time.
0 commit comments