% File: /u4/peter/prolog/ks299/wine % Author: Peter Ross % Updated: 6 Sep 84 % Purpose: a simple knowledge base for the KS299 expert system shell 'What is the overall taste (delicate/average/strong)' finds tastiness of meal. 'Is there a sauce (yes/no)' finds has_sauce. 'What sort of sauce (spicy/creamy/tomatoey/other)' finds sauce of meal. 'What body do you prefer (light/medium/full)' finds preferred_body of wine. 'What colour do you prefer (red/white)' finds preferred_colour of wine. 'What sweetness do you prefer (dry/medium/sweet)' finds preferred_sweetness of wine. 'What is the main bit (meat/poultry/fish)' finds main_bit of meal. 'Is it a veal dish (yes/no)' finds has_veal. 'Is it a turkey dish (yes/no)' finds has_turkey. rule1: if tastiness of meal=delicate then body of wine=light cf 800. rule2: if tastiness of meal=average then body of wine=light cf 300 and body of wine=medium cf 600 and body of wine=full cf 300. rule3: if tastiness of meal=strong then body of wine=medium cf 400 and body of wine=full cf 800. rule4: if has_sauce=yes and sauce of meal=spicy then body of wine=full cf 1000 and special_characteristics of meal=spiciness cf 1000. rule5: if has_sauce=yes and sauce of meal=creamy then body of wine=medium cf 400 and body of wine=full cf 600. rule6: if body of wine is unknown and preferred_body of wine is unknown then body of wine=medium cf 1000. rule7: if preferred_body of wine=X and body of wine is known then body of wine=X cf 200. rule8: if preferred_body of wine=light and body of wine=full then body of wine=medium cf 1000. rule9: if preferred_body of wine=full and body of wine=light then body of wine=medium cf 1000. rule10: if preferred_body of wine=X and body of wine is unknown then body of wine=X cf 1000. rule11: if main_bit of meal=meat and has_veal=no then colour of wine=red cf 900. rule12: if main_bit of meal=poultry and has_turkey=no then colour of wine=white cf 900 and colour of wine=red cf 300. rule13: if main_bit of meal=fish then colour of wine=white cf 1000. rule14: if main_bit of meal is known and has_sauce=yes and sauce of meal=tomatoey then colour of wine=red cf 1000. rule15: if main_bit of meal=poultry and has_turkey=yes then colour of wine=red cf 800 and colour of wine=white cf 500. rule16: if main_bit of meal is unknown and has_sauce=yes and sauce of meal=creamy then colour of wine=white cf 400. rule17: if colour of wine is unknown and preferred_colour of wine is unknown then colour of wine=red cf 500 and colour of wine=white cf 500. rule18: if preferred_colour of wine=X and colour of wine is known then colour of wine=X cf 200. rule19: if preferred_colour of wine=X and colour of wine is unknown then colour of wine=X cf 1000. rule20: if has_sauce=yes and sauce of meal=sweet then sweetness of wine=sweet cf 900 and sweetness of wine=medium cf 400. rule21: if sweetness of wine is unknown and preferred_sweetness of wine is unknown then sweetness of wine=medium cf 1000. rule22: if preferred_sweetness of wine=X and sweetness of wine is known then sweetness of wine=X cf 200. rule23: if preferred_sweetness of wine=X and sweetness of wine is unknown then sweetness of wine=X cf 1000. rule24: if preferred_sweetness of wine=dry and sweetness of wine=sweet then sweetness of wine=medium cf 1000. rule25: if preferred_sweetness of wine=sweet and sweetness of wine=dry then sweetness of wine=medium cf 1000. rule26: if colour of wine=red and body of wine=medium and sweetness of wine=medium or sweetness of wine=sweet then wine=gamay cf 1000. rule27: if colour of wine=white and body of wine=light and sweetness of wine=dry then wine=chablis cf 1000. rule28: if colour of wine=white and body of wine=medium and sweetness of wine=dry then wine=sauvignon_blanc cf 1000. rule29: if colour of wine=white and body of wine=medium or body of wine=full and sweetness of wine=dry or sweetness of wine=medium then wine=chardonnay cf 1000. rule30: if colour of wine=white and body of wine=light and sweetness of wine=dry or sweetness of wine=medium then wine=soave cf 1000. rule31: if colour of wine=white and body of wine=light or body of wine=medium and sweetness of wine=sweet or sweetness of wine=medium then wine=riesling cf 1000. rule32: if colour of wine=white and body of wine=full and special_characteristics of meal=spiciness then wine=gewurtztraminer cf 1000. rule33: if colour of wine=white and body of wine=light and sweetness of wine=medium or sweetness of wine=sweet then wine=chenin_blanc cf 1000. rule34: if colour of wine=red and body of wine=light then wine=valpolicella cf 1000. rule35: if colour of wine=red and sweetness of wine=dry or sweetness of wine=medium then wine=cabernet_sauvignon cf 1000 and wine=zinfandel cf 1000. rule36: if colour of wine=red and body of wine=medium and sweetness of wine=medium then wine=pinot_noir cf 1000. rule37: if colour of wine=red and body of wine=full then wine=burgundy cf 1000.