Você está na página 1de 1

Themal Theory,

This theory will hold true with all the element data and look for search
package inference;
import java.util.ArrayList;
public class Rule implements PCExpression {
private SimpleSentence head;
private Goal body;
public Rule(SimpleSentence head) {
this(head, null);
}
public Rule(SimpleSentence head, Goal body) {
this.head = head;
this.body = body;
}
public SimpleSentence getHead() {
return head;
}
public Goal getBody() {
return body;
}
public PCExpression replaceVariables(SubstitutionSet s) throws
CloneNotSupportedException {
ArrayList<Goal> newOperands = new ArrayList<Goal>();
for (int i = 0; i < operandCount(); i++)
newOperands.add((Goal) getOperand(i).replaceVariables(s));
AbstractOperator copy = (AbstractOperator) this.clone();
copy.setOperands(newOperands);
return copy;
}
public String toString()
{
if (body == null)
return head.toString();
return head + " :- " + body;
}
}

Você também pode gostar