Package org.sosy_lab.java_smt.test
Class BooleanFormulaSubject
java.lang.Object
com.google.common.truth.Subject
org.sosy_lab.java_smt.test.BooleanFormulaSubject
Subject subclass for testing assertions about BooleanFormulas with Truth (allows using
assert_().about(...).that(formula).isUnsatisfiable() etc.).
For a test use either SolverBasedTest0.assertThatFormula(BooleanFormula), or use
StandardSubjectBuilder.about(com.google.common.truth.Subject.Factory) and set a solver
via the method booleanFormulasOf(SolverContext).
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionassertUsing(SolverContext context) Use this for checking assertions about BooleanFormulas (given the corresponding solver) with Truth:assertUsing(context)).that(formula).is...().booleanFormulasOf(SolverContext context) Use this for checking assertions about BooleanFormulas (given the corresponding solver) with Truth:assert_().about(booleanFormulasOf(context)).that(formula).is...().voidimplies(BooleanFormula expected) Check that the subject implies a given formula, i.e.voidvoidisEquivalentTo(BooleanFormula expected) Check that the subject is equivalent to a given formula, i.e.voidCheck that the subject is satisfiable.voidCheck that the subject is tautological, i.e., always holds.voidCheck that the subject is unsatisfiable.Methods inherited from class com.google.common.truth.Subject
actualCustomStringRepresentation, check, equals, failWithActual, failWithActual, failWithoutActual, hashCode, ignoreCheck, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameInstanceAs, isNull, isSameInstanceAs, toString
-
Method Details
-
booleanFormulasOf
public static Subject.Factory<BooleanFormulaSubject,BooleanFormula> booleanFormulasOf(SolverContext context) Use this for checking assertions about BooleanFormulas (given the corresponding solver) with Truth:assert_().about(booleanFormulasOf(context)).that(formula).is...(). -
assertUsing
public static SimpleSubjectBuilder<BooleanFormulaSubject,BooleanFormula> assertUsing(SolverContext context) Use this for checking assertions about BooleanFormulas (given the corresponding solver) with Truth:assertUsing(context)).that(formula).is...(). -
isUnsatisfiable
Check that the subject is unsatisfiable. Will show a model (satisfying assignment) on failure.- Throws:
SolverExceptionInterruptedException
-
isSatisfiable
Check that the subject is satisfiable. Will show an unsat core on failure.- Throws:
SolverExceptionInterruptedException
-
isTautological
Check that the subject is tautological, i.e., always holds. This is equivalent to callingisEquivalentTo(BooleanFormula)with the formulatrue, but it checks satisfiability of the subject and unsatisfiability of the negated subject in two steps to improve error messages.- Throws:
SolverExceptionInterruptedException
-
isEquivalentTo
Check that the subject is equivalent to a given formula, i.e.subject <=> expectedalways holds. Will show a counterexample on failure.- Throws:
SolverExceptionInterruptedException
-
isEquisatisfiableTo
- Throws:
SolverExceptionInterruptedException
-
implies
Check that the subject implies a given formula, i.e.subject => expectedalways holds. Will show a counterexample on failure.- Throws:
SolverExceptionInterruptedException
-