|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecttom.library.sl.Position
public class Position
Object that represents a position in a term
| Constructor Summary | |
|---|---|
Position()
|
|
Position(int[] omega)
|
|
Position(Position prefix,
Position suffix)
|
|
| Method Summary | |
|---|---|
Path |
add(Path p)
Computes the path from the source of this to the target of the parameter p. |
Position |
changePrefix(Position oldprefix,
Position newprefix)
|
java.lang.Object |
clone()
|
int |
compare(Path path)
Compares two positions |
Path |
conc(int i)
Add the move i to the begining of the current path |
int |
depth()
Get the depth of the position in the tree |
Position |
down(int i)
For compatibility with mutraveler positions |
boolean |
equals(java.lang.Object o)
Tests if two positions are equals |
Path |
getCanonicalPath()
Gives the canonical form of a path. |
int |
getHead()
Gives the first move of the path which is represented by an integer i. |
Strategy |
getOmega(Strategy v)
create s=omega(v) such that s[subject] returns subject[ s[subject|omega] ]|omega |
Strategy |
getOmegaPath(Strategy v)
create s=omegaPath(v) such that s[subject] applies s to all nodes in the path of omega in a bottom-up way |
Strategy |
getReplace(Visitable t)
create s=omega(x->t) such that s[subject] returns subject[t]|omega |
Strategy |
getSubterm()
create s=x->t|omega such that s[subject] returns subject|omega |
Position |
getSuffix(Position prefix)
|
Path |
getTail()
Gives the tail of the path which is also a path. |
int |
hashCode()
|
boolean |
hasPrefix(Position prefix)
|
Path |
inverse()
Computes the path from the target of this to the source of this. |
int |
length()
Computes the length which corresponds to the number of moves needed to go from the source to the target. |
static Position |
make(Path p)
|
Path |
sub(Path p)
Computes the path from the target of this to the target of the parameter p. |
int[] |
toArray()
|
java.lang.String |
toString()
Returns a String object representing the position. |
Position |
up()
For compatibility with mutraveler positions |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Position()
public Position(int[] omega)
public Position(Position prefix,
Position suffix)
| Method Detail |
|---|
public int[] toArray()
public java.lang.Object clone()
clone in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int depth()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int compare(Path path)
public Strategy getOmega(Strategy v)
v - strategy subterm of the omega strategy
public Strategy getOmegaPath(Strategy v)
v - strategy subterm of the omega strategy
public Strategy getReplace(Visitable t)
t - the constant term that should replace the subterm
public Strategy getSubterm()
public java.lang.String toString()
String object representing the position.
The string representation consists of a list of elementary positions
toString in class java.lang.Objectpublic Path add(Path p)
Path
t1.add(t2) = (t1.getTail().add(t2)).conc(t1.getHead()) if t1.length()>0,
t1.add(t2) = t2 otherwise.
add in interface Pathp - the path to add.
public Path sub(Path p)
Path
t1.sub(t2) = t2.inv().add(t1),
sub in interface Pathp - the path to subtract.
public Path inverse()
Path
t.inv() = t.getTail().inv().add(-t.getHead()) if t1.length()>0,
t.inv() = t otherwise
inverse in interface Pathpublic static Position make(Path p)
public int length()
Path
length in interface Pathpublic int getHead()
Path
getHead in interface Pathpublic Path getTail()
Path
getTail in interface Pathpublic Path conc(int i)
Path
conc in interface Pathi - the move to insert.
public Position up()
public Position down(int i)
public Path getCanonicalPath()
Path
getCanonicalPath in interface Pathpublic boolean hasPrefix(Position prefix)
public Position getSuffix(Position prefix)
public Position changePrefix(Position oldprefix,
Position newprefix)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||