|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.aspic.inference.Element
org.aspic.inference.Constant
public class Constant
A Constant
is the simplest sub-class of Element
.
It encapsulates a functor
that can be used to represent a prolog grounded atom.
Constructor Summary | |
---|---|
Constant()
Default Constructor. |
|
Constant(java.lang.String functor)
Typical constructor. |
Method Summary | |
---|---|
Constant |
apply(Substitution subs)
Return copy of this Element with the substitution applied. |
java.lang.Object |
clone()
An element is incompletely cloned. |
boolean |
equals(java.lang.Object o)
|
java.lang.String |
getFunctor()
Simple getter for functor. |
int |
hashCode()
|
java.lang.String |
inspect()
(idea from the Ruby prototype) inspect allows us to see a representation of the text expression that the object is based on. |
boolean |
isEqualModuloVariables(Element testClause)
Check to see if this Element matches another, bar Variable names i.e. |
boolean |
isGrounded()
Check for free variables |
boolean |
isUnifiable(Element toUnify)
Return true if this Element can be unified with the passed Element. |
Constant |
negation()
Get's the negation of this constant, a Term with functor
"~", and parameters (functor ). |
java.lang.String |
ruleTag()
Used as the key in KnowledgeBase.rulesMap. |
void |
setFunctor(java.lang.String functor)
Simple setter of functor. |
Substitution |
unify(Element toUnify,
Substitution subs)
Try to unify this Element with another Element, using passed substitution as a starting point. |
void |
write(KnowledgeWriter writer)
Using the Visitor pattern, this method allows the details of an Element to be written in different ways. |
Methods inherited from class org.aspic.inference.Element |
---|
getId, getKnowledgeBase, setId, setKnowledgeBase, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Constant()
public Constant(java.lang.String functor)
functor
- Method Detail |
---|
public java.lang.String getFunctor()
public void setFunctor(java.lang.String functor)
functor
- new functor.public Constant negation()
Term
with functor
"~", and parameters (functor
).
public java.lang.String inspect()
Element
inspect
in class Element
public Constant apply(Substitution subs)
Element
apply
in class Element
subs
- Substitution to apply
public boolean isUnifiable(Element toUnify)
Element
isUnifiable
in class Element
public Substitution unify(Element toUnify, Substitution subs)
Element
unify
in class Element
toUnify
- Element to be unified with this Elementsubs
- starting substitution
public boolean isEqualModuloVariables(Element testClause)
Element
testClause
- Element to checked against this one.
public boolean isGrounded()
Element
public java.lang.String ruleTag()
public void write(KnowledgeWriter writer)
Element
write
in class Element
writer
- the object that does the writing.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Element
clone
in class Element
java.lang.CloneNotSupportedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |