Search in sources :

Example 21 with RealInterval

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

the class AbstractSingleVariableLinearRealArithmeticConstraintFeasibilityRegionStepSolver method getTypeLowerBoundAndStrictness.

protected Pair<Expression, Boolean> getTypeLowerBoundAndStrictness(Context context) {
    if (typeLowerBoundAndStrictness == null) {
        RealInterval type = getType(context);
        Expression lowerBound = type.getLowerBound();
        typeLowerBoundAndStrictness = pair(lowerBound, type.lowerBoundIsOpen());
    }
    return typeLowerBoundAndStrictness;
}
Also used : Expression(com.sri.ai.expresso.api.Expression) RealInterval(com.sri.ai.expresso.type.RealInterval)

Example 22 with RealInterval

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

the class AbstractSingleVariableLinearRealArithmeticConstraintFeasibilityRegionStepSolver method getTypeUpperBoundAndStrictness.

protected Pair<Expression, Boolean> getTypeUpperBoundAndStrictness(Context context) {
    if (typeUpperBoundAndStrictess == null) {
        RealInterval type = getType(context);
        Expression upperBound = type.getUpperBound();
        typeUpperBoundAndStrictess = pair(upperBound, type.upperBoundIsOpen());
    }
    return typeUpperBoundAndStrictess;
}
Also used : Expression(com.sri.ai.expresso.api.Expression) RealInterval(com.sri.ai.expresso.type.RealInterval)

Example 23 with RealInterval

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

the class AbstractSingleVariableLinearRealArithmeticConstraintFeasibilityRegionStepSolver method getTypeUpperBoundAndStrictness.

protected Pair<Expression, Boolean> getTypeUpperBoundAndStrictness(Context context) {
    if (typeUpperBoundAndStrictess == null) {
        RealInterval type = getType(context);
        Expression upperBound = type.getUpperBound();
        typeUpperBoundAndStrictess = pair(upperBound, type.upperBoundIsOpen());
    }
    return typeUpperBoundAndStrictess;
}
Also used : Expression(com.sri.ai.expresso.api.Expression) RealInterval(com.sri.ai.expresso.type.RealInterval)

Example 24 with RealInterval

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

the class AbstractSingleVariableLinearRealArithmeticConstraintFeasibilityRegionStepSolver method getTypeLowerBoundAndStrictness.

protected Pair<Expression, Boolean> getTypeLowerBoundAndStrictness(Context context) {
    if (typeLowerBoundAndStrictness == null) {
        RealInterval type = getType(context);
        Expression lowerBound = type.getLowerBound();
        typeLowerBoundAndStrictness = pair(lowerBound, type.lowerBoundIsOpen());
    }
    return typeLowerBoundAndStrictness;
}
Also used : Expression(com.sri.ai.expresso.api.Expression) RealInterval(com.sri.ai.expresso.type.RealInterval)

Example 25 with RealInterval

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

the class SingleVariableLinearRealArithmeticConstraint method getType.

/**
 * Returns the {@link RealInterval} type of the constraint's variable.
 * @param context
 * @return
 */
public RealInterval getType(Context context) {
    if (cachedType == null) {
        Expression variableTypeExpression = getVariableTypeExpression(context);
        Type type = context.getTypeFromTypeExpression(variableTypeExpression);
        if (type instanceof RealExpressoType) {
            cachedType = new RealInterval("]-infinity;infinity[");
        // represents Real as real interval for uniformity
        } else {
            cachedType = (RealInterval) type;
        }
    }
    return cachedType;
}
Also used : Type(com.sri.ai.expresso.api.Type) RealExpressoType(com.sri.ai.expresso.type.RealExpressoType) Expression(com.sri.ai.expresso.api.Expression) RealExpressoType(com.sri.ai.expresso.type.RealExpressoType) RealInterval(com.sri.ai.expresso.type.RealInterval)

Aggregations

RealInterval (com.sri.ai.expresso.type.RealInterval)32 Expression (com.sri.ai.expresso.api.Expression)22 RealExpressoType (com.sri.ai.expresso.type.RealExpressoType)17 Type (com.sri.ai.expresso.api.Type)12 IntegerInterval (com.sri.ai.expresso.type.IntegerInterval)12 FunctionType (com.sri.ai.expresso.type.FunctionType)11 IntegerExpressoType (com.sri.ai.expresso.type.IntegerExpressoType)8 Test (org.junit.Test)8 IntensionalSet (com.sri.ai.expresso.api.IntensionalSet)7 TupleType (com.sri.ai.expresso.type.TupleType)7 SingleVariableLinearRealArithmeticConstraint (com.sri.ai.grinder.theory.linearrealarithmetic.SingleVariableLinearRealArithmeticConstraint)6 IndexExpressionsSet (com.sri.ai.expresso.api.IndexExpressionsSet)5 ExtensionalIndexExpressionsSet (com.sri.ai.expresso.core.ExtensionalIndexExpressionsSet)5 Categorical (com.sri.ai.expresso.type.Categorical)5 Rational (com.sri.ai.util.math.Rational)5 Context (com.sri.ai.grinder.api.Context)4 Context (com.sri.ai.grinder.sgdpllt.api.Context)4 SingleVariableLinearRealArithmeticConstraint (com.sri.ai.grinder.sgdpllt.theory.linearrealarithmetic.SingleVariableLinearRealArithmeticConstraint)4 TrueContext (com.sri.ai.grinder.core.TrueContext)3 SingleVariableDifferenceArithmeticConstraint (com.sri.ai.grinder.theory.differencearithmetic.SingleVariableDifferenceArithmeticConstraint)3