|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmln.Predicate
public class Predicate
Predicate in First Order Logic.
Field Summary | |
---|---|
boolean |
isBuiltIn
Whether this predicate is a built-in predicate. |
Constructor Summary | |
---|---|
Predicate(MarkovLogicNetwork mln,
java.lang.String aname,
boolean aClosedWorld)
Constructor of Predicate. |
Method Summary | |
---|---|
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. |
int |
getID()
Return the assigned ID of this predicate in its parent MLN. |
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 |
hasMoreToGround()
Determine whether this predicate can ground more atoms. |
boolean |
hasQuery()
Checks if there are any queries associated with this predicate. |
boolean |
hasSoftEvidence()
|
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 |
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 |
setHasSoftEvidence(boolean hasSoftEvidence)
|
void |
setID(int aid)
Assign an ID for this predicate. |
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 isBuiltIn
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 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 int getID()
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 hasMoreToGround()
public boolean hasQuery()
public boolean hasSoftEvidence()
public static boolean isBuiltInPredName(java.lang.String s)
s
- name of queried predicate
public boolean isClosedWorld()
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 setHasSoftEvidence(boolean hasSoftEvidence)
public void setID(int aid)
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 |