Search in sources :

Example 31 with Categorical

use of com.sri.ai.expresso.type.Categorical in project aic-expresso by aic-sri-international.

the class CompoundTheoryWithDifferenceArithmeticTest method testCompleteSatisfiabilitySpecialCases.

@Test
public void testCompleteSatisfiabilitySpecialCases() {
    // This test is to make sure that some more tricky cases are indeed tested,
    // even though hopefully the large amount of generated random problems include them.
    // These are copied from the equality theory test,
    // so it is really just to check whether things hold up
    // if equality theory is embedded in a compound theory.
    String conjunction;
    Expression expected;
    Categorical someType = AbstractTheoryTestingSupport.getDefaultTestingType();
    // need W besides the other defaults -- somehow not doing this in equality theory alone does not cause a problem, probably because the type for W is never needed when we have only equality theory
    Map<String, Type> variableNamesAndTypesForTesting = map("X", someType, "Y", someType, "Z", someType, "W", someType);
    conjunction = "X != a and X != b and X != sometype5 and X != Z and X != W and Z = c and W = d";
    expected = FALSE;
    runCompleteSatisfiabilityTest(conjunction, expected, variableNamesAndTypesForTesting);
    conjunction = "X = Y and X != a and X != b and X != sometype5 and X != Z and X != W and Z = c and W = d";
    expected = FALSE;
    runCompleteSatisfiabilityTest(conjunction, expected, variableNamesAndTypesForTesting);
    conjunction = "X = a and X != b and X != sometype5 and X != Z and X != W and Z = c and W = d";
    expected = parse("(W = d) and (Z = c) and (X = a)");
    runCompleteSatisfiabilityTest(conjunction, expected, variableNamesAndTypesForTesting);
}
Also used : Type(com.sri.ai.expresso.api.Type) Expression(com.sri.ai.expresso.api.Expression) Categorical(com.sri.ai.expresso.type.Categorical) AbstractTheoryTest(com.sri.ai.test.grinder.sgdpllt.theory.base.AbstractTheoryTest) Test(org.junit.Test)

Example 32 with Categorical

use of com.sri.ai.expresso.type.Categorical in project aic-expresso by aic-sri-international.

the class CompoundTheoryWithDifferenceArithmeticTest method testCompleteSatisfiabilitySpecialCases.

@Test
public void testCompleteSatisfiabilitySpecialCases() {
    // This test is to make sure that some more tricky cases are indeed tested,
    // even though hopefully the large amount of generated random problems include them.
    // These are copied from the equality theory test,
    // so it is really just to check whether things hold up
    // if equality theory is embedded in a compound theory.
    String conjunction;
    Expression expected;
    Categorical someType = AbstractTheoryTestingSupport.getDefaultTestingType();
    // need W besides the other defaults -- somehow not doing this in equality theory alone does not cause a problem, probably because the type for W is never needed when we have only equality theory
    Map<String, Type> variableNamesAndTypesForTesting = map("X", someType, "Y", someType, "Z", someType, "W", someType);
    conjunction = "X != a and X != b and X != sometype5 and X != Z and X != W and Z = c and W = d";
    expected = FALSE;
    runCompleteSatisfiabilityTest(conjunction, expected, variableNamesAndTypesForTesting);
    conjunction = "X = Y and X != a and X != b and X != sometype5 and X != Z and X != W and Z = c and W = d";
    expected = FALSE;
    runCompleteSatisfiabilityTest(conjunction, expected, variableNamesAndTypesForTesting);
    conjunction = "X = a and X != b and X != sometype5 and X != Z and X != W and Z = c and W = d";
    expected = parse("(W = d) and (Z = c) and (X = a)");
    runCompleteSatisfiabilityTest(conjunction, expected, variableNamesAndTypesForTesting);
}
Also used : Type(com.sri.ai.expresso.api.Type) Expression(com.sri.ai.expresso.api.Expression) Categorical(com.sri.ai.expresso.type.Categorical) AbstractTheoryTest(com.sri.ai.test.grinder.theory.base.AbstractTheoryTest) Test(org.junit.Test)

