|
|||||||||
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
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 prefix)
|
Object |
clone()
|
int |
compare(Path path)
Compares two positions |
Path |
conc(int i)
Add the move i to the end of the current path |
Position |
down(int i)
|
boolean |
equals(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(Object 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 |
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()
Get the length of the position in the tree |
static Position |
make()
|
static Position |
makeFromArray(int[] array)
|
static Position |
makeFromPath(Path p)
|
static Position |
makeFromSubarray(int[] src,
int srcIndex,
int length)
|
Path |
sub(Path p)
Computes the path from the target of this to the target of the parameter p. |
int[] |
toIntArray()
|
String |
toString()
Returns a String object representing the position. |
Position |
up()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static Position make()
public static Position makeFromSubarray(int[] src, int srcIndex, int length)
public static Position makeFromArray(int[] array)
public static Position makeFromPath(Path p)
public Object clone()
clone
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
public int compare(Path path)
public String toString()
String
object representing the position.
The string representation consists of a list of elementary positions
toString
in class Object
public 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 Path
p
- the path to add.
public Path sub(Path p)
Path
t1.sub(t2) = t2.inverse().add(t1),
sub
in interface Path
p
- the path to subtract.
public Path inverse()
Path
t.inverse() = t.getTail().inverse().add(-t.getHead()) if t.length()>0,
t.inverse() = t
otherwise
inverse
in interface Path
public int length()
length
in interface Path
public int getHead()
Path
getHead
in interface Path
public Path getTail()
Path
getTail
in interface Path
public Path conc(int i)
Path
conc
in interface Path
i
- the move to insert.
public Path getCanonicalPath()
Path
getCanonicalPath
in interface Path
public int[] toIntArray()
toIntArray
in interface Path
public Position up()
public Position down(int i)
public boolean hasPrefix(Position prefix)
public Position changePrefix(Position oldprefix, Position prefix)
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(Object t)
t
- the constant term that should replace the subterm
public Strategy getSubterm()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |