|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Path
Represent a path between two locations in a term. The implementations of this class must define several algebraic operations on these paths (i.e. addition, subtraction, inverse).
Method Summary | |
---|---|
Path |
add(Path p)
Computes the path from the source of this to the target of the parameter p. |
Path |
conc(int i)
Add the move i to the end of the current path |
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. |
Path |
getTail()
Gives the tail of the path which is also a path. |
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. |
Path |
sub(Path p)
Computes the path from the target of this to the target of the parameter p. |
int[] |
toIntArray()
|
Method Detail |
---|
Path add(Path p)
t1.add(t2) = (t1.getTail().add(t2)).conc(t1.getHead()) if t1.length()>0,
t1.add(t2) = t2
otherwise.
p
- the path to add.
Path sub(Path p)
t1.sub(t2) = t2.inverse().add(t1),
p
- the path to subtract.
Path inverse()
t.inverse() = t.getTail().inverse().add(-t.getHead()) if t.length()>0,
t.inverse() = t
otherwise
Path getCanonicalPath()
int length()
int getHead()
Path getTail()
Path conc(int i)
i
- the move to insert.
int[] toIntArray()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |