Package nltk_lite :: Package semantics :: Module evaluate :: Class Valuation
[hide private]
[frames] | no frames]

Class Valuation

source code

object --+    
         |    
      dict --+
             |
            Valuation

A dictionary which represents a model-theoretic Valuation of non-logical constants.

An attempt to initialize a Valuation with an individual variable expression (e.g., 'x3') will raise an error, as will an attemp to read a list containing an individual variable expression.

An instance of Valuation will raise a KeyError exception (i.e., just behave like a standard dictionary) if indexed with an expression that is not in its list of symbols.

Instance Methods [hide private]
 
__init__(self, valuation=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__getitem__(self, key)
x[y]
source code
Valuation
read(self, seq)
Parse a list such as [('j', 'b1'), ('girl', set(['g1', 'g2']))] into a Valuation.
source code
 
__str__(self)
str(x)
source code
 
_getDomain(self) source code
 
_getSymbols(self) source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __gt__, __hash__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__

Properties [hide private]
  domain
Set-theoretic domain of the value-space of a Valuation.
  symbols
The non-logical constants which the Valuation recognizes.

Inherited from object: __class__

Method Details [hide private]

__init__(self, valuation=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Returns:
new empty dictionary

Overrides: dict.__init__
(inherited documentation)

__getitem__(self, key)
(Indexing operator)

source code 

x[y]

Overrides: dict.__getitem__
(inherited documentation)

read(self, seq)

source code 

Parse a list such as [('j', 'b1'), ('girl', set(['g1', 'g2']))] into a Valuation.

Parameters:
  • seq - A list of tuples of the form (constant, relation), where relation is a set of tuples.
Returns: Valuation

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

Property Details [hide private]

domain

Set-theoretic domain of the value-space of a Valuation.

Get Method:
_getDomain(self)

symbols

The non-logical constants which the Valuation recognizes.

Get Method:
_getSymbols(self)