Example 33 with Categorical

use of com.sri.ai.expresso.type.Categorical in project aic-expresso by aic-sri-international.

the class GrinderUtil method fromTypeExpressionToItsIntrinsicMeaning.

/**
 * A method mapping type expressions to their intrinsic {@link Type} objects,
 * where "intrinsic" means there is only one possible {@link Type} object
 * for them in the registry of grinder
 * (therefore, it cannot be used for, say, categorical types defined
 * by the user and registered in the registry by name only).
 * Current recognized type expressions are
 * <code>Boolean</code>, <code>Integer</code>, and function applications
 * of the type <code>model..n</code>.
 * If there is no such meaning, the method returns <code>null</code>.
 * @param typeExpression
 * @param registry TODO
 * @return
 */
public static Type fromTypeExpressionToItsIntrinsicMeaning(Expression typeExpression, Registry registry) throws Error {
    Type type;
    if (typeExpression.equals("Boolean")) {
        type = BOOLEAN_TYPE;
    } else if (typeExpression.equals("Integer")) {
        type = INTEGER_TYPE;
    } else if (typeExpression.equals("Real")) {
        type = REAL_TYPE;
    } else if (typeExpression.hasFunctor(INTEGER_INTERVAL) && typeExpression.numberOfArguments() == 2) {
        type = new IntegerInterval(typeExpression.get(0), typeExpression.get(1));
    } else if ((typeExpression.hasFunctor(FunctorConstants.REAL_INTERVAL_CLOSED_CLOSED) || typeExpression.hasFunctor(FunctorConstants.REAL_INTERVAL_OPEN_CLOSED) || typeExpression.hasFunctor(FunctorConstants.REAL_INTERVAL_CLOSED_OPEN) || typeExpression.hasFunctor(FunctorConstants.REAL_INTERVAL_OPEN_OPEN)) && typeExpression.numberOfArguments() == 2) {
        type = new RealInterval(typeExpression.toString());
    } else if (FunctionType.isFunctionType(typeExpression)) {
        Function<Expression, Type> getType = e -> registry.getTypeFromTypeExpression(e);
        Type codomain = getType.apply(FunctionType.getCodomain(typeExpression));
        List<Expression> argumentTypeExpressions = FunctionType.getArgumentList(typeExpression);
        ArrayList<Type> argumentTypes = mapIntoArrayList(argumentTypeExpressions, getType);
        Type[] argumentTypesArray = new Type[argumentTypes.size()];
        type = new FunctionType(codomain, argumentTypes.toArray(argumentTypesArray));
    } else if (TupleType.isTupleType(typeExpression)) {
        List<Type> elementTypes = typeExpression.getArguments().stream().map(elementTypeExpression -> registry.getTypeFromTypeExpression(elementTypeExpression)).collect(Collectors.toList());
        type = new TupleType(elementTypes);
    } else {
        type = null;
    }
    return type;
}
Also used : CountingFormula(com.sri.ai.expresso.api.CountingFormula) FALSE(com.sri.ai.expresso.helper.Expressions.FALSE) INTEGER_INTERVAL(com.sri.ai.grinder.library.FunctorConstants.INTEGER_INTERVAL) Expressions(com.sri.ai.expresso.helper.Expressions) Rational(com.sri.ai.util.math.Rational) SUM(com.sri.ai.grinder.library.FunctorConstants.SUM) Expression(com.sri.ai.expresso.api.Expression) FUNCTION_TYPE(com.sri.ai.grinder.library.FunctorConstants.FUNCTION_TYPE) Util.getFirstSatisfyingPredicateOrNull(com.sri.ai.util.Util.getFirstSatisfyingPredicateOrNull) ExtensionalIndexExpressionsSet(com.sri.ai.expresso.core.ExtensionalIndexExpressionsSet) Symbol(com.sri.ai.expresso.api.Symbol) Equality(com.sri.ai.grinder.library.Equality) TrueContext(com.sri.ai.grinder.core.TrueContext) IndexExpressions(com.sri.ai.grinder.library.indexexpression.IndexExpressions) Map(java.util.Map) Context(com.sri.ai.grinder.api.Context) Util.thereExists(com.sri.ai.util.Util.thereExists) MAX(com.sri.ai.grinder.library.FunctorConstants.MAX) Function(com.google.common.base.Function) DefaultIntensionalMultiSet(com.sri.ai.expresso.core.DefaultIntensionalMultiSet) AbstractExtensionalSet(com.sri.ai.expresso.core.AbstractExtensionalSet) Collection(java.util.Collection) Util.list(com.sri.ai.util.Util.list) RealInterval(com.sri.ai.expresso.type.RealInterval) Set(java.util.Set) Util.mapIntoList(com.sri.ai.util.Util.mapIntoList) IntensionalSet(com.sri.ai.expresso.api.IntensionalSet) IfThenElse(com.sri.ai.grinder.library.controlflow.IfThenElse) Collectors(java.util.stream.Collectors) DefaultPolynomial(com.sri.ai.grinder.polynomial.core.DefaultPolynomial) QuantifiedExpressionWithABody(com.sri.ai.expresso.api.QuantifiedExpressionWithABody) IntegerExpressoType(com.sri.ai.expresso.type.IntegerExpressoType) Util.getFirstOrNull(com.sri.ai.util.Util.getFirstOrNull) List(java.util.List) Predicate(com.google.common.base.Predicate) LESS_THAN(com.sri.ai.grinder.library.FunctorConstants.LESS_THAN) FunctorConstants(com.sri.ai.grinder.library.FunctorConstants) TRUE(com.sri.ai.expresso.helper.Expressions.TRUE) TIMES(com.sri.ai.grinder.library.FunctorConstants.TIMES) IntStream(java.util.stream.IntStream) Tuple(com.sri.ai.expresso.api.Tuple) Categorical(com.sri.ai.expresso.type.Categorical) INFINITY(com.sri.ai.expresso.helper.Expressions.INFINITY) CARDINALITY(com.sri.ai.grinder.library.FunctorConstants.CARDINALITY) Util.mapIntoArrayList(com.sri.ai.util.Util.mapIntoArrayList) IntegerInterval(com.sri.ai.expresso.type.IntegerInterval) Sets(com.sri.ai.grinder.library.set.Sets) ArrayList(java.util.ArrayList) ExtensionalSets(com.sri.ai.grinder.library.set.extensional.ExtensionalSets) EXPONENTIATION(com.sri.ai.grinder.library.FunctorConstants.EXPONENTIATION) TupleType(com.sri.ai.expresso.type.TupleType) Expressions.apply(com.sri.ai.expresso.helper.Expressions.apply) LessThan(com.sri.ai.grinder.library.number.LessThan) Expressions.parse(com.sri.ai.expresso.helper.Expressions.parse) IndexExpressionsSet(com.sri.ai.expresso.api.IndexExpressionsSet) Registry(com.sri.ai.grinder.api.Registry) LinkedList(java.util.LinkedList) Util.arrayList(com.sri.ai.util.Util.arrayList) Util.ifAllTheSameOrNull(com.sri.ai.util.Util.ifAllTheSameOrNull) LambdaExpression(com.sri.ai.expresso.api.LambdaExpression) LESS_THAN_OR_EQUAL_TO(com.sri.ai.grinder.library.FunctorConstants.LESS_THAN_OR_EQUAL_TO) Type(com.sri.ai.expresso.api.Type) FormulaUtil(com.sri.ai.grinder.library.FormulaUtil) Disequality(com.sri.ai.grinder.library.Disequality) MINUS(com.sri.ai.grinder.library.FunctorConstants.MINUS) RealExpressoType(com.sri.ai.expresso.type.RealExpressoType) MINUS_INFINITY(com.sri.ai.expresso.helper.Expressions.MINUS_INFINITY) PLUS(com.sri.ai.grinder.library.FunctorConstants.PLUS) DefaultUniversallyQuantifiedFormula(com.sri.ai.expresso.core.DefaultUniversallyQuantifiedFormula) GREATER_THAN(com.sri.ai.grinder.library.FunctorConstants.GREATER_THAN) Integer.parseInt(java.lang.Integer.parseInt) Beta(com.google.common.annotations.Beta) AbstractExpressionWrapper(com.sri.ai.expresso.helper.AbstractExpressionWrapper) FunctionType(com.sri.ai.expresso.type.FunctionType) GREATER_THAN_OR_EQUAL_TO(com.sri.ai.grinder.library.FunctorConstants.GREATER_THAN_OR_EQUAL_TO) Theory(com.sri.ai.grinder.api.Theory) FunctionApplication(com.sri.ai.expresso.api.FunctionApplication) Expressions.makeSymbol(com.sri.ai.expresso.helper.Expressions.makeSymbol) FunctionIterator.functionIterator(com.sri.ai.util.collect.FunctionIterator.functionIterator) DIVISION(com.sri.ai.grinder.library.FunctorConstants.DIVISION) EMPTY_TUPLE(com.sri.ai.expresso.api.Tuple.EMPTY_TUPLE) Util(com.sri.ai.util.Util) GreaterThan(com.sri.ai.grinder.library.number.GreaterThan) PRODUCT(com.sri.ai.grinder.library.FunctorConstants.PRODUCT) Function(com.google.common.base.Function) IntegerExpressoType(com.sri.ai.expresso.type.IntegerExpressoType) TupleType(com.sri.ai.expresso.type.TupleType) Type(com.sri.ai.expresso.api.Type) RealExpressoType(com.sri.ai.expresso.type.RealExpressoType) FunctionType(com.sri.ai.expresso.type.FunctionType) IntegerInterval(com.sri.ai.expresso.type.IntegerInterval) FunctionType(com.sri.ai.expresso.type.FunctionType) Util.mapIntoArrayList(com.sri.ai.util.Util.mapIntoArrayList) ArrayList(java.util.ArrayList) TupleType(com.sri.ai.expresso.type.TupleType) Util.mapIntoList(com.sri.ai.util.Util.mapIntoList) List(java.util.List) Util.mapIntoArrayList(com.sri.ai.util.Util.mapIntoArrayList) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) Util.arrayList(com.sri.ai.util.Util.arrayList) RealInterval(com.sri.ai.expresso.type.RealInterval)

