REM Demo knowledge base for basic wine selection decisions PARAM [apptitle] = "Wine Selection Knowledge Base" PARAM [bgcolor] = "#990033" PARAM [promptcolor] = "#ffffff" PARAM [titlecolor] = "#ffff00" PARAM [disclaimer] = "A simplified wine selector intended for use only as an expert system demonstration" REM APERITIF RULE [choosing a dry, full bodied aperitif] If [this wine] = "to be consumed before a meal (aperitif)" and [the preferred body] : "medium" "full" and [the preferred sweetness] = "dry" and [the preferred taste] : "smooth" "no preference" Then [a suggested wine] = "dry sherry" RULE [choosing a sparkling aperitif] If [this wine] = "to be consumed before a meal (aperitif)" and [the preferred body] : "light" "medium" and [the preferred sweetness] : "sweet" "medium dry" and [a sparkling wine] = "preferred" Then [a suggested wine] = "Champagne" and [a suggested wine] = "sparkling white" RULE [choosing a sweet non-sparkling aperitif] If [this wine] = "to be consumed before a meal (aperitif)" and [the preferred body] : "light" "medium" and [the preferred sweetness] : "sweet" and [a sparkling wine] = "not preferred" Then [a suggested wine] = "white Zinfandel" RULE [choosing a non-sparkling aperitif] If [this wine] = "to be consumed before a meal (aperitif)" and [the preferred body] : "light" "medium" and [the preferred sweetness] : "medium dry" "dry" and [a sparkling wine] = "not preferred" Then [a suggested wine] = "Sauvignon blanc" and [a suggested wine] = "Riesling" RULE [choosing a default aperitif] If [this wine] = "to be consumed before a meal (aperitif)" and [a suggested wine] = "not defined by user responses" Then [the default suggestion] = "Chablis" REM CHEESE RULE [mixed cheese: white] If [this wine] = "to accompany cheese" and [the type of cheese] = "a variety of cheeses" and [the preferred wine color] : "white" "no preference" Then [a suggested wine] = "Sauvignon/Fume Blanc" RULE [mixed cheese: red] If [this wine] = "to accompany cheese" and [the type of cheese] = "a variety of cheeses" and [the preferred wine color] = "red" Then [a suggested wine] = "Merlot" and [a suggested wine] = "Pinot Noir" and [a suggested wine] = "Zinfandel" RULE [mild cheese: red] If [this wine] = "to accompany cheese" and [the type of cheese] = "primarily mild cheeses" and [the preferred wine color] = "red" Then [a suggested wine] = "Beaujolais" RULE [mild cheese: white] If [this wine] = "to accompany cheese" and [the type of cheese] = "primarily mild cheeses" and [the preferred wine color] : "white" "no preference" Then [a suggested wine] = "Riesling" RULE [strong cheese] If [this wine] = "to accompany cheese" and [the type of cheese] = "primarily strong cheeses" Then [a suggested wine] = "Cabernet Sauvignon" RULE [choosing a default wine to accompany cheese] If [this wine] = "to accompany cheese" and [a suggested wine] = "not defined by user responses" Then [the default suggestion] = "Chablis" REM DESSERT RULE [no dessert, sweet] If [this wine] = "to be consumed with dessert or after dinner" and [the dessert] = "no dessert -- served by itself" Then [a suggested wine] = "ruby Port" RULE [fruity dessert, sparkling] If [this wine] = "to be consumed with dessert or after dinner" and [the dessert] = "fruit or primarily fruit" and [a sparkling wine] = "preferred" Then [a suggested wine] = "Champagne" and [a suggested wine] = "sparkling white" RULE [fruity dessert, not sparkling] If [this wine] = "to be consumed with dessert or after dinner" and [the dessert] = "fruit or primarily fruit" and [a sparkling wine] = "not preferred" Then [a suggested wine] = "sweet Sherry" RULE [sweet dessert] If [this wine] = "to be consumed with dessert or after dinner" and [the dessert] = "very sweet (such as chocolate)" Then [a suggested wine] = "ruby Port" RULE [choosing a default wine to accompany dessert] If [this wine] = "to be consumed with dessert or after dinner" and [a suggested wine] = "not defined by user responses" Then [the default suggestion] = "ruby Port" REM ENTREE: COLD MEAT RULE [cold meat entree] If [this wine] = "to accompany an entree" and [the entree] = "cold meats" Then [a suggested wine] = "Chablis" REM ENTREE: EGG DISHES RULE [egg dishes sparkling] If [this wine] = "to accompany an entree" and [the entree] = "an egg dish" and [a sparkling wine] = "preferred" Then [a suggested wine] = "Champagne" and [a suggested wine] = "sparkling white" RULE [egg dishes] If [this wine] = "to accompany an entree" and [the entree] = "an egg dish" and [a sparkling wine] = "not preferred" Then [a suggested wine] = "white Zinfandel" REM FISH: (NOT SHELLFISH) RULE [fish prefer red] If [this wine] = "to accompany an entree" and [the entree] = "fish" and [the preferred wine color] = "red" Then [a suggested wine] = "Beaujolais" RULE [fish prefer sparkling] If [this wine] = "to accompany an entree" and [the entree] = "fish" and [a sparkling wine] = "preferred" Then [a suggested wine] = "Champagne" and [a suggested wine] = "sparkling white" RULE [fish dry white] If [this wine] = "to accompany an entree" and [the entree] = "fish" and [a sparkling wine] = "not preferred" and [the preferred sweetness] = "dry" Then [a suggested wine] = "Chardonnay" and [a suggested wine] = "Sauvignon/Fume Blanc" RULE [fish sweeter white] If [this wine] = "to accompany an entree" and [the entree] = "fish" and [a sparkling wine] = "not preferred" and [the preferred sweetness] : "sweet" "medium dry" Then [a suggested wine] = "Riesling" and [a possible label description] = "sweet or medium dry" REM ENTREE: GAME RULE [game lighter bodied] If [this wine] = "to accompany an entree" and [the entree] = "game" and [the preferred body] : "light" "medium" Then [a suggested wine] = "Pinot Noir" RULE [game full bodied] If [this wine] = "to accompany an entree" and [the entree] = "game" and [the preferred body] : "full" "no preference" Then [a suggested wine] = "Cabernet Sauvignon" and [a suggested wine] = "Pinot Noir" and [a possible label description] = "full bodied" REM ENTREE: ITALIAN MEAT AND/OR CHEESE RULE [Italian meat/cheese entree] If [this wine] = "to accompany an entree" and [the entree] = "an Italian meat and/or cheese dish" Then [a suggested wine] = "Chianti" REM ENTREE: LAMB RULE [lamb] If [this wine] = "to accompany an entree" and [the entree] = "lamb" Then [a suggested wine] = "Cabernet Sauvignon" and [a suggested wine] = "Merlot" REM ENTREE: LIGHT MEAT RULE [light meat light red] If [this wine] = "to accompany an entree" and [the entree] = "a light meat (pork, veal, etc.)" and [the preferred wine color] = "red" and [the preferred body] = "light" Then [a suggested wine] = "Beaujolais" RULE [light meat heavier red] If [this wine] = "to accompany an entree" and [the entree] = "a light meat (pork, veal, etc.)" and [the preferred wine color] = "red" and [the preferred body] = "full" Then [a suggested wine] = "Chianti" RULE [light meat medium red] If [this wine] = "to accompany an entree" and [the entree] = "a light meat (pork, veal, etc.)" and [the preferred wine color] = "red" and [the preferred body] = "medium" Then [a suggested wine] = "Chianti" and [a suggested wine] = "Beaujolais" @ 90 RULE [light meat sweet white] If [this wine] = "to accompany an entree" and [the entree] = "a light meat (pork, veal, etc.)" and [the preferred wine color] : "white" "no preference" and [the preferred sweetness] : "sweet" "medium dry" Then [a suggested wine] = "Riesling" and [a possible label description] = "sweet or medium dry" RULE [light meat dry white] If [this wine] = "to accompany an entree" and [the entree] = "a light meat (pork, veal, etc.)" and [the preferred wine color] : "white" "no preference" and [the preferred sweetness] = "dry" Then [a suggested wine] = "Chardonnay" and [a suggested wine] = "Sauvignon/Fume Blanc" and [a suggested wine] = "Chablis" @ 90 and [a possible label description] = "dry" REM ENTREE: PASTA (TOMATO) RULE [pasta] If [this wine] = "to accompany an entree" and [the entree] = "pasta (tomato sauce)" Then [a suggested wine] = "Chianti" REM ENTREE: PICNIC FOOD RULE [picnic food] If [this wine] = "to accompany an entree" and [the entree] = "picnic food" Then [a suggested wine] = "white Zinfandel" REM ENTREE: POULTRY RULE [poultry] If [this wine] = "to accompany an entree" and [the entree] = "poultry" Then [a suggested wine] = "Sauvignon/Fume Blanc" REM ENTREE: POULTRY (ROASTED) RULE [poultry (roasted)] If [this wine] = "to accompany an entree" and [the entree] = "poultry (roasted)" Then [a suggested wine] = "Pinot Noir" REM ENTREE: RED MEAT RULE [full bodied red] If [this wine] = "to accompany an entree" and [the entree] = "red meat (steak, roast beef, etc.)" and [the preferred body] : "full" Then [a suggested wine] = "Cabernet Sauvignon" and [a suggested wine] = "Merlot" and [a possible label description] = "full bodied" RULE [lighter bodied red] If [this wine] = "to accompany an entree" and [the entree] = "red meat (steak, roast beef, etc.)" and [the preferred body] : "light" "medium" Then [a suggested wine] = "Pinot Noir" and [a suggested wine] = "Zinfandel" @ 90 and [a possible label description] = "light/medium bodied" REM ENTREE: SHELLFISH RULE [shellfish] If [this wine] = "to accompany an entree" and [the entree] = "shellfish" Then [a suggested wine] = "Chardonnay" and [a suggested wine] = "Chablis" REM ENTREE: DEFAULT RULE [choosing a default entree wine: red] If [this wine] = "to accompany an entree" and [a suggested wine] = "not defined by user responses" and [the preferred wine color] = "red" Then [the default suggestion] = "red Burgundy" RULE [choosing a default entree wine: white] If [this wine] = "to accompany an entree" and [a suggested wine] = "not defined by user responses" and [the preferred wine color] = "white" Then [the default suggestion] = "Chablis" REM KB COMPONENTS BELOW MUST FOLLOW ALL RULES: LAST GOAL LISTED IS FIRST SOUGHT GOAL [the default suggestion] GOAL [a possible label description] GOAL [a suggested wine] DEFAULT [a suggested wine] = "not defined by user responses" DEFAULT [the preferred taste] = "no preference" DEFAULT [the preferred body] = "no preference" DEFAULT [the preferred wine color] = "no preference" DEFAULT [a sparkling wine] = "not preferred" DEFAULT [the type of cheese] = "a variety of cheeses" NOSHOW MAXVALS [a suggested wine] 3 PROMPT [the preferred taste] MultChoice "Do you have a strong preference for one of the following tastes? If not, leave default (don't know) response." "crisp" "smooth" PROMPT [the preferred sweetness] MultChoice "Do you have a strong preference for one of the following degrees of dryness? If not, leave default (don't know) response." "sweet" "medium dry" "dry" PROMPT [the preferred body] MultChoice CF "Do you have a strong preference for one of the following bodies? If not, leave default (don't know) response." "light" "medium" "full" PROMPT [the preferred wine color] MultChoice "Do you have a strong preference for one of the following wine colors? If not, leave default (don't know) response." "white" "red" PROMPT [a sparkling wine] MultChoice "A sparkling wine is:" "preferred" "not preferred" PROMPT [the dessert] MultChoice CF "The dessert this wine will be served with will be:" "no dessert -- served by itself" "fruit or primarily fruit" "very sweet (such as chocolate)" PROMPT [the type of cheese] ForcedChoice CF "The type of cheese to be served is:" "a variety of cheeses" "primarily mild cheeses" "primarily strong cheeses" PROMPT [this wine] MultChoice CF "This wine is:" "to be consumed before a meal (aperitif)" "to accompany cheese" "to accompany an entree" "to be consumed with dessert or after dinner" PROMPT [the entree] Choice CF "The wine will be served with the following entree:" "cold meats" "an egg dish" "fish" "game" "an Italian meat and/or cheese dish" "lamb" "a light meat (pork, veal, etc.)" "pasta (tomato sauce)" "picnic food" "poultry" "poultry (roasted)" "red meat (steak, roast beef, etc.)" "shellfish" REM To run with the e2gRuleEngine applet, INFOLINKs and HYPERLINKs must be on the Web REM server from which e2gRuleEngine.jar was loaded. This is a Java applet security requirement REM that does not apply to e2gDroid since it is not an applet. INFOLINK [the preferred sweetness] "http://expertise2go.com/Android/wineref.htm#DRYNESS" INFOLINK [the preferred body] "http://expertise2go.com/Android/wineref.htm#BODY" INFOLINK [the preferred wine color] "http://expertise2go.com/Android/wineref.htm#COLOR" HYPERLINK [a suggested wine] = "dry Sherry" "http://expertise2go.com/Android/winestore.htm#DRYSHERRY" HYPERLINK [a suggested wine] = "Chablis" "http://expertise2go.com/Android/winestore.htm#CHABLIS" HYPERLINK [a suggested wine] = "red Burgundy" "http://expertise2go.com/Android/winestore.htm#REDBURGUNDY" HYPERLINK [a suggested wine] = "Riesling" "http://expertise2go.com/Android/winestore.htm#RIESLING"