/* Rules for identifying animals. From Winston. The start goal starts the expert system and extracts the solution from the trace. The expert system is started by with the goal "animalKnown." The identity of the animal will be the second item in the trace. These rules may contain errors, if so please let the instructor know. */ start:-wipe,deduce(animalKnown). aGoalList([isaCheetah,isaTiger,isaGiraffe,isaZebra,isaOstrich, isaPenguin,isaAlbatross]). z1:if hasHair then isaMammal. z2:if givesMilk then isaMammal. z3:if hasFeathers then isaBird. z4:if flies and laysEggs then isaBird. z5:if isaMammal and eatsMeat then isaCarnivore. z6:if isaMammal and hasPointedTeeth and hasClaws and hasFPEyes then isaCarnivore. z7:if isaMammal and hasHoofs then isaUngulate. z8:if isaMammal and chewsCud then isaUngulate. z9:if isaCarnivore and hasTawnyColor and hasSpots then isaCheetah. z10:if isaCarnivore and hasTawnyColor and hasBlackStripes then isaTiger. z11:if isaUngulate and hasLongLegs and hasLongNeck and hasTawnyColr and hasDarkSpots then isaGiraffe. z12:if isaUngulate and hasBlackStripes then isaZebra. z13:if isaBird and not flies and hasLongLegs and hasLongNeck and isBlackAndWhite then isaOstrich. z14:if isaBird and not flies and swims and isBlackAndWhite then isaPenguin. z15:if isaBird and isaGoodFlyer then isaAlbatross. z16:if isaAlbatross or isaPenguin or isaOstrich or isaZebra or isaGiraffe or isaTiger or isaCheetah then animalKnown. askable(hasHair,'Does it have hair?'). askable(givesMilk,'Does it give milk?'). askable(hasFeathers,'Does it have feathers?'). askable(flies,'Does it fly?'). askable(laysEggs,'Does it lay eggs?'). askable(eatsMeat,'Does it eat meat?'). askable(hasPointedTeeth,'Does it have pointed teeth?'). askable(hasFPEyes,"Does it have forward pointing eyes?"). askable(hasClaws,"Does it have claws?"). askable(hasHoofs,'Does it have hooves?'). askable(chewsCud,'Does it chew cud?'). askable(hasTawnyColor,'Is it brownish?'). askable(hasSpots,'Does it have spots?'). askable(hasBlackStripes,'Does it have black stripes?'). askable(hasLongLegs,'Does it have long legs?'). askable(hasLongNeck,'Does it have a long neck?'). askable(hasDarkSpots,'Does it have black spots?'). askable(hasWhiteColor,'Is it white (partially)?'). askable(isBlackAndWhite,'Is it black and white?'). askable(swims,'Does it swim?'). askable(isaGoodFlyer,'Is it a good flyer?').