=================
Changes:
+* API change: `SmtEngine::query()` has been renamed to
+ `SmtEngine::checkEntailed()` and `Result::Validity` has been renamed to
+ `Result::Entailment` along with corresponding changes to the enum values.
* Java API change: The name of CVC4's package is now `edu.stanford.CVC4`
instead of `edu.nyu.acsys.CVC4`.
**/
import static org.junit.Assert.assertEquals;
+
+import edu.stanford.CVC4.*;
import org.junit.Before;
import org.junit.Test;
-import edu.nyu.acsys.CVC4.*;
-
public class BitVectors {
static {
System.loadLibrary("cvc4jni");
@Test
public void evaluatesExpression() {
- Result.Validity expect, actual;
+ Result.Entailment expect, actual;
smt.setLogic("QF_BV"); // Set the logic
// The following example has been adapted from the book A Hacker's Delight by
smt.assertFormula(assignment1);
Expr new_x_eq_new_x_ = em.mkExpr(Kind.EQUAL, new_x, new_x_);
- expect = Result.Validity.VALID;
- actual = smt.query(new_x_eq_new_x_).isValid();
+ expect = Result.Entailment.ENTAILED;
+ actual = smt.checkEntailed(new_x_eq_new_x_).isEntailed();
assertEquals(expect, actual);
smt.pop();
// Assert encoding to CVC4 in current context;
smt.assertFormula(assignment2);
- expect = Result.Validity.VALID;
- actual = smt.query(new_x_eq_new_x_).isValid();
+ expect = Result.Entailment.ENTAILED;
+ actual = smt.checkEntailed(new_x_eq_new_x_).isEntailed();
assertEquals(expect, actual);
}
}
**/
import static org.junit.Assert.assertEquals;
+
+import edu.stanford.CVC4.*;
import org.junit.Before;
import org.junit.Test;
-import edu.nyu.acsys.CVC4.*;
-
public class BitVectorsAndArrays {
static {
System.loadLibrary("cvc4jni");
vectorExpr assertions = new vectorExpr();
for (int i = 1; i < k; ++i) {
- index = em.mkConst(new BitVector(index_size, new edu.nyu.acsys.CVC4.Integer(i)));
+ index = em.mkConst(
+ new BitVector(index_size, new edu.stanford.CVC4.Integer(i)));
Expr new_current = em.mkExpr(Kind.BITVECTOR_MULT, two, old_current);
// current[i] = 2 * current[i-1]
current_array = em.mkExpr(Kind.STORE, current_array, index, new_current);
**/
import static org.junit.Assert.assertEquals;
+
+import edu.stanford.CVC4.*;
import org.junit.Before;
import org.junit.Test;
-import edu.nyu.acsys.CVC4.*;
-
public class Combination {
static {
System.loadLibrary("cvc4jni");
p_f_y); // p(f(y))
smt.assertFormula(assumptions);
- assertEquals(
- Result.Validity.VALID,
- smt.query(em.mkExpr(Kind.DISTINCT, x, y)).isValid()
- );
+ assertEquals(Result.Entailment.ENTAILED,
+ smt.checkEntailed(em.mkExpr(Kind.DISTINCT, x, y)).isEntailed());
assertEquals(
Result.Sat.SAT,
**/
import static org.junit.Assert.assertEquals;
+
+import edu.stanford.CVC4.*;
import org.junit.Before;
import org.junit.Test;
-import edu.nyu.acsys.CVC4.*;
-
public class HelloWorld {
static {
System.loadLibrary("cvc4jni");
@Test
public void evaluatesExpression() {
Expr helloworld = em.mkVar("Hello World!", em.booleanType());
- Result.Validity expect = Result.Validity.INVALID;
- Result.Validity actual = smt.query(helloworld).isValid();
+ Result.Entailment expect = Result.Entailment.NOT_ENTAILED;
+ Result.Entailment actual = smt.checkEntailed(helloworld).isEntailed();
assertEquals(actual, expect);
}
}
**/
import static org.junit.Assert.assertEquals;
+
+import edu.stanford.CVC4.*;
import org.junit.Before;
import org.junit.Test;
-import edu.nyu.acsys.CVC4.*;
-
public class LinearArith {
static {
System.loadLibrary("cvc4jni");
smt.push();
Expr diff_leq_two_thirds = em.mkExpr(Kind.LEQ, diff, two_thirds);
- assertEquals(
- Result.Validity.VALID,
- smt.query(diff_leq_two_thirds).isValid()
- );
+ assertEquals(Result.Entailment.ENTAILED,
+ smt.checkEntailed(diff_leq_two_thirds).isEntailed());
smt.pop();