Package spade :: Module logic :: Class PropHornKB
[hide private]
[frames] | no frames]

Class PropHornKB

source code


A KB of Propositional Horn clauses.

Instance Methods [hide private]
 
tell(self, sentence)
Add a Horn Clauses to this KB.
source code
 
ask_generator(self, query)
Yield the empty substitution if KB implies query; else False
source code
 
retract(self, sentence)
Remove the sentence's clauses from the KB
source code
 
clauses_with_premise(self, p)
The list of clauses in KB that have p in the premise.
source code

Inherited from PropKB: __init__

Inherited from KB: ask

Method Details [hide private]

tell(self, sentence)

source code 

Add a Horn Clauses to this KB.

Overrides: KB.tell

ask_generator(self, query)

source code 

Yield the empty substitution if KB implies query; else False

Overrides: KB.ask_generator

retract(self, sentence)

source code 

Remove the sentence's clauses from the KB

Overrides: KB.retract

clauses_with_premise(self, p)

source code 

The list of clauses in KB that have p in the premise. This could be cached away for O(1) speed, but we'll recompute it.