Search in sources :

Example 56 with ExtensionalIndexExpressionsSet

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

the class AntlrGrinderParserTest method makeScopingSyntaxTree.

/**
 * Makes a scoping expression out of a list of scoping variables.
 */
public static SyntaxTree makeScopingSyntaxTree(IndexExpressionsSet indexExpressions) {
    List<Expression> indexExpressionsList = ((ExtensionalIndexExpressionsSet) indexExpressions).getList();
    Expression kleeneListExpression = Expressions.makeKleeneListIfNeeded(indexExpressionsList);
    SyntaxTree kleeneListSyntaxTree = kleeneListExpression.getSyntaxTree();
    SyntaxTree result = SyntaxTrees.makeCompoundSyntaxTree(IntensionalSet.SCOPED_VARIABLES_LABEL, kleeneListSyntaxTree);
    return result;
}
Also used : ExtensionalIndexExpressionsSet(com.sri.ai.expresso.core.ExtensionalIndexExpressionsSet) SyntaxTree(com.sri.ai.expresso.api.SyntaxTree) Expression(com.sri.ai.expresso.api.Expression)

Aggregations

Expression (com.sri.ai.expresso.api.Expression)56 ExtensionalIndexExpressionsSet (com.sri.ai.expresso.core.ExtensionalIndexExpressionsSet)56 IndexExpressionsSet (com.sri.ai.expresso.api.IndexExpressionsSet)24 ArrayList (java.util.ArrayList)14 LambdaExpression (com.sri.ai.expresso.api.LambdaExpression)12 IntensionalSet (com.sri.ai.expresso.api.IntensionalSet)10 DefaultLambdaExpression (com.sri.ai.expresso.core.DefaultLambdaExpression)10 IndexExpressions (com.sri.ai.grinder.library.indexexpression.IndexExpressions)8 Type (com.sri.ai.expresso.api.Type)7 Context (com.sri.ai.grinder.api.Context)7 Expressions (com.sri.ai.expresso.helper.Expressions)5 Theory (com.sri.ai.grinder.api.Theory)5 Util (com.sri.ai.util.Util)5 QuantifiedExpression (com.sri.ai.expresso.api.QuantifiedExpression)4 Pair (com.sri.ai.util.base.Pair)4 Collection (java.util.Collection)4 Map (java.util.Map)4 Set (java.util.Set)4 Predicate (com.google.common.base.Predicate)3 Symbol (com.sri.ai.expresso.api.Symbol)3