|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--alice.logictuple.LogicTuple
Defines the communication language based on logic tuples, which stand both for tuple and tuple template For logic tuple, the matching is the classic prolog matching and the propagation corresponds to unification. A logic tuple is like a Prolog term, usually a Prolog structure characterized by a name and 0 or more argument (which in this case are objects of the class TupleArgument)
TupleArgument,
Tuple,
TupleTemplate, Serialized Form| Constructor Summary | |
LogicTuple()
|
|
LogicTuple(java.lang.String name)
Constructs the logic tuple providing the tuple name, without arguments |
|
LogicTuple(java.lang.String name,
TupleArgument t1)
Constructs the logic tuple providing the tuple name and one argument |
|
LogicTuple(java.lang.String name,
TupleArgument[] list)
Constructs the logic tuple providing the tuple name and argument list |
|
LogicTuple(java.lang.String name,
TupleArgument t1,
TupleArgument t2)
Constructs the logic tuple providing the tuple name and two arguments |
|
LogicTuple(java.lang.String name,
TupleArgument t1,
TupleArgument t2,
TupleArgument t3)
Constructs the logic tuple providing the tuple name and three arguments |
|
LogicTuple(java.lang.String name,
TupleArgument t1,
TupleArgument t2,
TupleArgument t3,
TupleArgument t4)
Constructs the logic tuple providing the tuple name and four arguments |
|
LogicTuple(java.lang.String name,
TupleArgument t1,
TupleArgument t2,
TupleArgument t3,
TupleArgument t4,
TupleArgument t5)
Constructs the logic tuple providing the tuple name and five arguments |
|
LogicTuple(java.lang.String name,
TupleArgument t1,
TupleArgument t2,
TupleArgument t3,
TupleArgument t4,
TupleArgument t5,
TupleArgument t6)
Constructs the logic tuple providing the tuple name and six arguments |
|
LogicTuple(java.lang.String name,
TupleArgument t1,
TupleArgument t2,
TupleArgument t3,
TupleArgument t4,
TupleArgument t5,
TupleArgument t6,
TupleArgument t7)
Constructs the logic tuple providing the tuple name and seven arguments |
|
LogicTuple(alice.tuprolog.Term t)
Constructs the logic tuple from a tuprolog term |
|
LogicTuple(TupleArgument t)
Constructs the logic tuple from a tuple argument (it's the most free form of construction) |
|
| Method Summary | |
TupleArgument |
getArg(int index)
Gets a argument inside the logic tuple |
int |
getArity()
Gets the number of argument of the logic tuple |
float |
getFloat(int index)
Helper service to get directly a float argument inside the logic tuple |
int |
getInt(int index)
Helper service to get directly an integer argument inside the logic tuple |
java.lang.String |
getName()
Gets the name of the logic tuple |
java.lang.String |
getString(int index)
Helper service to get directly a string argument inside the logic tuple |
boolean |
match(Tuple t)
Specifies if a logic tuple (as a tuple template) matches with a specified tuple, typically an other logic tuple |
static LogicTuple |
parse(java.lang.String st)
Static service to get a Logic tuple from a textual representation |
boolean |
propagate(Tuple t)
Tries to unify a logic tuple (as a tuple template) with a specified tuple, typically an other logic tuple |
java.lang.String |
toString()
Gets the string representation of the logic tuple |
alice.tuprolog.Term |
toTerm()
Gets the Term representation of the logic tuple |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public LogicTuple(java.lang.String name,
TupleArgument[] list)
name - the name of the tuple (the functor)list - the list of tuple argumentpublic LogicTuple(java.lang.String name)
name - the name of the tuple (the functor)
public LogicTuple(java.lang.String name,
TupleArgument t1)
name - the name of the tuple (the functor)t1 - the tuple argument
public LogicTuple(java.lang.String name,
TupleArgument t1,
TupleArgument t2)
name - the name of the tuple (the functor)t1 - the first tuple argumentt2 - the second tuple argument
public LogicTuple(java.lang.String name,
TupleArgument t1,
TupleArgument t2,
TupleArgument t3)
name - the name of the tuple (the functor)t1 - the first tuple argumentt2 - the second tuple argumentt3 - the third tuple argument
public LogicTuple(java.lang.String name,
TupleArgument t1,
TupleArgument t2,
TupleArgument t3,
TupleArgument t4)
name - the name of the tuple (the functor)t1 - the first tuple argumentt2 - the second tuple argumentt3 - the third tuple argumentt4 - the fourth tuple argument
public LogicTuple(java.lang.String name,
TupleArgument t1,
TupleArgument t2,
TupleArgument t3,
TupleArgument t4,
TupleArgument t5)
name - the name of the tuple (the functor)t1 - the first tuple argumentt2 - the second tuple argumentt3 - the third tuple argumentt4 - the fourth tuple argumentt5 - the fifth tuple argument
public LogicTuple(java.lang.String name,
TupleArgument t1,
TupleArgument t2,
TupleArgument t3,
TupleArgument t4,
TupleArgument t5,
TupleArgument t6)
name - the name of the tuple (the functor)t1 - the first tuple argumentt2 - the second tuple argumentt3 - the third tuple argumentt4 - the fourth tuple argumentt5 - the fifth tuple argumentt6 - the sixth tuple argument
public LogicTuple(java.lang.String name,
TupleArgument t1,
TupleArgument t2,
TupleArgument t3,
TupleArgument t4,
TupleArgument t5,
TupleArgument t6,
TupleArgument t7)
name - the name of the tuple (the functor)t1 - the first tuple argumentt2 - the second tuple argumentt3 - the third tuple argumentt4 - the fourth tuple argumentt5 - the fifth tuple argumentt6 - the sixth tuple argumentt7 - the seventh tuple argumentpublic LogicTuple(TupleArgument t)
t - the tuple argumentpublic LogicTuple(alice.tuprolog.Term t)
t - the tuprolog termpublic LogicTuple()
| Method Detail |
public int getArity()
public java.lang.String getName()
public TupleArgument getArg(int index)
index - the position (index) of the argumentnull otherwisepublic java.lang.String getString(int index)
index - the position (index) of the string argumentnull otherwisepublic int getInt(int index)
index - the position (index) of the integer argumentpublic float getFloat(int index)
index - the position (index) of the float argumentpublic alice.tuprolog.Term toTerm()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean match(Tuple t)
match in interface TupleTemplatet - the matching tupletrue if there is matching, false otherwisepublic boolean propagate(Tuple t)
propagate in interface TupleTemplatet - the matching tupletrue if the propagation was successfull,
false otherwise
public static LogicTuple parse(java.lang.String st)
throws InvalidLogicTupleException
st - the text representing the tupleInvalidLogicTupleException - if the text does not represent a valid logic tuple
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||