|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttuffy.mln.Literal
public class Literal
A literal in first-order logic.
Constructor Summary | |
---|---|
Literal(Predicate predicate,
boolean sense)
Constructor of Literal. |
Method Summary | |
---|---|
void |
appendTerm(Term t)
Append a new term to this literal. |
java.lang.Object |
clone()
|
boolean |
coversAllMaterializedTuples()
Test whether we want this literal to cover all materialized tuples regardless of the sense of this literal. |
void |
flipSense()
Flip the sense of this literal. |
int |
getIdx()
Return the assigned index of this literal in its parent clause. |
Predicate |
getPred()
Return the predicate of this literal. |
boolean |
getSense()
Return true if this is a positive literal. |
java.util.ArrayList<Term> |
getTerms()
Return the list of terms in this literal. |
java.util.HashSet<java.lang.String> |
getVars()
Return the set of variable names in this literal. |
boolean |
isBuiltIn()
Return whether the predicate of this literal is a built-in predicate. |
boolean |
isSameAs(Literal lit)
Compare a given literal with this one. |
java.util.HashMap<java.lang.String,Term> |
mostGeneralUnification(Tuple atuple)
Compute the most general unification (MGU) of two literals. |
void |
setCoversAllMaterializedTuples(boolean coversAllMaterializedTuples)
Set whether we want this literal to cover all materialized tuples regardless of the sense of this literal. |
void |
setIdx(int i)
Assign an unique (within its parent clause) index to this literal. |
void |
setSense(boolean asense)
Set the sense of this literal. |
Literal |
substitute(java.util.HashMap<java.lang.String,Term> vmap)
Apply a substitution to this literal. |
Atom |
toAtom(Atom.AtomType type)
Convert this literal to an atom. |
java.lang.String |
toString()
Return the human-friendly representation of this literal. |
Tuple |
toTuple()
Convert this literal into a tuple. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Literal(Predicate predicate, boolean sense)
predicate
- the predicatesense
- true for a positive literal; false for a negative oneMethod Detail |
---|
public void appendTerm(Term t)
t
- the term to be appendedpublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public boolean coversAllMaterializedTuples()
public void flipSense()
public int getIdx()
public Predicate getPred()
public boolean getSense()
public java.util.ArrayList<Term> getTerms()
public java.util.HashSet<java.lang.String> getVars()
public boolean isBuiltIn()
public boolean isSameAs(Literal lit)
lit
- the literal needed to be compared.
public java.util.HashMap<java.lang.String,Term> mostGeneralUnification(Tuple atuple)
atuple
- the literal (in the form of a tuple) to be unified
public void setCoversAllMaterializedTuples(boolean coversAllMaterializedTuples)
coversAllMaterializedTuples
- public void setIdx(int i)
i
- the indexClause.addLiteral(Literal)
public void setSense(boolean asense)
asense
- true if this is intended to be a positive literalpublic Literal substitute(java.util.HashMap<java.lang.String,Term> vmap)
vmap
- the substitution
public Atom toAtom(Atom.AtomType type)
type
- indicates if it's an evidence, a query, etc.public java.lang.String toString()
toString
in class java.lang.Object
public Tuple toTuple()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |