Ejemplo n.º 1
0
  @Test
  public void testConditionals() {

    RTLExpression c =
        ExpressionFactory.createConditionalExpression(
            ExpressionFactory.createGreaterThan(esp, ExpressionFactory.createNumber(10, 32)),
            ExpressionFactory.createNumber(10, 32),
            ExpressionFactory.createNumber(5, 32));
    RTLExpression f = ExpressionFactory.createEqual(ExpressionFactory.createVariable("x", 32), c);
    solver.addAssertion(f);
    assertTrue(solver.isSatisfiable());
  }
Ejemplo n.º 2
0
 /** Test method for {@link org.jakstab.solver.yices.YicesSolver#isSatisfiable()}. */
 @Test
 public void testMemoryLocations() {
   solver.push();
   RTLExpression f = ExpressionFactory.createEqual(m1, ExpressionFactory.createNumber(254823, 32));
   solver.addAssertion(f);
   f = ExpressionFactory.createEqual(m2, ExpressionFactory.createNumber(53223, 32));
   solver.addAssertion(f);
   assertTrue(solver.isSatisfiable());
   f = ExpressionFactory.createEqual(m3, ExpressionFactory.createNumber(53223, 32));
   solver.addAssertion(f);
   assertFalse(solver.isSatisfiable());
   solver.pop();
   solver.push();
   f = ExpressionFactory.createNotEqual(m1, m2);
   solver.addAssertion(f);
   assertTrue(solver.isSatisfiable());
   f = ExpressionFactory.createEqual(m1, m2);
   solver.addAssertion(f);
   assertFalse(solver.isSatisfiable());
   solver.pop();
 }