Package org.sosy_lab.java_smt.test
Class BooleanFormulaSubject
- java.lang.Object
-
- com.google.common.truth.Subject
-
- org.sosy_lab.java_smt.test.BooleanFormulaSubject
-
public final class BooleanFormulaSubject extends Subject
Subjectsubclass for testing assertions about BooleanFormulas with Truth (allows usingassert_().about(...).that(formula).isUnsatisfiable()etc.).For a test use either
SolverBasedTest0.assertThatFormula(BooleanFormula), or useStandardSubjectBuilder.about(com.google.common.truth.Subject.Factory)and set a solver via the methodbooleanFormulasOf(SolverContext).
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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...().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...().voidimplies(BooleanFormula expected)Check that the subject implies a given formula, i.e.voidisEquisatisfiableTo(BooleanFormula other)voidisEquivalentTo(BooleanFormula expected)Check that the subject is equivalent to a given formula, i.e.voidisSatisfiable()Check that the subject is satisfiable.voidisTautological()Check that the subject is tautological, i.e., always holds.voidisUnsatisfiable()Check 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 Detail
-
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
public void isUnsatisfiable() throws SolverException, InterruptedExceptionCheck that the subject is unsatisfiable. Will show a model (satisfying assignment) on failure.- Throws:
SolverExceptionInterruptedException
-
isSatisfiable
public void isSatisfiable() throws SolverException, InterruptedExceptionCheck that the subject is satisfiable. Will show an unsat core on failure.- Throws:
SolverExceptionInterruptedException
-
isTautological
public void isTautological() throws SolverException, InterruptedExceptionCheck 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
public void isEquivalentTo(BooleanFormula expected) throws SolverException, InterruptedException
Check that the subject is equivalent to a given formula, i.e.subject <=> expectedalways holds. Will show a counterexample on failure.- Throws:
SolverExceptionInterruptedException
-
isEquisatisfiableTo
public void isEquisatisfiableTo(BooleanFormula other) throws SolverException, InterruptedException
- Throws:
SolverExceptionInterruptedException
-
implies
public void implies(BooleanFormula expected) throws SolverException, InterruptedException
Check that the subject implies a given formula, i.e.subject => expectedalways holds. Will show a counterexample on failure.- Throws:
SolverExceptionInterruptedException
-
-