/** * Uses a VariableReplacer to replace the appropriate variable in the term which is calculated * until now. */ @Override public Definition define(Definition definition) { if (definition == null || definition.getTerm() == null) { return null; } Replacement replacement = new Replacement(definition.getVariable(), definition.getTerm()); VariableReplacer variableReplacer = new VariableReplacer(replacement); wp = variableReplacer.replace(wp); return null; }
/** * Uses a VariableReplacer to replace the appropriate variable in the term which is calculated * until now. */ @Override public Assignment assign(Assignment assignment) { if (assignment == null || assignment.getTerm() == null) { return null; } Replacement replacement = new Replacement(assignment.getVariable(), assignment.getTerm()); VariableReplacer variableReplacer = new VariableReplacer(replacement); wp = variableReplacer.replace(wp); return null; }