ai.krr.fol
Class Interpretation

java.lang.Object
  extended by ai.krr.fol.Interpretation

public class Interpretation
extends java.lang.Object

An Interpretation over a domain D in first-order logic is an assignment of:

Author:
Gerhard Wickler

Field Summary
protected  java.util.Map<Symbol,java.lang.Object> cMap
          the Map from constants to elements in the domain
protected  java.util.Set<java.lang.Object> domain
          the domain of this Interpretation
protected  java.util.Map<ai.krr.fol.Interpretation.Pattern,java.lang.Object> fMap
          the Map from functions to elements in the domain
protected  java.util.Map<ai.krr.fol.Interpretation.Pattern,BooleanSymbol> pMap
          the Map from constants to elements in the domain
 
Constructor Summary
Interpretation(java.util.Set<java.lang.Object> d)
           This constructor creates a new, empty Interpretation for the given domain.
 
Method Summary
 BooleanSymbol getTruthValue(NamedSymbol psy, java.lang.Object[] args)
           This function retrieves a previously assigned value for the given predicate and arguments from this Interpretation.
 java.lang.Object getValue(Symbol c)
           This function retrieves a previously assigned value for the given Symbol from this Interpretation.
 java.lang.Object getValue(Symbol fsy, java.lang.Object[] args)
           This function retrieves a previously assigned value for the given function and arguments from this Interpretation.
 void setTruthValue(NamedSymbol psy, java.lang.Object[] args, BooleanSymbol val)
           This function can be used assign the given truth value to the given predicate applied to the given arguments.
 void setValue(Symbol c, java.lang.Object val)
           This function can be used assign the given Object as the value under this Interpretation to the given Symbol.
 void setValue(Symbol fsy, java.lang.Object[] args, java.lang.Object val)
           This function can be used assign the given Object as the value under this Interpretation to the given function applied to the given arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

domain

protected java.util.Set<java.lang.Object> domain
the domain of this Interpretation


cMap

protected java.util.Map<Symbol,java.lang.Object> cMap
the Map from constants to elements in the domain


fMap

protected java.util.Map<ai.krr.fol.Interpretation.Pattern,java.lang.Object> fMap
the Map from functions to elements in the domain


pMap

protected java.util.Map<ai.krr.fol.Interpretation.Pattern,BooleanSymbol> pMap
the Map from constants to elements in the domain

Constructor Detail

Interpretation

public Interpretation(java.util.Set<java.lang.Object> d)

This constructor creates a new, empty Interpretation for the given domain. Initially it contains no assignments. Such assignment must be added using the functions setValue(Symbol, Object), #setValue(FunctionTerm, Object) and #setValue(Atom, BooleanSymbol).

Method Detail

setValue

public void setValue(Symbol c,
                     java.lang.Object val)

This function can be used assign the given Object as the value under this Interpretation to the given Symbol. If the Symbol had a previously assigned value in this Interpretation, this will be replaced. Neither of the given the given arguments must be null and the Object must be an element of the domain.

Parameters:
c - the Symbol representing a constant
val - the NamedSymbol representing the value of the constant

setValue

public void setValue(Symbol fsy,
                     java.lang.Object[] args,
                     java.lang.Object val)

This function can be used assign the given Object as the value under this Interpretation to the given function applied to the given arguments. If the function had a previously assigned value for these arguments in this Interpretation, this will be replaced. The given Object must be an element of the domain.

Parameters:
c - the Symbol representing a constant
val - the NamedSymbol representing the value of the constant

setTruthValue

public void setTruthValue(NamedSymbol psy,
                          java.lang.Object[] args,
                          BooleanSymbol val)

This function can be used assign the given truth value to the given predicate applied to the given arguments. If the relation had a previously assigned truth value in this Interpretation, this will be replaced.

Parameters:
prop - the NamedSymbol representing a propositional Atom
val - the BooleanSymbol representing the truth value of this proposition

getValue

public java.lang.Object getValue(Symbol c)

This function retrieves a previously assigned value for the given Symbol from this Interpretation. This function will return null if no assignment to the given Symbol was made. The given Symbol must not be null.

Parameters:
c - the Symbol for which the value is sought
Returns:
the value of the given Symbol in this Interpretation or null if there was no assignment

getValue

public java.lang.Object getValue(Symbol fsy,
                                 java.lang.Object[] args)

This function retrieves a previously assigned value for the given function and arguments from this Interpretation. This function will return null if no assignment to the given Symbol was made. The given Symbol must not be null.

Parameters:
c - the Symbol for which the value is sought
Returns:
the value of the given Symbol in this Interpretation or null if there was no assignment

getTruthValue

public BooleanSymbol getTruthValue(NamedSymbol psy,
                                   java.lang.Object[] args)

This function retrieves a previously assigned value for the given predicate and arguments from this Interpretation. This function will return null if no assignment to the given Symbol was made. The given Symbol must not be null.

Parameters:
c - the Symbol for which the value is sought
Returns:
the value of the given Symbol in this Interpretation or null if there was no assignment