use of com.sri.ai.expresso.type.IntegerInterval in project aic-expresso by aic-sri-international.
the class IntersectionIntensionalSetsSimplifierTest 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 IntersectionIntensionalSetsSimplifier();
}
use of com.sri.ai.expresso.type.IntegerInterval in project aic-expresso by aic-sri-international.
the class IntersectionExtensionalSetSimplifierTest 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 IntersectionExtensionalSetSimplifier();
}
use of com.sri.ai.expresso.type.IntegerInterval 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();
}
use of com.sri.ai.expresso.type.IntegerInterval 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.expresso.type.IntegerInterval in project aic-expresso by aic-sri-international.
the class SingleVariableDifferenceArithmeticConstraint method getType.
/**
* Returns the {@link IntegerInterval} type of the constraint's variable.
* @param context
* @return
*/
public IntegerInterval getType(Context context) {
if (cachedType == null) {
Expression variableTypeExpression = getVariableTypeExpression(context);
Type type = context.getType(variableTypeExpression);
if (type instanceof IntegerExpressoType) {
cachedType = new IntegerInterval("-infinity..infinity");
// represents Integer as integer interval for uniformity
} else {
cachedType = (IntegerInterval) type;
}
}
return cachedType;
}
Aggregations