Package nltk :: Package sem :: Module drt :: Class DRS
[hide private]
[frames] | no frames]

Class DRS

source code

                   object --+    
                            |    
                  AbstractDrs --+
                                |
               object --+       |
                        |       |
logic.SubstituteBindingsI --+   |
                            |   |
             logic.Expression --+
                                |
     drt_resolve_anaphora.DRS --+
                                |
                               DRS

A Discourse Representation Structure.

Instance Methods [hide private]
 
__init__(self, refs, conds)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
replace(self, variable, expression, replace_bound=False)
Replace all instances of variable v with expression E in self, where v is free in self.
source code
 
variables(self)
Return a set of all the variables that are available to be replaced.
source code
 
free(self, indvar_only=True)
Return a set of all the free (non-bound) variables in self.
source code
 
get_refs(self) source code
 
simplify(self) source code
 
toFol(self) source code
 
__eq__(self, other)
Defines equality modulo alphabetic variance.
source code
 
str(self, syntax=1) source code

Inherited from AbstractDrs: __add__, __and__, __call__, __gt__, __lt__, __neg__, __or__, applyto, draw, get_EqualityExpression, is_pronoun_function, make_VariableExpression, negate, tp_equals

Inherited from logic.Expression: __hash__, __repr__, __str__, substitute_bindings

Inherited from object: __delattr__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__

Inherited from drt_resolve_anaphora.DRS: resolve_anaphora

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, refs, conds)
(Constructor)

source code 

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

Parameters:
  • refs - list of DrtVariableExpression for the discourse referents
  • conds - list of Expression for the conditions
Overrides: object.__init__

variables(self)

source code 

Return a set of all the variables that are available to be replaced. This includes free (non-bound) variables as well as predicates.

Returns:
set of Variables
Overrides: logic.Expression.variables

See Also: logic.Expression.variables()

free(self, indvar_only=True)

source code 

Return a set of all the free (non-bound) variables in self. Variables serving as predicates are no included.

Parameters:
  • indvar_only - boolean only return individual variables?
Returns:
set of Variables
Overrides: logic.Expression.free

See Also: logic.Expression.free()

__eq__(self, other)
(Equality operator)

source code 

Defines equality modulo alphabetic variance. If we are comparing \x.M and \y.N, then check equality of M and N[x/y].

Overrides: logic.Expression.__eq__