use of com.sri.ai.grinder.tester.TheoryTestingSupport in project aic-expresso by aic-sri-international.
the class CompoundTheoryTestingSupport method setVariableNamesAndTypesForTesting.
/**
* This is overridden so that given variables and types for testing are distributed to their
* respective theories according to {@link #isSuitableFor(Type)}.
*/
@Override
public void setVariableNamesAndTypesForTesting(Map<String, Type> variableNamesAndTypesForTesting) {
// First ensure the compound set of variables names and type information is setup correctly
super.setVariableNamesAndTypesForTesting(variableNamesAndTypesForTesting);
// Then update the sub-theories so that they share appropriate subsets of this information
Map<Theory, Map<String, Type>> mapForSubTheory = map();
for (Theory subTheory : getTheory().getSubTheories()) {
mapForSubTheory.put(subTheory, map());
}
for (Map.Entry<String, Type> variableNameAndType : getVariableNamesAndTypesForTesting().entrySet()) {
String variableName = variableNameAndType.getKey();
Type type = variableNameAndType.getValue();
for (Theory subTheory : getTheory().getSubTheories()) {
if (subTheory.isSuitableFor(type) || (type instanceof FunctionType && subTheory.isSuitableFor(((FunctionType) type).getCodomain()))) {
mapForSubTheory.get(subTheory).put(variableName, type);
}
}
}
for (Map.Entry<Theory, TheoryTestingSupport> entry : getTheoryToTestingSupport().entrySet()) {
Map<String, Type> forThisSubTheory = mapForSubTheory.get(entry.getKey());
entry.getValue().setVariableNamesAndTypesForTesting(forThisSubTheory);
}
}
use of com.sri.ai.grinder.tester.TheoryTestingSupport in project aic-expresso by aic-sri-international.
the class ExpressionStepSolverToLiteralSplitterStepSolverAdapterTest method testLinearRealArithmeticTheoryWithRandomDisjunctiveFormulas.
@Ignore("Random generation of linear real arithmetic not yet implemented")
@Test
public void testLinearRealArithmeticTheoryWithRandomDisjunctiveFormulas() {
TheoryTestingSupport theoryTestingSupport = TheoryTestingSupport.make(makeRandom(), new LinearRealArithmeticTheory(true, true));
extendTestingVariables("X", theoryTestingSupport, "S", "T", "U", "V", "W");
runRandomDisjunctiveFormulasTest(theoryTestingSupport);
}
use of com.sri.ai.grinder.tester.TheoryTestingSupport in project aic-expresso by aic-sri-international.
the class ExpressionStepSolverToLiteralSplitterStepSolverAdapterTest method testEqualityTheoryWithoutPropagationOfAllLiteralsWhenBoundWithRandomDisjunctiveFormulas.
@Test
public void testEqualityTheoryWithoutPropagationOfAllLiteralsWhenBoundWithRandomDisjunctiveFormulas() {
TheoryTestingSupport theoryTestingSupport = TheoryTestingSupport.make(makeRandom(), new EqualityTheory(true, false));
extendTestingVariables("X", theoryTestingSupport, "S", "T", "U", "V", "W");
runRandomDisjunctiveFormulasTest(theoryTestingSupport);
}
use of com.sri.ai.grinder.tester.TheoryTestingSupport in project aic-expresso by aic-sri-international.
the class ExpressionStepSolverToLiteralSplitterStepSolverAdapterTest method testPropositionalTheoryWithRandomDisjunctiveFormulas.
@Test
public void testPropositionalTheoryWithRandomDisjunctiveFormulas() {
TheoryTestingSupport theoryTestingSupport = TheoryTestingSupport.make(makeRandom(), new PropositionalTheory());
extendTestingVariables("P", theoryTestingSupport, "S", "T", "U", "V", "W", "X", "Y", "Z");
runRandomDisjunctiveFormulasTest(theoryTestingSupport);
}
use of com.sri.ai.grinder.tester.TheoryTestingSupport in project aic-expresso by aic-sri-international.
the class ExpressionStepSolverToLiteralSplitterStepSolverAdapterTest method testEqualityTheoryWithPropagationOfAllLiteralsWhenBoundWithRandomDisjunctiveFormulas.
@Test
public void testEqualityTheoryWithPropagationOfAllLiteralsWhenBoundWithRandomDisjunctiveFormulas() {
TheoryTestingSupport theoryTestingSupport = TheoryTestingSupport.make(makeRandom(), new EqualityTheory(true, true));
extendTestingVariables("X", theoryTestingSupport, "S", "T", "U", "V", "W");
runRandomDisjunctiveFormulasTest(theoryTestingSupport);
}
Aggregations