| TEACH JAVAEXPERT | Sharon Wood |
| (xemacs version) | August 1999 |
| (modified November 1999) |
| xemacs /local/javateach/packages/foundai/ES/RunES.java |
| Rule 1: | if..... | the animal has hair |
| then... | the animal is a mammal | |
| Rule 2: | if..... | the animal gives milk |
| then... | the animal is a mammal | |
| Rule 3: | if..... | the animal has feathers |
| then... | the animal is a bird |
| Rule 4: | if..... | the animal is a mammal |
| and.... | the animal chews the cud | |
| then... | the animal is an ungulate |
| Rule 5: | if..... | the animal is an ungulate |
| and.... | the animal is white | |
| and.... | the animal has black stripes | |
| then... | the animal is a zebra |
| (i) | identify the set of rules whose conditions are satisfied; |
| (ii) | select one rule from the set; |
| (iii) | carry out the actions of the selected rule. |
| xemacs /local/javateach/packages/foundai/ES/RunES.java |
| ~myusername/mydomainfactsfile.txt |
| <antecedent numbers> end <consequent numbers> end <property> <value> <prompt> <question text> ? |
| if..... | the animal has hair | |
| then... | the animal is a mammal |
| 15 | |
| 1 end end has hair yesno Does the animal have hair ? | |
| 3 end end has feathers yesno Does the animal have feathers ? | |
| 4 neg 13 neg 14 15 end end can fly yesno Can the animal fly ? | |
| 5 6 7 8 end 1 2 end isa mammal | |
| 13 14 15 end 3 4 end isa bird end 14 solution end isa ostrich |