public class BooleanFormulaSubject extends Subject<BooleanFormulaSubject,BooleanFormula>
Subject subclass for testing assertions about BooleanFormulas with Truth (allows to use
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).
| Modifier and Type | Method and 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 |
isSatisfiable(boolean generateModel)
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.
|
actual, actualAsString, actualCustomStringRepresentation, check, check, equals, fail, fail, fail, failComparing, failComparing, failWithActual, failWithActual, failWithBadResults, failWithCustomSubject, failWithoutActual, failWithoutActual, failWithoutSubject, failWithRawMessage, failWithRawMessageAndCause, getSubject, hashCode, ignoreCheck, internalCustomName, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs, named, toStringpublic static Subject.Factory<BooleanFormulaSubject,BooleanFormula> booleanFormulasOf(SolverContext context)
assert_().about(booleanFormulasOf(context)).that(formula).is...().public static SimpleSubjectBuilder<BooleanFormulaSubject,BooleanFormula> assertUsing(SolverContext context)
assertUsing(context)).that(formula).is...().public void isUnsatisfiable()
throws SolverException,
InterruptedException
SolverExceptionInterruptedExceptionpublic void isSatisfiable()
throws SolverException,
InterruptedException
SolverExceptionInterruptedExceptionpublic void isSatisfiable(boolean generateModel)
throws SolverException,
InterruptedException
generateModel - whether we check model iteration.SolverExceptionInterruptedExceptionpublic void isTautological()
throws SolverException,
InterruptedException
isEquivalentTo(BooleanFormula) with the formula true, but it checks
satisfiability of the subject and unsatisfiability of the negated subject in two steps to
improve error messages.SolverExceptionInterruptedExceptionpublic void isEquivalentTo(BooleanFormula expected) throws SolverException, InterruptedException
subject <=> expected
always holds. Will show a counterexample on failure.SolverExceptionInterruptedExceptionpublic void isEquisatisfiableTo(BooleanFormula other) throws SolverException, InterruptedException
SolverExceptionInterruptedExceptionpublic void implies(BooleanFormula expected) throws SolverException, InterruptedException
subject => expected always holds.
Will show a counterexample on failure.SolverExceptionInterruptedException