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

type ParallelProverBuilderCommand

source code

        object --+            
                 |            
TheoremToolCommand --+        
                     |        
BaseTheoremToolCommand --+    
                         |    
        object --+       |    
                 |       |    
TheoremToolCommand --+   |    
                     |   |    
         ProverCommand --+    
                         |    
         BaseProverCommand --+
                             |
        object --+           |
                 |           |
TheoremToolCommand --+       |
                     |       |
BaseTheoremToolCommand --+   |
                         |   |
        object --+       |   |
                 |       |   |
TheoremToolCommand --+   |   |
                     |   |   |
   ModelBuilderCommand --+   |
                         |   |
   BaseModelBuilderCommand --+
                             |
                            ParallelProverBuilderCommand

This command stores both a prover and a model builder and when either prove() or build_model() is called, then both theorem tools are run in parallel. Whichever finishes first, the prover or the model builder, is the result that will be used.

Because the theorem prover result is the opposite of the model builder result, we will treat self._result as meaning "proof found/no model found".

Instance Methods [hide private]
 
__init__(self, prover, modelbuilder, goal=None, assumptions=None) source code
 
prove(self, verbose=False)
Perform the actual proof.
source code
nltk.sem.evaluate.Valuation
build_model(self, verbose=False)
Attempt to build a model.
source code
 
_run(self, verbose) source code

Inherited from BaseProverCommand: decorate_proof, get_prover, proof

Inherited from BaseModelBuilderCommand: get_model_builder, model

Inherited from BaseModelBuilderCommand (private): _decorate_model

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

Instance Variables [hide private]

Inherited from BaseProverCommand (private): _prover

Inherited from BaseModelBuilderCommand (private): _modelbuilder

Inherited from BaseTheoremToolCommand (private): _result

Method Details [hide private]

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

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

prove(self, verbose=False)

source code 

Perform the actual proof. Store the result to prevent unnecessary re-proving.

Overrides: ProverCommand.prove
(inherited documentation)

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
(inherited documentation)