diff --git a/alpha-core/src/main/java/at/ac/tuwien/kr/alpha/core/actions/ActionExecutionServiceImpl.java b/alpha-core/src/main/java/at/ac/tuwien/kr/alpha/core/actions/ActionExecutionServiceImpl.java index 4067e2182..408cde90e 100644 --- a/alpha-core/src/main/java/at/ac/tuwien/kr/alpha/core/actions/ActionExecutionServiceImpl.java +++ b/alpha-core/src/main/java/at/ac/tuwien/kr/alpha/core/actions/ActionExecutionServiceImpl.java @@ -1,14 +1,14 @@ package at.ac.tuwien.kr.alpha.core.actions; +import at.ac.tuwien.kr.alpha.api.grounder.Substitution; +import at.ac.tuwien.kr.alpha.api.programs.actions.Action; +import at.ac.tuwien.kr.alpha.api.programs.terms.ActionResultTerm; +import at.ac.tuwien.kr.alpha.api.programs.terms.Term; + import java.util.HashMap; import java.util.List; import java.util.Map; -import at.ac.tuwien.kr.alpha.api.programs.terms.Term; -import at.ac.tuwien.kr.alpha.api.programs.terms.FunctionTerm; -import at.ac.tuwien.kr.alpha.api.grounder.Substitution; -import at.ac.tuwien.kr.alpha.api.programs.actions.Action; - public class ActionExecutionServiceImpl implements ActionExecutionService { private final ActionImplementationProvider actionProvider; @@ -18,6 +18,8 @@ public ActionExecutionServiceImpl(ActionImplementationProvider implementationPro this.actionProvider = implementationProvider; } + // TODO possible bug: For two identical rules, the action should only be executed once - test this. + // Note that there may be more answers to this: Formally, a program is a *set* of rules, i.e. duplicate rules are not allowed. @Override public ActionWitness execute(String actionName, int sourceRuleId, Substitution sourceRuleInstance, List inputTerms) { ActionInput actInput = new ActionInput(actionName, sourceRuleId, sourceRuleInstance, inputTerms); @@ -26,7 +28,7 @@ public ActionWitness execute(String actionName, int sourceRuleId, Substitution s private ActionWitness execute(ActionInput input) { Action action = actionProvider.getSupportedActions().get(input.name); - FunctionTerm result = action.execute(input.inputTerms); + ActionResultTerm result = action.execute(input.inputTerms); return new ActionWitness(input.sourceRule, input.instance, input.name, input.inputTerms, result); }