Search in sources :

Example 1 with DefaultLambdaExpression

use of com.sri.ai.expresso.core.DefaultLambdaExpression in project aic-expresso by aic-sri-international.

the class TupleQuantifierSimplifier method rewriteLambdaExpression.

private static Expression rewriteLambdaExpression(LambdaExpression lambdaExpression, Map<Expression, Expression> indexToTypeMap, Map<Expression, Expression> indexToTupleOfVars, Context context) {
    Pair<IndexExpressionsSet, Expression> updatePair = update(lambdaExpression.getBody(), indexToTypeMap, indexToTupleOfVars, context);
    Expression result = new DefaultLambdaExpression(updatePair.first, updatePair.second);
    return result;
}
Also used : DefaultLambdaExpression(com.sri.ai.expresso.core.DefaultLambdaExpression) Expression(com.sri.ai.expresso.api.Expression) LambdaExpression(com.sri.ai.expresso.api.LambdaExpression) QuantifiedExpression(com.sri.ai.expresso.api.QuantifiedExpression) DefaultLambdaExpression(com.sri.ai.expresso.core.DefaultLambdaExpression) ExtensionalIndexExpressionsSet(com.sri.ai.expresso.core.ExtensionalIndexExpressionsSet) IndexExpressionsSet(com.sri.ai.expresso.api.IndexExpressionsSet)

Example 2 with DefaultLambdaExpression

use of com.sri.ai.expresso.core.DefaultLambdaExpression in project aic-expresso by aic-sri-international.

the class Expressions method makeDefaultLambdaExpressionFromLabelAndSubTrees.

private static Expression makeDefaultLambdaExpressionFromLabelAndSubTrees(Object label, Object[] subTreeObjects) {
    ArrayList<Expression> subTreeExpressions = Util.mapIntoArrayList(subTreeObjects, Expressions::makeFromObject);
    Expression indexExpressionsKleeneList = subTreeExpressions.get(0);
    IndexExpressionsSet indexExpressions = new ExtensionalIndexExpressionsSet(ensureListFromKleeneList(indexExpressionsKleeneList));
    Expression body = subTreeExpressions.get(1);
    Expression result = new DefaultLambdaExpression(indexExpressions, body);
    return result;
}
Also used : ExtensionalIndexExpressionsSet(com.sri.ai.expresso.core.ExtensionalIndexExpressionsSet) DefaultLambdaExpression(com.sri.ai.expresso.core.DefaultLambdaExpression) Expression(com.sri.ai.expresso.api.Expression) LambdaExpression(com.sri.ai.expresso.api.LambdaExpression) DefaultLambdaExpression(com.sri.ai.expresso.core.DefaultLambdaExpression) IndexExpressions(com.sri.ai.grinder.library.indexexpression.IndexExpressions) ExtensionalIndexExpressionsSet(com.sri.ai.expresso.core.ExtensionalIndexExpressionsSet) IndexExpressionsSet(com.sri.ai.expresso.api.IndexExpressionsSet)

Example 3 with DefaultLambdaExpression

use of com.sri.ai.expresso.core.DefaultLambdaExpression in project aic-expresso by aic-sri-international.

the class TupleQuantifierSimplifier method rewriteLambdaExpression.

private static Expression rewriteLambdaExpression(LambdaExpression lambdaExpression, Map<Expression, Expression> indexToTypeMap, Map<Expression, Expression> indexToTupleOfVars, Context context) {
    Pair<IndexExpressionsSet, Expression> updatePair = update(lambdaExpression.getBody(), indexToTypeMap, indexToTupleOfVars, context);
    Expression result = new DefaultLambdaExpression(updatePair.first, updatePair.second);
    return result;
}
Also used : DefaultLambdaExpression(com.sri.ai.expresso.core.DefaultLambdaExpression) Expression(com.sri.ai.expresso.api.Expression) LambdaExpression(com.sri.ai.expresso.api.LambdaExpression) QuantifiedExpression(com.sri.ai.expresso.api.QuantifiedExpression) DefaultLambdaExpression(com.sri.ai.expresso.core.DefaultLambdaExpression) ExtensionalIndexExpressionsSet(com.sri.ai.expresso.core.ExtensionalIndexExpressionsSet) IndexExpressionsSet(com.sri.ai.expresso.api.IndexExpressionsSet)

Aggregations

Expression (com.sri.ai.expresso.api.Expression)3 IndexExpressionsSet (com.sri.ai.expresso.api.IndexExpressionsSet)3 LambdaExpression (com.sri.ai.expresso.api.LambdaExpression)3 DefaultLambdaExpression (com.sri.ai.expresso.core.DefaultLambdaExpression)3 ExtensionalIndexExpressionsSet (com.sri.ai.expresso.core.ExtensionalIndexExpressionsSet)3 QuantifiedExpression (com.sri.ai.expresso.api.QuantifiedExpression)2 IndexExpressions (com.sri.ai.grinder.library.indexexpression.IndexExpressions)1