public class Equal extends Object implements Clause
Clause.
Equal clauses are useless as the use of constants or identical variables replaces it. The purpose of this class is to represent negative equalities.
| Modifier and Type | Field and Description |
|---|---|
(package private) Unifiable |
operand1 |
(package private) Unifiable |
operand2 |
| Constructor and Description |
|---|
Equal(Unifiable operand1,
Unifiable operand2)
Constructor of the class
|
| Modifier and Type | Method and Description |
|---|---|
Unifiable |
getOperand1()
Gets the left operand of the equal sentence.
|
Unifiable |
getOperand2()
Gets the right operand of the equal sentence.
|
EqualSolutionNode |
getSolver(RuleSet rules,
SubstitutionSet parentSolution,
AbstractSolutionNode parentNode)
Creates a solver which is a node in the tree proof.
|
Equal |
replaceVariables(SubstitutionSet s)
Replaces all the variables in the equal clause according to the
specified bindings.
|
Equal |
standardizeVariablesApart(Hashtable<Variable,Variable> newVars)
Standardizes the variables in order to be sure that there won't be any
variable clashes.
|
String |
toString()
Returns the equal clause under the form of:
"operand1 == operand2".
|
public Unifiable getOperand1()
public Unifiable getOperand2()
public EqualSolutionNode getSolver(RuleSet rules, SubstitutionSet parentSolution, AbstractSolutionNode parentNode)
This function is recursive over all objects that can be proved and creates the tree of proof for a clause.
getSolver in interface Clauserules - the RuleSet object containing the rules of knowledge.parentSolution - the solution known so far at the parent node.parentNode - the parent node in the tree.Clause.getSolver(RuleSet, SubstitutionSet, AbstractSolutionNode)public Equal replaceVariables(SubstitutionSet s)
This method is recursive over all PCExpression implementations.
replaceVariables in interface PCExpressions - the SubstitutionSet that contains the bindings of the
variables so far.Equal object representing the bound equal clause.PCExpression.replaceVariables(model.SubstitutionSet)public Equal standardizeVariablesApart(Hashtable<Variable,Variable> newVars)
This method is recursive over all PCExpression implementations.
standardizeVariablesApart in interface PCExpressionnewVars - is a parameter to save over the recursion all the variable
replacements done so far.Equal object representing the standardized
equal clause.PCExpression.standardizeVariablesApart(java.util.Hashtable)public String toString()
toString in class ObjectObject.toString()