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
Subject
subclass 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...()
.void
implies(BooleanFormula expected)
Check that the subject implies a given formula, i.e.void
isEquisatisfiableTo(BooleanFormula other)
void
isEquivalentTo(BooleanFormula expected)
Check that the subject is equivalent to a given formula, i.e.void
isSatisfiable()
Check that the subject is satisfiable.void
isTautological()
Check that the subject is tautological, i.e., always holds.void
isUnsatisfiable()
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, InterruptedException
Check that the subject is unsatisfiable. Will show a model (satisfying assignment) on failure.- Throws:
SolverException
InterruptedException
-
isSatisfiable
public void isSatisfiable() throws SolverException, InterruptedException
Check that the subject is satisfiable. Will show an unsat core on failure.- Throws:
SolverException
InterruptedException
-
isTautological
public void isTautological() throws SolverException, InterruptedException
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:
SolverException
InterruptedException
-
isEquivalentTo
public void isEquivalentTo(BooleanFormula expected) throws SolverException, InterruptedException
Check that the subject is equivalent to a given formula, i.e.subject <=> expected
always holds. Will show a counterexample on failure.- Throws:
SolverException
InterruptedException
-
isEquisatisfiableTo
public void isEquisatisfiableTo(BooleanFormula other) throws SolverException, InterruptedException
- Throws:
SolverException
InterruptedException
-
implies
public void implies(BooleanFormula expected) throws SolverException, InterruptedException
Check that the subject implies a given formula, i.e.subject => expected
always holds. Will show a counterexample on failure.- Throws:
SolverException
InterruptedException
-
-