Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
class ExpSysRule:
def __init__(self, antecedent, consequent):
self.antecedent = antecedent
self.consequent = consequent
if not len(ktail)==0:
match = True
xname = ktail[0]
True
[36] listOfAssertions = ['Sparky has tawny color', 'Bella gives milk', 'Sparky give
[42] listOfRules = [
ExpSysRule(['x has hair'], ['x is a mammal']),
ExpSysRule(['x gives milk'], ['x is a mammal']),
ExpSysRule(['x has feathers'], ['x is a bird']),
ExpSysRule(['x flies', 'x lays eggs'], ['x is a bird']),
ExpSysRule(['x is a mammal', 'x eats meat'], ['x is a carnivore']),
ExpSysRule(['x is a mammal', 'x has pointed teeth', 'x has claws', 'x has
ExpSysRule(['x is a mammal', 'x has hoofs'], ['x is an ungulate']),
ExpSysRule(['x is a mammal', 'x chews cud'], ['x is an ungulate']),
ExpSysRule(['x is a carnivore', 'x has tawny color', 'x has dark spots'
ExpSysRule(['x is a carnivore', 'x has tawny color', 'x has black stripes
ExpSysRule(['x is an ungulate', 'x has long legs', 'x has long neck'
ExpSysRule(['x is an ungulate', 'x has white color', 'x has black stripes
ExpSysRule(['x is a bird', 'x does not fly', 'x has long legs', 'x has lo
ExpSysRule(['x is a bird', 'x does not fly', 'x swins', 'x has black and
ExpSysRule(['x is a bird', 'x is a good flyer'], ['x is an albatross'