|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectai.krr.propositions.Interpretation
public class Interpretation
An Interpretation in the propositional logic is an assignment of truth values to propositional Atom. In the case of this implementation, this is a hash map from NamedSymbols to BooleanSymbols.
Nested Class Summary | |
---|---|
static class |
Interpretation.InterpretationIterator
|
Field Summary | |
---|---|
protected java.util.HashMap<NamedSymbol,BooleanSymbol> |
values
the Map contained in this Interpretation |
Constructor Summary | |
---|---|
Interpretation()
This constructor creates a new, empty Interpretation. |
Method Summary | |
---|---|
boolean |
assignsAll(Sentence stmt)
This function tests whether all the NamedSymbols in the given Sentence are assigned a truth value by this Interpretation. |
Interpretation |
clone()
This function creates a copy of this Interpretation. |
boolean |
equals(Interpretation ipt)
This function compares this Interpretation to the given Interpretation. |
boolean |
equals(java.lang.Object obj)
This function compares this Interpretation to the given Object. |
boolean |
falsifies(Sentence stmt)
This function tests whether the given propositional Sentence evaluates to false under this Interpretation. |
BooleanSymbol |
getValue(NamedSymbol prop)
This function retrieves a previously assigned truth value for the given propositional symbol from this Interpretation. |
int |
hashCode()
This function returns the hash code of the contained Map. |
boolean |
satisfies(Sentence stmt)
This function tests whether the given propositional Sentence evaluates to true under this Interpretation. |
void |
setValue(NamedSymbol prop,
BooleanSymbol val)
This function can be used assign the given truth value to the given NamedSymbol. |
java.lang.String |
toString()
This function returns a printable representation of this Interpretation. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.HashMap<NamedSymbol,BooleanSymbol> values
Constructor Detail |
---|
public Interpretation()
This constructor creates a new, empty Interpretation. Initially it
contains no assignments of truth values to any NamedSymbols. Such
assignment must be added using the function
setValue(...)
.
Method Detail |
---|
public Interpretation clone()
This function creates a copy of this Interpretation. The copy will contain the same NamedSymbols as the original, but modifications to their truth values will not effect each other.
clone
in class java.lang.Object
public void setValue(NamedSymbol prop, BooleanSymbol val)
This function can be used assign the given truth value to the given NamedSymbol. If the NamedSymbol had a previously assigned truth value in this Interpretation, this will be replaced. Neither the given the given NamedSymbol nor the truth value must not be null.
prop
- the NamedSymbol representing a propositional Atomval
- the BooleanSymbol representing the truth value of this
propositionpublic BooleanSymbol getValue(NamedSymbol prop)
This function retrieves a previously assigned truth value for the given propositional symbol from this Interpretation. This function will return null if no assignment to the given NamedSymbol was made. The given NamedSymbol must not be null.
prop
- the NamedSymbol for which the truth value is sought
public boolean satisfies(Sentence stmt)
This function tests whether the given propositional Sentence evaluates to true under this Interpretation. Note that all NamedSymbols in the given Sentence should be assigned a truth value under this Interpretation.
stmt
- the Sentence to be tested
public boolean falsifies(Sentence stmt)
This function tests whether the given propositional Sentence evaluates to false under this Interpretation. Note that all NamedSymbols in the given Sentence should be assigned a truth value under this Interpretation.
stmt
- the Sentence to be tested
public boolean assignsAll(Sentence stmt)
This function tests whether all the NamedSymbols in the given Sentence are assigned a truth value by this Interpretation. If so, evaluating this Sentence under this Interpretation is guaranteed to succeed.
stmt
- the Sentence to be tested
public java.lang.String toString()
This function returns a printable representation of this Interpretation.
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
This function compares this Interpretation to the given Object. Interpretations can only be equal to other Interpretations.
equals
in class java.lang.Object
obj
- the Object to compare this to
public boolean equals(Interpretation ipt)
This function compares this Interpretation to the given Interpretation. Two Interpretations are equal if they contain the same NamedSymbols and assign the same truth values to each.
ipt
- the Interpretation to compare this to
public int hashCode()
This function returns the hash code of the contained Map.
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |