Search in sources :

Example 1 with SingleVariableEqualityConstraint

use of com.sri.ai.grinder.sgdpllt.theory.equality.SingleVariableEqualityConstraint in project aic-expresso by aic-sri-international.

the class AbstractEqualityConstraintTest method testSatisfiabilitySpecialCases.

@Test
public void testSatisfiabilitySpecialCases() {
    String conjunction;
    // looks unsatisfiable for type size 5, but it is not
    conjunction = "X != a and X != b and X != c and X != Y and X != Z";
    TheoryTestingSupport theoryTestingSupport = makeTheoryTestingSupport();
    Constraint constraint = new SingleVariableEqualityConstraint(parse("X"), false, theoryTestingSupport.getTheory());
    Context context = theoryTestingSupport.makeContextWithTestingInformation();
    constraint = constraint.conjoinWithConjunctiveClause(parse(conjunction), context);
    // satisfiable if either Y or Z is equal to a, b, c, or each other.
    Assert.assertNotEquals(null, constraint);
}
Also used : SingleVariableEqualityConstraint(com.sri.ai.grinder.sgdpllt.theory.equality.SingleVariableEqualityConstraint) CompleteMultiVariableContext(com.sri.ai.grinder.sgdpllt.core.constraint.CompleteMultiVariableContext) Context(com.sri.ai.grinder.sgdpllt.api.Context) Constraint(com.sri.ai.grinder.sgdpllt.api.Constraint) SingleVariableEqualityConstraint(com.sri.ai.grinder.sgdpllt.theory.equality.SingleVariableEqualityConstraint) TheoryTestingSupport(com.sri.ai.grinder.sgdpllt.tester.TheoryTestingSupport) Test(org.junit.Test) AbstractTheoryIncludingEqualityTest(com.sri.ai.test.grinder.sgdpllt.theory.base.AbstractTheoryIncludingEqualityTest)

Aggregations

Constraint (com.sri.ai.grinder.sgdpllt.api.Constraint)1 Context (com.sri.ai.grinder.sgdpllt.api.Context)1 CompleteMultiVariableContext (com.sri.ai.grinder.sgdpllt.core.constraint.CompleteMultiVariableContext)1 TheoryTestingSupport (com.sri.ai.grinder.sgdpllt.tester.TheoryTestingSupport)1 SingleVariableEqualityConstraint (com.sri.ai.grinder.sgdpllt.theory.equality.SingleVariableEqualityConstraint)1 AbstractTheoryIncludingEqualityTest (com.sri.ai.test.grinder.sgdpllt.theory.base.AbstractTheoryIncludingEqualityTest)1 Test (org.junit.Test)1