Search in sources :

Example 1 with SubExpressionAddress

use of com.sri.ai.expresso.api.SubExpressionAddress in project aic-expresso by aic-sri-international.

the class AbstractExpression method replace.

@Override
public Expression replace(ExpressionAndSyntacticContext replacementAndContext) {
    SubExpressionAddress address = replacementAndContext.getAddress();
    Expression result = address.replace(this, replacementAndContext.getExpression());
    Expression expressionReplacement = result;
    return expressionReplacement;
}
Also used : Expression(com.sri.ai.expresso.api.Expression) SubExpressionAddress(com.sri.ai.expresso.api.SubExpressionAddress)

Example 2 with SubExpressionAddress

use of com.sri.ai.expresso.api.SubExpressionAddress in project aic-expresso by aic-sri-international.

the class AbstractQuantifiedExpression method makeAddressForIndexType.

private ExpressionAndSyntacticContext makeAddressForIndexType(int indexExpressionIndex, Expression type) {
    SubExpressionAddress address = new IndexExpressionTypeSubExpressionAddress(indexExpressionIndex);
    ExpressionAndSyntacticContext expressionAndSyntacticContext = new DefaultExpressionAndSyntacticContext(type, address);
    return expressionAndSyntacticContext;
}
Also used : ExpressionAndSyntacticContext(com.sri.ai.expresso.api.ExpressionAndSyntacticContext) SubExpressionAddress(com.sri.ai.expresso.api.SubExpressionAddress)

Example 3 with SubExpressionAddress

use of com.sri.ai.expresso.api.SubExpressionAddress in project aic-expresso by aic-sri-international.

the class AbstractQuantifiedExpression method makeAddressForIndexArgument.

private ExpressionAndSyntacticContext makeAddressForIndexArgument(int indexExpressionIndex, Expression index, int argumentIndex) {
    SubExpressionAddress address = new IndexExpressionArgumentSubExpressionAddress(indexExpressionIndex, argumentIndex);
    ExpressionAndSyntacticContext expressionAndSyntacticContext = new DefaultExpressionAndSyntacticContext(index.get(argumentIndex), address);
    return expressionAndSyntacticContext;
}
Also used : ExpressionAndSyntacticContext(com.sri.ai.expresso.api.ExpressionAndSyntacticContext) SubExpressionAddress(com.sri.ai.expresso.api.SubExpressionAddress)

Aggregations

SubExpressionAddress (com.sri.ai.expresso.api.SubExpressionAddress)3 ExpressionAndSyntacticContext (com.sri.ai.expresso.api.ExpressionAndSyntacticContext)2 Expression (com.sri.ai.expresso.api.Expression)1