|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttuffy.mln.Predicate
public class Predicate
Predicate in First Order Logic.
Field Summary | |
---|---|
boolean |
isCurrentlyView
|
Constructor Summary | |
---|---|
Predicate(MarkovLogicNetwork mln,
java.lang.String aname,
boolean aClosedWorld)
Constructor of Predicate. |
Method Summary | |
---|---|
void |
addDependentAttrPosition(int i)
Set the attribute at position i to be dependent. |
void |
addEvidence(Atom a)
Store an evidence in the "buffer". |
void |
addFunctionalDependency(java.util.List<java.lang.String> determinant,
java.lang.String dependent)
Add a functional dependency for the attributes of this predicate |
void |
addQuery(Atom q)
Register a query atom. |
void |
addRelatedClause(Clause c)
Register a clause referencing this predicate |
void |
appendArgument(Type t)
Append a new argument without a user-provided name. |
void |
appendArgument(Type t,
java.lang.String name)
Append a new argument with a user provided name. |
int |
arity()
Return the arity of this predicate. |
void |
closeFiles()
Close all file handles. |
void |
flushEvidence()
Flush the evidence buffer to the predicate table, using the COPY statement in PostgreSQL. |
int |
getArgPositionByName(java.lang.String aname)
Return the position of the given argument name. |
java.util.ArrayList<java.lang.String> |
getArgs()
Return argument names of this predicate. |
static Predicate |
getBuiltInPredByName(java.lang.String s)
Return the predicate object with the name as the argument string. |
java.util.ArrayList<java.lang.Integer> |
getDependentAttrPositions()
|
java.util.ArrayList<java.lang.String> |
getDependentAttrs()
Get attributes whose value depend on other attributes in any possible world. |
int |
getID()
Return the assigned ID of this predicate in its parent MLN. |
java.util.ArrayList<java.lang.Integer> |
getKeyAttrPositions()
|
java.util.ArrayList<java.lang.String> |
getKeyAttrs()
Get attributes that form a possible world key. |
java.lang.String |
getName()
Return the name of this predicate. |
java.util.ArrayList<Atom> |
getQueryAtoms()
Return query atoms of this predicate. |
java.lang.String |
getRelAct()
Return the name of relational table containing the ID of active atoms associated with this predicate. |
java.util.HashSet<Clause> |
getRelatedClauses()
Return clauses referencing this predicate. |
java.lang.String |
getRelName()
Return the relational table name of this predicate.. |
Type |
getTypeAt(int k)
Return the type of the k-th argument. |
void |
groundAndStoreAtom(Atom a)
Ground an atom and store the result in the database. |
boolean |
hasDependentAttributes()
|
boolean |
hasMoreToGround()
Determine whether this predicate can ground more atoms. |
boolean |
hasQuery()
Checks if there are any queries associated with this predicate. |
boolean |
hasSoftEvidence()
|
boolean |
isBuiltIn()
|
static boolean |
isBuiltInPredName(java.lang.String s)
Return true if the argument is the name of a built-in predicate. |
boolean |
isClosedWorld()
Check if this predicate makes the closed-world assumption. |
boolean |
isCompletelySepcified()
|
boolean |
isImmutable()
|
boolean |
isSafeRefOnly()
|
boolean |
noNeedToGround()
Check if we need to ground this predicate on top of its evidence. |
void |
prepareDB(RDB adb)
Initialize database objects for this predicate. |
void |
sealDefinition()
Mark the point when all arguments have been given. |
void |
setAllQuery()
Specify that all atoms of this predicate are queries. |
void |
setClosedWorld(boolean t)
Specify whether this predicate obeys the closed world assumption. |
void |
setCompeletelySpecified(boolean t)
|
void |
setDB(RDB adb)
|
void |
setHasSoftEvidence(boolean hasSoftEvidence)
|
void |
setID(int aid)
Assign an ID for this predicate. |
void |
setMLN(MarkovLogicNetwork _mln)
|
void |
setSafeRefOnly(boolean safeRefOnly)
Set whether all references to this predicate are safe; i.e., all variables in corresponding positive literals are bound to other literals in the same clause. |
void |
storeQueries()
Ground query atoms and store the result in the database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean isCurrentlyView
Constructor Detail |
---|
public Predicate(MarkovLogicNetwork mln, java.lang.String aname, boolean aClosedWorld)
mln
- the parent MLN that hosts this predicateaname
- the name; must be uniqueaClosedWorld
- indicates whether to make the closed-world asssumptionMethod Detail |
---|
public void addDependentAttrPosition(int i)
i
- public void addEvidence(Atom a)
a
- the evidence; following Alchemy, it must be a ground atomflushEvidence()
public void addFunctionalDependency(java.util.List<java.lang.String> determinant, java.lang.String dependent)
determinant
- dependent
- public void addQuery(Atom q)
q
- the query atom; could contain variablesstoreQueries()
public void addRelatedClause(Clause c)
c
- a clause referencing this predicatepublic void appendArgument(Type t)
t
- the type of the new argumentpublic void appendArgument(Type t, java.lang.String name)
t
- the type of the new argumentname
- user-provided name for this argument/attributepublic int arity()
public void closeFiles()
public void flushEvidence()
addEvidence(Atom)
public int getArgPositionByName(java.lang.String aname)
aname
- argument namepublic java.util.ArrayList<java.lang.String> getArgs()
public static Predicate getBuiltInPredByName(java.lang.String s)
s
- name of queried predicate
public java.util.ArrayList<java.lang.Integer> getDependentAttrPositions()
public java.util.ArrayList<java.lang.String> getDependentAttrs()
getKeyAttrs()
public int getID()
public java.util.ArrayList<java.lang.Integer> getKeyAttrPositions()
public java.util.ArrayList<java.lang.String> getKeyAttrs()
getDependentAttrs()
public java.lang.String getName()
public java.util.ArrayList<Atom> getQueryAtoms()
public java.lang.String getRelAct()
public java.util.HashSet<Clause> getRelatedClauses()
public java.lang.String getRelName()
public Type getTypeAt(int k)
public void groundAndStoreAtom(Atom a)
public boolean hasDependentAttributes()
public boolean hasMoreToGround()
public boolean hasQuery()
public boolean hasSoftEvidence()
public boolean isBuiltIn()
public static boolean isBuiltInPredName(java.lang.String s)
s
- name of queried predicate
public boolean isClosedWorld()
public boolean isCompletelySepcified()
public boolean isImmutable()
public boolean isSafeRefOnly()
public boolean noNeedToGround()
public void prepareDB(RDB adb)
public void sealDefinition()
public void setAllQuery()
public void setClosedWorld(boolean t)
public void setCompeletelySpecified(boolean t)
public void setDB(RDB adb)
public void setHasSoftEvidence(boolean hasSoftEvidence)
public void setID(int aid)
public void setMLN(MarkovLogicNetwork _mln)
public void setSafeRefOnly(boolean safeRefOnly)
safeRefOnly
- public void storeQueries()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |