|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectai.krr.propositions.Sentence
ai.krr.propositions.TruthValue
public final class TruthValue
A TruthValue is one of the most basic building blocks for a Sentence. It simply consists of a BooleanSymbol.
Field Summary | |
---|---|
static TruthValue |
FALSE
the TruthValue for FALSE |
protected BooleanSymbol |
theSy
the BooleanSymbol representing the TruthValue |
static TruthValue |
TRUE
the TruthValue for TRUE |
Method Summary | |
---|---|
void |
addPropositions(java.util.Set<NamedSymbol> props)
This function adds the propositions contained in this Sentence to the given Set. |
boolean |
booleanValue()
This function returns the boolean value of the BooleanSymbol that represents this TruthValue. |
TruthValue |
clone()
This class does not really support cloning and this object will be returned. |
int |
compareTo(Sentence stmt)
This function compares this Sentence to the given Sentence. |
int |
compareTo(TruthValue other)
This function compares this TruthValue to the given TruthValue. |
BooleanSymbol |
evaluate(Interpretation ipt)
This function evaluates this Sentence under the given Interpretation. |
int |
getClassOrderIndex()
This function returns the index used for ordering Sentences across different classes. |
BooleanSymbol |
getSymbol()
This function returns the Symbol that represents this TruthValue. |
int |
hashCode()
This function returns the hash code of this TruthValue. |
protected Sentence |
toCNF(boolean isNegated)
This function returns a new TruthValue which contains the same BooleanSymbol or its negation, depending on the given boolean. |
protected Sentence |
toDNF(boolean isNegated)
This function returns a new TruthValue which contains the same BooleanSymbol or its negation, depending on the given boolean. |
java.lang.String |
toString()
A TruthValue is printed as the contained symbol. |
Methods inherited from class ai.krr.propositions.Sentence |
---|
addSubSentences, allSubSentences, exceedsDepth, getDepth, getPropositions, isAtom, isLiteral, prettyPrint, read, toClauseForm, toCNF, toDNF, write |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final TruthValue FALSE
public static final TruthValue TRUE
protected final BooleanSymbol theSy
Method Detail |
---|
public final TruthValue clone()
This class does not really support cloning and this object will be returned.
clone
in class Sentence
public void addPropositions(java.util.Set<NamedSymbol> props)
This function adds the propositions contained in this Sentence to the given Set. In the case of a TruthValue the Set remains unchanged.
addPropositions
in class Sentence
props
- the Set to which the NamedSymbols are addedpublic BooleanSymbol evaluate(Interpretation ipt)
This function evaluates this Sentence under the given Interpretation. For a TruthValue the returned truth value is the BooleanSymbol that makes up this TruthValue.
evaluate
in class Sentence
ipt
- the Interpretation giving truth values for propositions
public int getClassOrderIndex()
This function returns the index used for ordering Sentences across different classes. This index of this class is defined to be 0.
getClassOrderIndex
in class Sentence
public int compareTo(Sentence stmt)
This function compares this Sentence to the given Sentence. The order between different kinds of Sentence is arbitrarily defined as (ascending): Atom, Literal, NegatedSentence, ConnectedSentence, BinaryConnectedSentence.
compareTo
in interface java.lang.Comparable<Sentence>
compareTo
in class Sentence
stmt
- the Sentence to which this Sentence is to be compared
public final BooleanSymbol getSymbol()
This function returns the Symbol that represents this TruthValue.
public int compareTo(TruthValue other)
This function compares this TruthValue to the given TruthValue. The order between TruthValues is defined by the order of the BooleanSymbols they contain.
other
- the TruthValue to which this TruthValue is to be compared
public final boolean booleanValue()
This function returns the boolean value of the BooleanSymbol that represents this TruthValue.
protected Sentence toCNF(boolean isNegated)
This function returns a new TruthValue which contains the same BooleanSymbol or its negation, depending on the given boolean.
toCNF
in class Sentence
isNegated
- whether the TruthValue has to be negated
protected Sentence toDNF(boolean isNegated)
This function returns a new TruthValue which contains the same BooleanSymbol or its negation, depending on the given boolean.
toDNF
in class Sentence
isNegated
- whether the TruthValue has to be negated
public java.lang.String toString()
A TruthValue is printed as the contained symbol.
toString
in class java.lang.Object
public final int hashCode()
This function returns the hash code of this TruthValue.
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |