use of com.sri.ai.grinder.theory.compound.CompoundTheory in project aic-expresso by aic-sri-international.
the class IntensionalSetConditionSimplifierTest method setUp.
@Before
public void setUp() {
context = new TrueContext(new CompoundTheory(new DifferenceArithmeticTheory(false, false), new TupleTheory()));
IntegerInterval nType = new IntegerInterval(1, 10);
context = (Context) GrinderUtil.extendRegistryWith(map("N", nType.toString()), Arrays.asList(nType), context);
simplifier = new IntensionalSetConditionSimplifier();
}
use of com.sri.ai.grinder.theory.compound.CompoundTheory in project aic-expresso by aic-sri-international.
the class DistributeIntersectionOverUnionSimplifierTest method setUp.
@Before
public void setUp() {
context = new TrueContext(new CompoundTheory(new DifferenceArithmeticTheory(false, false), new TupleTheory()));
IntegerInterval intType = new IntegerInterval(1, 10);
context = (Context) GrinderUtil.extendRegistryWith(map("M", intType.toString(), "N", intType.toString()), Arrays.asList(intType), context);
simplifier = new DistributeIntersectionOverUnionSimplifier();
}
use of com.sri.ai.grinder.theory.compound.CompoundTheory in project aic-expresso by aic-sri-international.
the class Tests method main.
public static void main(String[] args) {
// Theory initialization
Theory theory = new CompoundTheory(new EqualityTheory(false, true), new DifferenceArithmeticTheory(false, false), new LinearRealArithmeticTheory(false, false), new TupleTheory(), new PropositionalTheory());
Context context = new TrueContext(theory);
context = context.extendWithSymbolsAndTypes("A", "Boolean");
Model m;
String modelName;
modelName = "Ising Model";
m = new Model(IsingModel(3, 2, context, parse("Boolean")), theory, true);
testFunction(modelName, m, true);
// modelName = "Line Model";
// m = new Model(lineModel(10, context, parse("Boolean")),theory, true);
//
// testFunction(modelName, m,true);
//
// modelName = "Binary Tree Model";
// m = new Model(nTreeModel(4, 2, context, parse("Boolean")),theory, true);
//
// testFunction(modelName, m,true);
//
// modelName = "Random Model";
// m = new Model(ModelGenerator.randomModel(8, 10, context, parse("Boolean")),theory, true);
//
// testFunction(modelName, m,true);
modelName = "Ising Model";
List<List<TupleOfData>> listOdModelsToPrintInFile = new ArrayList<>();
// m = new Model(IsingModel(20, 4, context, parse("Boolean")),theory, true);
// List<InferenceResult> IsingModel2X2 = testing("IsingModel",m,2,2);
// listOdModelsToPrintInFile.add(IsingModel2X2);
// println("ok");
//
// m = new Model(IsingModel(3, 3, context, parse("Boolean")),theory, true);
// List<InferenceResult> IsingModel3X3 = testing("IsingModel",m,3,3);
// listOdModelsToPrintInFile.add(IsingModel3X3);
// println("ok");
//
// m = new Model(IsingModel(3, 4, context, parse("Boolean")),theory, true);
// List<InferenceResult> IsingModel3X4 = testing("IsingModel",m,3,4);
// listOdModelsToPrintInFile.add(IsingModel3X4);
// println("ok");
//
// m = new Model(IsingModel(4, 4, context, parse("Boolean")),theory, true);
// List<InferenceResult> IsingModel4X4 = testing("IsingModel",m,4,4);
// listOdModelsToPrintInFile.add(IsingModel4X4);
// println("ok");
//
// // m = new Model(IsingModel(4, 5, context, parse("Boolean")),theory, true);
// // List<InferenceResult> IsingModel4X5 = testing("IsingModel",m,4,5);
// // listOdModelsToPrintInFile.add(IsingModel4X5);
// // println("ok");
//
// modelName = "Line Model";
// m = new Model(lineModel(20, context, parse("Boolean")),theory, true);
// List<InferenceResult> line10 = testing(modelName,m,4,5);
// listOdModelsToPrintInFile.add(line10);
// println("ok");
modelName = "Binary Tree Model";
m = new Model(IsingModel(4, 4, context, parse("Boolean")), theory, true);
List<TupleOfData> btree = testing(modelName, m, 4, 5);
listOdModelsToPrintInFile.add(btree);
println("ok");
testingAndWritingToFile(modelName + ".csv", listOdModelsToPrintInFile);
}
use of com.sri.ai.grinder.theory.compound.CompoundTheory in project aic-expresso by aic-sri-international.
the class InversionPerformanceEvaluationTest method setUp.
@Before
public void setUp() {
context = new TrueContext(new CompoundTheory(new DifferenceArithmeticTheory(false, false), new EqualityTheory(false, false), new PropositionalTheory(), new TupleTheory()));
updateContextWithIndexAndType("R", GrinderUtil.INTEGER_TYPE);
context.conjoin(parse("R = 1"), context);
}
use of com.sri.ai.grinder.theory.compound.CompoundTheory in project aic-expresso by aic-sri-international.
the class InversionSimplifierTest method setUp.
@Before
public void setUp() {
context = new TrueContext(new CompoundTheory(new DifferenceArithmeticTheory(false, false), new TupleTheory()));
FunctionType gFunctionType = new FunctionType(new IntegerInterval("1..10"), new IntegerInterval("1..10"));
context = (Context) GrinderUtil.extendRegistryWith(map("g", gFunctionType.toString()), Arrays.asList(gFunctionType), context);
simplifier = new InversionSimplifier();
}
Aggregations