|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttuffy.mln.Clause
public class Clause
A first-order logic clause, namely a disjunct of literals.
Field Summary | |
---|---|
double |
cost
The cost ascribed to this clause. |
static java.util.HashMap<java.lang.Integer,java.lang.String> |
mappingFromID2Const
Map from Constant ID to Constant Name. |
static java.util.HashMap<java.lang.String,java.lang.String> |
mappingFromID2Desc
Map from clause ID to its description. |
java.lang.String |
sqlFromList
The From sub-clause of SQL for grounding. |
java.lang.String |
sqlPivotAttrsList
The list of attributes that are NOT existential variables. |
java.lang.String |
sqlWhereBindings
The Where sub-clause of SQL for grounding. |
java.util.ArrayList<GClause> |
violatedGClauses
Violated ground clauses. |
double |
violations
The number of violations on this clause. |
Constructor Summary | |
---|---|
Clause()
Construct an empty clause. |
Method Summary | |
---|---|
void |
absorb(Clause c)
"Absorb" another clause of the same pattern into this clause. |
void |
addConstraint(Expression e)
Add a constraint that must hold. |
boolean |
addExistentialVariable(java.lang.String v)
Existentially quantify a variable. |
void |
addLiteral(Literal lit)
Add a literal to this clause. |
void |
addSpecText(java.lang.String s)
|
void |
addUserProvidedName(java.lang.String nm)
Add user provided names to this clause. |
void |
checkVariableSafety()
Check for unsafe variables in the clause, and mark the corresponding Predicates. |
Clause |
clone()
|
void |
generateSQL()
Generate the SQL command for grounding this clause. |
java.util.ArrayList<Expression> |
getConstraints()
|
int |
getId()
Get clause ID. |
java.util.ArrayList<Literal> |
getLiteralsOfPredicate(Predicate pred)
Return the member literals of a particular predicate. |
java.lang.String |
getName()
Return the assigned name of this clause. |
java.util.Set<Predicate> |
getReferencedPredicates()
Return the set of predicates referenced by this clause. |
java.util.ArrayList<Literal> |
getRegLiterals()
Return the list of non-built-in literals (i.e., regular literals). |
java.lang.String |
getSignature()
Return the "signature" of this clause. |
java.util.ArrayList<java.lang.String> |
getSpecText()
|
java.lang.String |
getVarWeight()
Get the variable in this clause that is used as clause weights |
double |
getWeight()
Return the weight of this clause. |
java.lang.String |
getWeightExp()
Return the expression of clause weights to be used in SQL. |
boolean |
hasEmbeddedWeight()
Check if the weight of this clause comes from a variable in the clause |
boolean |
hasExistentialQuantifiers()
Check if any variable in this clause is existentially quantified. |
boolean |
isHardClause()
Return whether this clause is a hard rule. |
boolean |
isPositiveClause()
Check if the weight is positive. |
boolean |
isTemplate()
Return true iff this clause contains constant. |
Clause |
normalize()
Return a normalized version of this clause. |
void |
prepareForDB(RDB db)
Initialize database objects for this clause. |
void |
setHardWeight()
Specify this clause as a hard rule. |
void |
setId(int id)
Set clause ID. |
void |
setName(java.lang.String aname)
Assign a name for this clause. |
void |
setVarWeight(java.lang.String vw)
|
void |
setWeight(double wt)
Set the weight of this clause. |
java.lang.String |
toString()
Return the definition of this clause. |
java.lang.String |
toString(int ni)
Return the definition of clause instance. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public double cost
MRF.auditClauseViolations()
public static java.util.HashMap<java.lang.Integer,java.lang.String> mappingFromID2Const
MarkovLogicNetwork.getSymbolID(String, Type)
.
This variable is materialized in Infer.setUp(CommandOptions)
.
public static java.util.HashMap<java.lang.String,java.lang.String> mappingFromID2Desc
Infer.setUp(CommandOptions)
.
public java.lang.String sqlFromList
public java.lang.String sqlPivotAttrsList
public java.lang.String sqlWhereBindings
public java.util.ArrayList<GClause> violatedGClauses
MRF.auditClauseViolations()
public double violations
MRF.auditClauseViolations()
Constructor Detail |
---|
public Clause()
Method Detail |
---|
public void absorb(Clause c)
c
- the clause to be absorbednormalize()
public void addConstraint(Expression e)
e
- A bool expression that must be TRUE.public boolean addExistentialVariable(java.lang.String v)
v
- the variable to be existentially quantifiedpublic void addLiteral(Literal lit)
public void addSpecText(java.lang.String s)
public void addUserProvidedName(java.lang.String nm)
nm
- user provided namepublic void checkVariableSafety()
public Clause clone()
clone
in class java.lang.Object
public void generateSQL()
public java.util.ArrayList<Expression> getConstraints()
public int getId()
public java.util.ArrayList<Literal> getLiteralsOfPredicate(Predicate pred)
public java.lang.String getName()
public java.util.Set<Predicate> getReferencedPredicates()
public java.util.ArrayList<Literal> getRegLiterals()
public java.lang.String getSignature()
normalize()
public java.util.ArrayList<java.lang.String> getSpecText()
public java.lang.String getVarWeight()
public double getWeight()
public java.lang.String getWeightExp()
public boolean hasEmbeddedWeight()
public boolean hasExistentialQuantifiers()
public boolean isHardClause()
public boolean isPositiveClause()
public boolean isTemplate()
public Clause normalize()
MarkovLogicNetwork.registerClause(Clause)
public void prepareForDB(RDB db)
public void setHardWeight()
Config.hard_weight
public void setId(int id)
id
- public void setName(java.lang.String aname)
public void setVarWeight(java.lang.String vw)
public void setWeight(double wt)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int ni)
ni
- The ID of instance.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |