Package nltk :: Package inference :: Module api :: Class BaseModelBuilderCommand
[hide private]
[frames] | no frames]

type BaseModelBuilderCommand

source code

        object --+        
                 |        
TheoremToolCommand --+    
                     |    
BaseTheoremToolCommand --+
                         |
        object --+       |
                 |       |
TheoremToolCommand --+   |
                     |   |
   ModelBuilderCommand --+
                         |
                        BaseModelBuilderCommand
Known Subclasses:

This class holds a ModelBuilder, a goal, and a list of assumptions. When build_model() is called, the ModelBuilder is executed with the goal and assumptions.

Instance Methods [hide private]
 
__init__(self, modelbuilder, goal=None, assumptions=None) source code
nltk.sem.evaluate.Valuation
build_model(self, verbose=False)
Attempt to build a model.
source code
 
model(self, format=None)
Return a string representation of the model
source code
 
_decorate_model(self, valuation_str, format=None)
Returns: str
source code
 
get_model_builder(self)
Return the model builder object
source code

Inherited from BaseTheoremToolCommand: add_assumptions, assumptions, goal, print_assumptions, retract_assumptions

Instance Variables [hide private]
  _modelbuilder
The theorem tool to execute with the assumptions

Inherited from BaseTheoremToolCommand (private): _result

Method Details [hide private]

__init__(self, modelbuilder, goal=None, assumptions=None)
(Constructor)

source code 
Parameters:
  • modelbuilder (ModelBuilder) - The theorem tool to execute with the assumptions
Overrides: BaseTheoremToolCommand.__init__

See Also: BaseTheoremToolCommand

build_model(self, verbose=False)

source code 

Attempt to build a model. Store the result to prevent unnecessary re-building.

Returns: nltk.sem.evaluate.Valuation
A model if one is generated; None otherwise.
Overrides: ModelBuilderCommand.build_model

model(self, format=None)

source code 

Return a string representation of the model

Parameters:
  • simplify - boolean simplify the proof?
Returns:
str
Overrides: ModelBuilderCommand.model

_decorate_model(self, valuation_str, format=None)

source code 
Parameters:
  • valuation_str - str with the model builder's output
  • format - str indicating the format for displaying
Returns:
str

get_model_builder(self)

source code 

Return the model builder object

Returns:
ModelBuilder
Overrides: ModelBuilderCommand.get_model_builder
(inherited documentation)