at.jku.risc.stout.urauc.data
public class TermNode extends Printable implements Cloneable, Comparable<TermNode>
Modifier and Type | Class and Description |
---|---|
class |
TermNode.TraverseCallBack
This class may be used to
traverse a term tree and
execute an arbitrary operation on every node.
|
Modifier and Type | Field and Description |
---|---|
static int[] |
POSITION_E |
Constructor and Description |
---|
TermNode(TermAtom atom)
Instantiates a new term node with an empty hedge.
|
TermNode(TermAtom atom,
Hedge hedge)
Instantiates a new term node.
|
Modifier and Type | Method and Description |
---|---|
TermNode |
apply(Map<Variable,TermNode> sigma)
Applies a substitution recursively and returns the new
TermNode.
|
TermNode |
clone() |
int |
compareTo(TermNode other)
This compare method treads commutativity by ordered argument sequences.
|
boolean |
equals(Object other) |
TermAtom |
get(int[] position,
int idx) |
TermAtom |
getAtom() |
Hedge |
getHedge() |
int |
hashCode() |
void |
initPosition(int[] parentIndex,
int pos)
Initializes all the position indexes recursively starting with the given
position parentIndex.childPosition.
|
boolean |
isHole()
Tests whether the atom of this term node is the hole.
|
boolean |
isNullAtom()
Tests whether the atom of this term node is the null atom.
|
void |
makeAssociative(Set<TermAtom> associativeSymbols) |
void |
makeCommutative(Set<TermAtom> commutativeSymbols) |
boolean |
nextCommutativeArrangement() |
void |
normalizeVarNames(Map<String,String> renaming) |
void |
print(Writer out) |
TermNode |
replaceHole(TermNode plugIn)
Replaces the hole in this context with the given TermNode
(term | hedge | context).
|
void |
setAtom(TermAtom atom)
Null values are transformed to unique objects which represent the null
value.
|
void |
setHedge(Hedge hedge)
Null values are transformed to unique objects which represent the null
value.
|
void |
setPositionRecurse(int idx,
int value) |
void |
sortCommutative(boolean sortAll) |
TermNode |
substitute(Variable from,
TermNode to)
|
boolean |
traverse(TermNode.TraverseCallBack callBack)
Traverses the term tree and executes the callback function at every node.
|
TermAtomList |
word() |
void |
word(TermAtomList atomList) |
public TermNode(TermAtom atom)
TermNode(TermAtom, Hedge)
public TermNode(TermAtom atom, Hedge hedge)
TermAtom.nullAtom
,
Hedge.nullHedge
public TermNode apply(Map<Variable,TermNode> sigma)
public int compareTo(TermNode other)
compareTo
in interface Comparable<TermNode>
public TermAtom get(int[] position, int idx)
public TermAtom getAtom()
public Hedge getHedge()
public void initPosition(int[] parentIndex, int pos)
public boolean isHole()
public boolean isNullAtom()
public boolean nextCommutativeArrangement()
public void print(Writer out) throws IOException
print
in class Printable
IOException
public void setAtom(TermAtom atom)
TermAtom.nullAtom
public void setHedge(Hedge hedge)
Hedge.nullHedge
public void setPositionRecurse(int idx, int value)
public void sortCommutative(boolean sortAll)
public boolean traverse(TermNode.TraverseCallBack callBack)
TermNode.TraverseCallBack
public TermAtomList word()
public void word(TermAtomList atomList)