Example 34 with Categorical

use of com.sri.ai.expresso.type.Categorical in project aic-expresso by aic-sri-international.

the class TypeTest method testIsFinite.

@Test
public void testIsFinite() {
    // 
    // Categorical type tests
    Assert.assertFalse(new Categorical("UnknownCardCatType", -1).isFinite());
    Assert.assertFalse(new Categorical("InfiniteCardCatType", -2).isFinite());
    Assert.assertTrue(new Categorical("CardCatType", 0).isFinite());
    Assert.assertTrue(new Categorical("CardCatType", 100).isFinite());
    // 
    // Integer type tests
    Assert.assertFalse(new IntegerExpressoType().isFinite());
    // 
    // Real type tests
    Assert.assertFalse(new RealExpressoType().isFinite());
    // 
    // Integer Interval type tests
    Assert.assertFalse(new IntegerInterval("Integer").isFinite());
    Assert.assertFalse(new IntegerInterval("integer_Interval(-infinity, inifinity)").isFinite());
    Assert.assertFalse(new IntegerInterval("integer_Interval(-10, inifinity)").isFinite());
    Assert.assertFalse(new IntegerInterval("integer_Interval(-infinity, 10)").isFinite());
    Assert.assertTrue(new IntegerInterval("integer_Interval(-10, 10)").isFinite());
    // 
    // Real Interval type tests
    Assert.assertFalse(new RealInterval("Real").isFinite());
    Assert.assertFalse(new RealInterval("[-infinity;infinity]").isFinite());
    Assert.assertFalse(new RealInterval("[-10;infinity]").isFinite());
    Assert.assertFalse(new RealInterval("[-infinity;10]").isFinite());
    Assert.assertFalse(new RealInterval("[0;1]").isFinite());
    // 
    // Function Type
    Assert.assertFalse(new FunctionType(new IntegerExpressoType()).isFinite());
    Assert.assertFalse(new FunctionType(new RealExpressoType()).isFinite());
    Assert.assertTrue(new FunctionType(new Categorical("Cat", 10)).isFinite());
    Assert.assertTrue(new FunctionType(new IntegerInterval(1, 3)).isFinite());
    Assert.assertFalse(new FunctionType(new IntegerInterval("Integer")).isFinite());
    Assert.assertFalse(new FunctionType(new RealInterval("Real")).isFinite());
    Assert.assertTrue(new FunctionType(new TupleType(new IntegerInterval(1, 3))).isFinite());
    Assert.assertFalse(new FunctionType(new TupleType(new RealInterval("Real"))).isFinite());
    // 
    Assert.assertFalse(new FunctionType(new IntegerExpressoType(), new Categorical("Cat", 10)).isFinite());
    Assert.assertFalse(new FunctionType(new IntegerExpressoType(), new RealExpressoType()).isFinite());
    Assert.assertFalse(new FunctionType(new RealExpressoType(), new IntegerExpressoType()).isFinite());
    Assert.assertFalse(new FunctionType(new Categorical("Cat", 10), new IntegerExpressoType()).isFinite());
    Assert.assertFalse(new FunctionType(new Categorical("Cat", 10), new RealExpressoType()).isFinite());
    Assert.assertFalse(new FunctionType(new IntegerInterval("Integer"), new IntegerExpressoType()).isFinite());
    Assert.assertTrue(new FunctionType(new IntegerInterval(1, 2), new IntegerInterval(3, 5)).isFinite());
    Assert.assertFalse(new FunctionType(new IntegerInterval("Integer"), new RealExpressoType()).isFinite());
    Assert.assertFalse(new FunctionType(new RealInterval("Real")).isFinite());
    Assert.assertFalse(new FunctionType(new RealInterval("Real"), new IntegerExpressoType()).isFinite());
    // 
    // Tuple Type
    Assert.assertFalse(new TupleType(new IntegerExpressoType()).isFinite());
    Assert.assertFalse(new TupleType(new RealExpressoType()).isFinite());
    Assert.assertTrue(new TupleType(new Categorical("Cat", 10)).isFinite());
    Assert.assertTrue(new TupleType(new IntegerInterval(1, 3)).isFinite());
    Assert.assertFalse(new TupleType(new IntegerInterval("Integer")).isFinite());
    Assert.assertFalse(new TupleType(new RealInterval("Real")).isFinite());
    // 
    Assert.assertFalse(new TupleType(new IntegerExpressoType(), new Categorical("Cat", 10)).isFinite());
    Assert.assertFalse(new TupleType(new IntegerExpressoType(), new RealExpressoType()).isFinite());
    Assert.assertFalse(new TupleType(new RealExpressoType(), new IntegerExpressoType()).isFinite());
    Assert.assertFalse(new TupleType(new Categorical("Cat", 10), new IntegerExpressoType()).isFinite());
    Assert.assertFalse(new TupleType(new Categorical("Cat", 10), new RealExpressoType()).isFinite());
    Assert.assertFalse(new TupleType(new IntegerInterval("Integer"), new IntegerExpressoType()).isFinite());
    Assert.assertTrue(new TupleType(new IntegerInterval(1, 2), new IntegerInterval(3, 5)).isFinite());
    Assert.assertFalse(new TupleType(new IntegerInterval("Integer"), new RealExpressoType()).isFinite());
    Assert.assertFalse(new TupleType(new RealInterval("Real")).isFinite());
    Assert.assertFalse(new TupleType(new RealInterval("Real"), new IntegerExpressoType()).isFinite());
}
Also used : IntegerExpressoType(com.sri.ai.expresso.type.IntegerExpressoType) IntegerInterval(com.sri.ai.expresso.type.IntegerInterval) FunctionType(com.sri.ai.expresso.type.FunctionType) RealExpressoType(com.sri.ai.expresso.type.RealExpressoType) TupleType(com.sri.ai.expresso.type.TupleType) Categorical(com.sri.ai.expresso.type.Categorical) RealInterval(com.sri.ai.expresso.type.RealInterval) Test(org.junit.Test)

Example 35 with Categorical

use of com.sri.ai.expresso.type.Categorical in project aic-expresso by aic-sri-international.

the class TypeTest method testIsDiscrete.

@Test
public void testIsDiscrete() {
    // 
    // Categorical type tests
    Assert.assertTrue(new Categorical("UnknownCardCatType", -1).isDiscrete());
    Assert.assertTrue(new Categorical("InfiniteCardCatType", -2).isDiscrete());
    Assert.assertTrue(new Categorical("CardCatType", 0).isDiscrete());
    Assert.assertTrue(new Categorical("CardCatType", 100).isDiscrete());
    // 
    // Integer type tests
    Assert.assertTrue(new IntegerExpressoType().isDiscrete());
    // 
    // Real type tests
    Assert.assertFalse(new RealExpressoType().isDiscrete());
    // 
    // Integer Interval type tests
    Assert.assertTrue(new IntegerInterval("Integer").isDiscrete());
    Assert.assertTrue(new IntegerInterval("integer_Interval(-infinity, inifinity)").isDiscrete());
    Assert.assertTrue(new IntegerInterval("integer_Interval(-10, inifinity)").isDiscrete());
    Assert.assertTrue(new IntegerInterval("integer_Interval(-infinity, 10)").isDiscrete());
    Assert.assertTrue(new IntegerInterval("integer_Interval(-10, 10)").isDiscrete());
    // 
    // Real Interval type tests
    Assert.assertFalse(new RealInterval("Real").isDiscrete());
    Assert.assertFalse(new RealInterval("[-infinity;infinity]").isDiscrete());
    Assert.assertFalse(new RealInterval("[-10;infinity]").isDiscrete());
    Assert.assertFalse(new RealInterval("[-infinity;10]").isDiscrete());
    Assert.assertFalse(new RealInterval("[0;1]").isDiscrete());
    // 
    // Function Type
    Assert.assertTrue(new FunctionType(new IntegerExpressoType()).isDiscrete());
    Assert.assertFalse(new FunctionType(new RealExpressoType()).isDiscrete());
    Assert.assertTrue(new FunctionType(new Categorical("Cat", 10)).isDiscrete());
    Assert.assertTrue(new FunctionType(new IntegerInterval("Integer")).isDiscrete());
    Assert.assertFalse(new FunctionType(new RealInterval("Real")).isDiscrete());
    Assert.assertTrue(new FunctionType(new TupleType(new IntegerExpressoType())).isDiscrete());
    Assert.assertFalse(new FunctionType(new TupleType(new RealInterval("Real"))).isDiscrete());
    // 
    Assert.assertTrue(new FunctionType(new IntegerExpressoType(), new Categorical("Cat", 10)).isDiscrete());
    Assert.assertFalse(new FunctionType(new IntegerExpressoType(), new RealExpressoType()).isDiscrete());
    Assert.assertFalse(new FunctionType(new RealExpressoType(), new IntegerExpressoType()).isDiscrete());
    Assert.assertTrue(new FunctionType(new Categorical("Cat", 10), new IntegerExpressoType()).isDiscrete());
    Assert.assertFalse(new FunctionType(new Categorical("Cat", 10), new RealExpressoType()).isDiscrete());
    Assert.assertTrue(new FunctionType(new IntegerInterval("Integer"), new IntegerExpressoType()).isDiscrete());
    Assert.assertFalse(new FunctionType(new IntegerInterval("Integer"), new RealExpressoType()).isDiscrete());
    Assert.assertFalse(new FunctionType(new RealInterval("Real")).isDiscrete());
    Assert.assertFalse(new FunctionType(new RealInterval("Real"), new IntegerExpressoType()).isDiscrete());
    // 
    // Tuple Type
    Assert.assertTrue(new TupleType().isDiscrete());
    Assert.assertTrue(new TupleType(new IntegerExpressoType()).isDiscrete());
    Assert.assertFalse(new TupleType(new RealExpressoType()).isDiscrete());
    Assert.assertTrue(new TupleType(new Categorical("Cat", 10)).isDiscrete());
    Assert.assertTrue(new TupleType(new IntegerInterval("Integer")).isDiscrete());
    Assert.assertFalse(new TupleType(new RealInterval("Real")).isDiscrete());
    // 
    Assert.assertTrue(new TupleType(new IntegerExpressoType(), new Categorical("Cat", 10)).isDiscrete());
    Assert.assertFalse(new TupleType(new IntegerExpressoType(), new RealExpressoType()).isDiscrete());
    Assert.assertFalse(new TupleType(new RealExpressoType(), new IntegerExpressoType()).isDiscrete());
    Assert.assertTrue(new TupleType(new Categorical("Cat", 10), new IntegerExpressoType()).isDiscrete());
    Assert.assertFalse(new TupleType(new Categorical("Cat", 10), new RealExpressoType()).isDiscrete());
    Assert.assertTrue(new TupleType(new IntegerInterval("Integer"), new IntegerExpressoType()).isDiscrete());
    Assert.assertFalse(new TupleType(new IntegerInterval("Integer"), new RealExpressoType()).isDiscrete());
    Assert.assertFalse(new TupleType(new RealInterval("Real")).isDiscrete());
    Assert.assertFalse(new TupleType(new RealInterval("Real"), new IntegerExpressoType()).isDiscrete());
}
Also used : IntegerExpressoType(com.sri.ai.expresso.type.IntegerExpressoType) IntegerInterval(com.sri.ai.expresso.type.IntegerInterval) FunctionType(com.sri.ai.expresso.type.FunctionType) RealExpressoType(com.sri.ai.expresso.type.RealExpressoType) TupleType(com.sri.ai.expresso.type.TupleType) Categorical(com.sri.ai.expresso.type.Categorical) RealInterval(com.sri.ai.expresso.type.RealInterval) Test(org.junit.Test)

