Search in sources :

Example 1 with DefaultUniversallyQuantifiedFormula

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

the class GrinderUtil method universallyQuantifyFreeVariables.

/**
	 * Returns a universal quantification of given expression over its free variables,
	 * with types as registered in registry.
	 * @param expression
	 * @param registry
	 * @return
	 */
public static Expression universallyQuantifyFreeVariables(Expression expression, Registry registry) {
    IndexExpressionsSet indexExpressions = getIndexExpressionsOfFreeVariablesIn(expression, registry);
    Expression universallyQuantified = new DefaultUniversallyQuantifiedFormula(indexExpressions, expression);
    return universallyQuantified;
}
Also used : DefaultUniversallyQuantifiedFormula(com.sri.ai.expresso.core.DefaultUniversallyQuantifiedFormula) Expression(com.sri.ai.expresso.api.Expression) LambdaExpression(com.sri.ai.expresso.api.LambdaExpression) ExtensionalIndexExpressionsSet(com.sri.ai.expresso.core.ExtensionalIndexExpressionsSet) IndexExpressionsSet(com.sri.ai.expresso.api.IndexExpressionsSet)

Example 2 with DefaultUniversallyQuantifiedFormula

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

the class Expressions method makeDefaultUniversallyQuantifiedFormulaFromLabelAndSubTrees.

private static Expression makeDefaultUniversallyQuantifiedFormulaFromLabelAndSubTrees(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 DefaultUniversallyQuantifiedFormula(indexExpressions, body);
    return result;
}
Also used : ExtensionalIndexExpressionsSet(com.sri.ai.expresso.core.ExtensionalIndexExpressionsSet) DefaultUniversallyQuantifiedFormula(com.sri.ai.expresso.core.DefaultUniversallyQuantifiedFormula) DefaultLambdaExpression(com.sri.ai.expresso.core.DefaultLambdaExpression) Expression(com.sri.ai.expresso.api.Expression) LambdaExpression(com.sri.ai.expresso.api.LambdaExpression) IndexExpressions(com.sri.ai.grinder.sgdpllt.library.indexexpression.IndexExpressions) ExtensionalIndexExpressionsSet(com.sri.ai.expresso.core.ExtensionalIndexExpressionsSet) IndexExpressionsSet(com.sri.ai.expresso.api.IndexExpressionsSet)

Aggregations

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