Aggregations

Categorical (com.sri.ai.expresso.type.Categorical)39 Test (org.junit.Test)30 Type (com.sri.ai.expresso.api.Type)19 Expression (com.sri.ai.expresso.api.Expression)13 IntegerInterval (com.sri.ai.expresso.type.IntegerInterval)10 FunctionType (com.sri.ai.expresso.type.FunctionType)6 Expressions.makeSymbol (com.sri.ai.expresso.helper.Expressions.makeSymbol)5 RealInterval (com.sri.ai.expresso.type.RealInterval)5 TupleType (com.sri.ai.expresso.type.TupleType)5 Symbol (com.sri.ai.expresso.api.Symbol)4 IntegerExpressoType (com.sri.ai.expresso.type.IntegerExpressoType)4 RealExpressoType (com.sri.ai.expresso.type.RealExpressoType)4 Registry (com.sri.ai.grinder.api.Registry)4 Context (com.sri.ai.grinder.api.Context)3 DefaultRegistry (com.sri.ai.grinder.core.DefaultRegistry)3 TrueContext (com.sri.ai.grinder.core.TrueContext)3 Beta (com.google.common.annotations.Beta)2 LambdaExpression (com.sri.ai.expresso.api.LambdaExpression)2 Expressions.parse (com.sri.ai.expresso.helper.Expressions.parse)2 AssignmentMapsIterator (com.sri.ai.grinder.helper.AssignmentMapsIterator)2