;;;(load "/Customize.lisp") ;; customize ;;(in-package 'USER) (setq *topdir* "/usr/local/ai-tools/classic/kr/kr-lab") (defun lload (f) (load (concatenate 'string *topdir* f))) ;;;(lload "Recover/after-just-wines.lisp") ;;;(in-package 'USER) ;;;(lload "Recover/after-wine-varieties.lisp") ;;;(in-package 'USER) ;;;(lload "Recover/after-generic-wines.lisp") ;;;(lload "Recover/after-wineries.lisp") ;;;(lload "Recover/until-wineries.lisp") ;;;(lload "Recover/after-regional-winery.lisp") ;;;(lload "Recover/until-regional-winery.lisp") ;;;(lload "Recover/after-meal-food") ;;;(lload "Recover/after-wine-properties.lisp") ;;;(lload "Recover/after-consumable-thing.lisp") (cl-startup) (CLASSIC::util-set-debug 0) (CLASSIC::util-set-warn nil) ;; Define the other topmost concepts. (print "load basic concepts") (cl-define-disjoint-primitive-concept 'wine-property 'classic-thing 'classic-thing-type) (cl-define-disjoint-primitive-concept 'consumable-thing 'classic-thing 'classic-thing-type) (cl-define-disjoint-primitive-concept 'winery 'classic-thing 'classic-thing-type) (cl-define-disjoint-primitive-concept 'wine-region 'classic-thing 'classic-thing-type) ;; Consumable-things (cl-define-disjoint-primitive-concept 'potable-liquid 'consumable-thing 'consumable-thing-type) (cl-define-disjoint-primitive-concept 'edible-thing 'consumable-thing 'consumable-thing-type) ;; WINE-PROPERTY's subconcepts (cl-define-concept 'WINE-COLOR '(AND WINE-PROPERTY (ONE-OF White Rose Red))) (cl-populate 'WINE-COLOR '(White Rose Red)) (cl-define-concept 'WINE-BODY '(AND WINE-PROPERTY (ONE-OF Light Medium Full))) (cl-populate 'WINE-BODY '(Light Medium Full)) (cl-define-concept 'WINE-FLAVOR '(AND WINE-PROPERTY (ONE-OF Delicate Moderate Strong))) (cl-populate 'WINE-FLAVOR '(Delicate Moderate Strong)) (cl-define-concept 'WINE-SUGAR '(AND WINE-PROPERTY (ONE-OF Sweet Off-Dry Dry))) (cl-populate 'WINE-SUGAR '(Sweet Off-Dry Dry)) ;; WINE (cl-define-primitive-role 'color :attribute t) (cl-define-primitive-role 'body :attribute t) (cl-define-primitive-role 'flavor :attribute t) (cl-define-primitive-role 'sugar :attribute t) (cl-define-primitive-role 'grape :attribute t) (cl-define-concept 'WINE '(and POTABLE-LIQUID (AT-LEAST 1 color) (ALL color WINE-COLOR) (AT-LEAST 1 body) (ALL body WINE-BODY) (AT-LEAST 1 flavor) (ALL flavor WINE-FLAVOR) (AT-LEAST 1 sugar) (ALL sugar WINE-SUGAR) (AT-LEAST 1 grape)(ALL grape EDIBLE-THING))) ;;MEAL-FOOD (cl-define-primitive-role 'appropriate-drink) (cl-define-concept 'MEAL-FOOD '(and EDIBLE-THING (ALL appropriate-drink WINE))) ;;;(lload "Helper/meal-foods.lisp") (print "load foods") ;;(in-package 'USER) ; Sorry, notational conventions not followed here. ;; MEAL-FOOD direct subconcepts. ;The "type" partition (cl-define-disjoint-primitive-concept 'fruit 'meal-food 'type) (cl-define-disjoint-primitive-concept 'seafood 'meal-food 'type) (cl-define-disjoint-primitive-concept 'fowl 'meal-food 'type) (cl-define-disjoint-primitive-concept 'meat 'meal-food 'type) (cl-define-disjoint-primitive-concept 'pasta 'meal-food 'type) ;The "meal-role" partition (cl-define-primitive-concept 'appetizer 'meal-food ) (cl-define-primitive-concept 'entree 'meal-food ) (cl-define-primitive-concept 'dessert 'meal-food ) ;; FRUIT subconcepts (cl-define-disjoint-primitive-concept 'sweet-fruit 'fruit 'fruit-sweetness) (cl-define-disjoint-primitive-concept 'non-sweet-fruit 'fruit 'fruit-sweetness) (cl-define-primitive-concept 'grape 'sweet-fruit) ;These are not necessarily disjoint---we define them to have a ; special category for grapes that are used in making wines: (cl-define-primitive-concept 'wine-grape 'grape) (cl-define-primitive-concept 'eating-grape 'grape) ;; SEAFOOD subconcepts (cl-define-disjoint-primitive-concept 'shellfish 'seafood 'seafood-shells) (cl-define-disjoint-primitive-concept 'fish 'seafood 'seafood-shells) (cl-define-disjoint-primitive-concept 'oyster-shellfish 'shellfish 'shellfish-oysters) (cl-define-disjoint-primitive-concept 'non-oyster-shellfish 'shellfish 'shellfish-oysters) (cl-define-disjoint-primitive-concept 'bland-fish 'fish 'fish-spice) (cl-define-disjoint-primitive-concept 'non-bland-fish 'fish 'fish-spice) ;; FOWL subconcepts (cl-define-disjoint-primitive-concept 'light-meat-fowl 'fowl 'fowl-darkness) (cl-define-disjoint-primitive-concept 'dark-meat-fowl 'fowl 'fowl-darkness) ;; MEAT subconcepts (cl-define-disjoint-primitive-concept 'red-meat 'meat 'meat-color) (cl-define-disjoint-primitive-concept 'non-red-meat 'meat 'meat-color) (cl-define-disjoint-primitive-concept 'spicy-red-meat 'red-meat 'red-meat-spiciness) (cl-define-disjoint-primitive-concept 'non-spicy-red-meat 'red-meat 'red-meat-spiciness) ;; PASTA subconcepts (cl-define-disjoint-primitive-concept 'pasta-with-white-sauce 'pasta 'paste-sauce-color) (cl-define-disjoint-primitive-concept 'pasta-with-heavy-cream-sauce 'pasta-with-white-sauce 'pasta-with-white-sauce-heaviness) (cl-define-disjoint-primitive-concept 'pasta-with-light-cream-sauce 'pasta-with-white-sauce 'pasta-with-white-sauce-heaviness) (cl-define-disjoint-primitive-concept 'pasta-with-red-sauce 'pasta 'pasta-sauce-color) (cl-define-disjoint-primitive-concept 'pasta-with-spicy-red-sauce 'pasta-with-red-sauce 'pasta-with-red-sauce-spiciness) (cl-define-disjoint-primitive-concept 'pasta-with-non-spicy-red-sauce 'pasta-with-red-sauce 'pasta-with-red-sauce-spiciness) ;; DESSERT subconcepts (cl-define-disjoint-primitive-concept 'cheese/nuts-dessert 'dessert 'dessert-type) (cl-define-disjoint-primitive-concept 'sweet-dessert 'dessert 'dessert-type) ;;;(lload "Helper/wineries-and-regions.lisp") (print "load wine regions ") ;;(in-package 'USER) ; repetitions of individuals are ignored ;; THE WINE-REGION INSTANCES (cl-create-ind 'Medoc 'WINE-REGION) ;typed by student (cl-create-ind 'Bordeaux 'WINE-REGION) ;typed by student (cl-create-ind 'Bourgogne 'WINE-REGION) (cl-create-ind 'Loire 'WINE-REGION) (cl-create-ind 'Beaujolais 'WINE-REGION) (cl-create-ind 'Napa-valley 'WINE-REGION) ;typed by student (cl-create-ind 'Sonoma 'WINE-REGION) (cl-create-ind 'Santa-cruz-mountains 'WINE-REGION) (cl-create-ind 'Santa-barbara 'WINE-REGION) (cl-create-ind 'Alsace 'WINE-REGION) (cl-create-ind 'Chianti 'WINE-REGION) (cl-create-ind 'Piemonte 'WINE-REGION) ;;; THE WINERY INSTANCES (cl-create-ind 'Forman 'WINERY) ;typed by student (cl-create-ind 'Page-mill-winery 'WINERY) (cl-create-ind 'Whitehall-lane 'WINERY) (cl-create-ind 'Mount-eden-vineyard 'WINERY) (cl-create-ind 'Elyse 'WINERY) (cl-create-ind 'Santa-cruz-mountain-vineyard 'WINERY) (cl-create-ind 'Lane-tanner 'WINERY) (cl-create-ind 'Foxen 'WINERY) (cl-create-ind 'Corton-Montrachet 'WINERY) (cl-create-ind 'Puligny-Montrachet 'WINERY) (cl-create-ind 'Handley 'WINERY) (cl-create-ind 'Kalin-Cellars 'WINERY) ;typed by student (cl-create-ind 'Congress-Springs 'WINERY) (cl-create-ind 'Ventana 'WINERY) (cl-create-ind 'Schloss-Volrad 'WINERY) (cl-create-ind 'Schloss-Rothermel 'WINERY) (cl-create-ind 'Marietta 'WINERY) (cl-create-ind 'Cotturi 'WINERY) (cl-create-ind 'Chateau-Lafite-Rothschild 'WINERY) (cl-create-ind 'Chateau-Margaux-Winery 'WINERY) (cl-create-ind 'Chateau-Cheval-Blanc 'WINERY) (cl-create-ind 'Chateau-Morgon 'WINERY) (cl-create-ind 'Chateau-D-Ychem 'WINERY) (cl-create-ind 'Chateau-De-Meursault 'WINERY) (cl-create-ind 'Sevre-Et-Maine 'WINERY) (cl-create-ind 'Clos-De-La-Poussie 'WINERY) (cl-create-ind 'D-Anjou 'WINERY) (cl-create-ind 'Mcguinnesso 'WINERY) (cl-create-ind 'Mazocco 'WINERY) ;;;(lload "Helper/meal-food-instances.lisp") ;;(in-package 'USER) (print "load food instances ") ; THE MEAL-FOOD INSTANCES (cl-create-ind 'oysters 'oyster-shellfish) (cl-create-ind 'clams 'non-oyster-shellfish) (cl-create-ind 'mussels 'non-oyster-shellfish) (cl-create-ind 'crab 'non-oyster-shellfish) (cl-create-ind 'lobster 'non-oyster-shellfish) (cl-create-ind 'scrod 'bland-fish) (cl-create-ind 'halibut 'bland-fish) (cl-create-ind 'flounder 'bland-fish) (cl-create-ind 'swordfish 'non-bland-fish) (cl-create-ind 'tuna 'non-bland-fish) (cl-create-ind 'chicken 'light-meat-fowl) (cl-create-ind 'turkey 'light-meat-fowl) (cl-create-ind 'duck 'dark-meat-fowl) (cl-create-ind 'goose 'dark-meat-fowl) (cl-create-ind 'pork 'non-red-meat) (cl-create-ind 'garlicky-roast 'spicy-red-meat) (cl-create-ind 'beef-curry 'spicy-red-meat) (cl-create-ind 'veal 'non-spicy-red-meat) (cl-create-ind 'steak 'non-spicy-red-meat) (cl-create-ind 'roast-beef 'non-spicy-red-meat) (cl-create-ind 'fettuccine-alfredo 'pasta-with-heavy-cream-sauce) (cl-create-ind 'pasta-with-white-clam-sauce 'pasta-with-light-cream-sauce) (cl-create-ind 'fra-diavolo 'pasta-with-spicy-red-sauce) (cl-create-ind 'spaghetti-with-tomato-sauce 'pasta-with-non-spicy-red-sauce) (cl-create-ind 'bananas 'sweet-fruit) (cl-create-ind 'peaches 'sweet-fruit) (cl-create-ind 'mixed-fruit 'sweet-fruit) (cl-create-ind 'apples 'non-sweet-fruit) (cl-create-ind 'cheese 'cheese/nuts-dessert) (cl-create-ind 'nuts 'cheese/nuts-dessert) (cl-create-ind 'pie 'sweet-dessert) (cl-create-ind 'cake 'sweet-dessert) (cl-create-ind 'chardonnay 'wine-grape) (cl-create-ind 'chenin-blanc 'wine-grape) (cl-create-ind 'sauvignon-blanc 'wine-grape) (cl-create-ind 'semillon 'wine-grape) (cl-create-ind 'riesling 'wine-grape) (cl-create-ind 'cabernet-sauvignon 'wine-grape) (cl-create-ind 'pinot-noir 'wine-grape) (cl-create-ind 'zinfandel 'wine-grape) (cl-create-ind 'merlot 'wine-grape) (cl-create-ind 'gamay 'wine-grape) (cl-create-ind 'sangiovese 'wine-grape) (cl-create-ind 'cabernet-franc 'wine-grape) (cl-create-ind 'malbec 'wine-grape) (cl-create-ind 'petite-verdot 'wine-grape) (cl-create-ind 'petite-syrah 'wine-grape) (cl-create-ind 'thompson-seedless 'eating-grape) ; WINE-REGION subclasses (cl-define-concept 'FRENCH-WINE-REGION '(AND WINE-REGION ; explicit, because WINE-REGION is a primitive (ONE-OF Bordeaux Bourgogne Loire Medoc))) (cl-define-concept 'AMERICAN-WINE-REGION '(AND WINE-REGION (ONE-OF Napa-valley Sonoma Santa-cruz-mountains Santa-barbara))) (cl-define-concept 'OTHER-EUROPEAN-WINE-REGION '(AND WINE-REGION (ONE-OF Alsace Chianti Piemonte))) ; REGIONAL-WINERY (cl-define-primitive-role 'region :attribute t :inverse 'wineries) ;an attribute withan inverse (cl-define-concept 'REGIONAL-WINERY '(AND WINERY (ALL region WINE-REGION) (AT-LEAST 1 region))) #| The above one is the best definition. An alternative definition is: (cl-define-role 'region) ; a generic role (cl-define-concept 'REGIONAL-WINERY '(AND WINERY (ALL region WINE-REGION) (AT-LEAST 1 region) (AT-MOST 1 region))) But making region a generic role will make this concept more verbose than it needs to be and will make the definitions of subconcepts of REGIONAL-WINERY more complex as well. |# ; REGIONAL-WINERY subclasses (cl-define-concept 'FRENCH-WINERY '(AND WINERY (ALL region FRENCH-WINE-REGION))) (cl-define-concept 'AMERICAN-WINERY '(AND WINERY (ALL region AMERICAN-WINE-REGION))) (cl-define-concept 'OTHER-EUROPEAN-WINERY '(AND WINERY (ALL region OTHER-EUROPEAN-WINE-REGION))) #| If you did not declare region as an attribute and used the AT-LEAST/AT-MOST pair in the definition of REGIONAL winery, you will need to add them here too: e.g. (cl-define-concept 'AMERICAN-WINERY '(AND WINERY (ALL region AMERICAN-WINE-REGION) (AT-LEAST 1 region) (AT-MOST 1 region))) |# ;;;(lload "Helper/winery-region-info.lisp") ;; Region information for wineries (this may not be accurate in the real world) (cl-ind-add @i{Forman} '(FILLS region napa-valley)) (cl-ind-add @i{Page-mill-winery} '(FILLS region napa-valley)) (cl-ind-add @i{Whitehall-lane} '(FILLS region napa-valley)) (cl-ind-add @i{Handley} '(FILLS region napa-valley)) (cl-ind-add @i{Kalin-Cellars} '(FILLS region napa-valley)) (cl-ind-add @i{Congress-Springs} '(FILLS region Sonoma)) (cl-ind-add @i{Mount-eden-vineyard} '(FILLS region santa-cruz-mountains)) (cl-ind-add @i{Ventana} '(FILLS region napa-valley)) (cl-ind-add @i{Elyse} '(FILLS region napa-valley)) (cl-ind-add @i{Marietta} '(FILLS region Sonoma)) (cl-ind-add @i{Cotturi} '(FILLS region Sonoma)) (cl-ind-add @i{Santa-cruz-mountain-vineyard} '(FILLS region santa-cruz-mountains)) (cl-ind-add @i{Lane-tanner} '(FILLS region santa-barbara)) (cl-ind-add @i{Foxen} '(FILLS region santa-barbara)) ;; FRANCE (cl-ind-add @i{Corton-Montrachet} '(FILLS region Bourgogne)) (cl-ind-add @i{Puligny-Montrachet} '(FILLS region Bourgogne)) (cl-ind-add @i{Chateau-Morgon} '(FILLS region Bourgogne)) (cl-ind-add @i{Chateau-De-Meursault} '(FILLS region Bourgogne)) (cl-ind-add @i{Chateau-Cheval-Blanc} '(FILLS region Bordeaux)) (cl-ind-add @i{Chateau-D-Ychem} '(FILLS region Bordeaux)) (cl-ind-add @i{Sevre-Et-Maine} '(FILLS region Loire)) (cl-ind-add @i{Clos-De-La-Poussie} '(FILLS region Loire)) (cl-ind-add @i{D-Anjou} '(FILLS region Loire)) (cl-ind-add @i{Chateau-Lafite-Rothschild} '(FILLS region Medoc)) (cl-ind-add @i{Chateau-Margaux-Winery '(FILLS region Medoc)) ;; GERMANY ;;(cl-ind-add @i{Schloss-Volrad} '(FILLS region Germany)) ;;(cl-ind-add @i{Schloss-Rothermel} '(FILLS region Germany)) ;; ITALY (cl-ind-add @i{Mazocco} '(FILLS region Piemonte)) (cl-ind-add @i{Mcguinnesso} '(FILLS region Chianti)) ;; ALSACE ; added by VCS (cl-create-ind 'Alsace-Grand-Crux '(AND WINERY (FILLS region Alsace))) ; GENERIC WINE TYPES (cl-define-concept 'RED-WINE '(AND WINE (FILLS color Red))) (cl-define-concept 'ROSE-WINE '(AND WINE (FILLS color Rose))) (cl-define-concept 'WHITE-WINE '(AND WINE (FILLS color White))) (cl-define-concept 'WHITE-NON-SWEET-WINE '(AND WHITE-WINE (all sugar (ONE-OF Dry Off-Dry)))) (cl-define-concept 'FULL-BODIED-WINE '(AND WINE (FILLS body Full))) (cl-define-concept 'DRY-WINE '(AND WINE (FILLS sugar Dry))) (cl-define-concept 'DRY-WHITE-WINE '(AND DRY-WINE WHITE-WINE)) (cl-define-concept 'DRY-RED-WINE '(AND DRY-WINE RED-WINE)) (cl-define-concept 'SWEET-WINE '(AND WINE (FILLS sugar Sweet))) (cl-define-primitive-concept 'DESSERT-WINE '(AND WINE (ALL sugar (ONE-OF Off-dry Sweet)))) ;;;(lload "Helper/wine-varieties.lisp") ;;(in-package 'USER) ;;; THE WINE VARIETIES (print "load varietal information") ; general varieties (by grape) (cl-define-concept 'chardonnay '(and wine (fills grape chardonnay))) (cl-add-rule 'chardonnay-color @c{chardonnay} '(fills color white)) (cl-add-rule 'chardonnay-body @c{chardonnay} '(all body (one-of full medium))) (cl-add-rule 'chardonnay-flavor @c{chardonnay} '(all flavor (one-of strong moderate))) ;; Rules for 'WINE' (cl-add-rule 'wine-grape @c{WINE} '(ALL grape GRAPE)) (cl-define-primitive-role 'maker :attribute T) (cl-add-rule 'wine-maker @c{WINE} '(AND (ALL maker WINERY) (AT-LEAST 1 MAKER))) (cl-add-rule 'wine-region @c{WINE} '(AND (ALL region WINE-REGION) (AT-LEAST 1 region))) ;;More about wine varieties (cl-define-concept 'chenin-blanc '(and wine (fills grape chenin-blanc))) (cl-add-rule 'chenin-blanc-color @c{chenin-blanc} '(fills color white)) (cl-add-rule 'chenin-blanc-body @c{chenin-blanc} '(all body (one-of full medium))) (cl-add-rule 'chenin-blanc-flavor @c{chenin-blanc} '(fills flavor moderate)) (cl-add-rule 'chenin-blanc-sugar @c{chenin-blanc} '(all sugar (one-of dry off-dry))) (cl-define-concept 'semillon-or-sauvignon-blanc '(and wine (all grape (one-of semillon sauvignon-blanc)))) (cl-add-rule 'semillon-or-sauvignon-blanc-color @c{semillon-or-sauvignon-blanc} '(fills color white)) (cl-add-rule 'semillon-or-sauvignon-blanc-body @c{semillon-or-sauvignon-blanc} '(all body (one-of medium full))) (cl-define-concept 'sauvignon-blanc '(and semillon-or-sauvignon-blanc (fills grape sauvignon-blanc))) (cl-define-concept 'semillon '(and semillon-or-sauvignon-blanc (fills grape semillon))) (cl-define-concept 'riesling '(and wine (fills grape riesling))) (cl-add-rule 'riesling-color @c{riesling} '(fills color white)) (cl-define-concept 'dry-riesling '(and riesling (fills sugar dry))) (cl-add-rule 'dry-riesling-color @c{dry-riesling} '(fills color white)) (cl-add-rule 'dry-riesling-body @c{dry-riesling} '(all body (one-of light medium))) (cl-add-rule 'dry-riesling-flavor @c{dry-riesling} '(fills flavor delicate)) (cl-define-concept 'sweet-riesling '(and riesling (fills sugar sweet))) (cl-add-rule 'sweet-riesling-dessert-wine @c{sweet-riesling} 'dessert-wine) ;(cl-add-rule 'sweet-riesling-color @c{sweet-riesling} '(fills color white)) (cl-add-rule 'sweet-riesling-body @c{sweet-riesling} '(fills body full)) (cl-add-rule 'sweet-riesling-flavor @c{sweet-riesling} '(all flavor (one-of moderate strong))) (cl-define-concept 'cabernet-sauvignon-wine '(and wine (fills grape cabernet-sauvignon))) (cl-add-rule 'cabernet-sauvignon-color @c{cabernet-sauvignon-wine} '(fills color red)) (cl-add-rule 'cabernet-sauvignon-flavor @c{cabernet-sauvignon-wine} '(all flavor (one-of moderate strong))) (cl-add-rule 'cabernet-sauvignon-body @c{cabernet-sauvignon-wine} '(all body (one-of medium full))) (cl-add-rule 'cabernet-sauvignon-sugar @c{cabernet-sauvignon-wine} '(fills sugar dry)) (cl-define-concept 'pinot-noir '(and wine (fills grape pinot-noir) )) (cl-add-rule 'pinot-noir-color @c{pinot-noir} '(fills color red)) ;(cl-add-rule 'pinot-noir-body ; @c{pinot-noir} ; '(all body (one-of light medium))) ;(cl-add-rule 'pinot-noir-flavor ; @c{pinot-noir} ; '(all flavor (one-of moderate delicate))) (cl-define-concept 'pinot-blanc '(and wine (fills grape pinot-blanc) )) (cl-add-rule 'pinot-blanc-color @c{pinot-blanc} '(fills color white)) (cl-define-concept 'zinfandel '(and wine (fills grape zinfandel) )) (cl-add-rule 'zinfandel-color @c{zinfandel} '(fills color red)) (cl-add-rule 'zinfandel-body @c{zinfandel} '(all body (one-of full medium))) (cl-add-rule 'zinfandel-flavor @c{zinfandel} '(all flavor (one-of moderate strong))) (cl-add-rule 'zinfandel-sugar @c{zinfandel} '(fills sugar dry)) (cl-define-concept 'merlot-wine '(and wine (fills grape merlot) )) (cl-add-rule 'merlot-color @c{merlot-wine} '(fills color red)) (cl-add-rule 'merlot-flavor @c{merlot-wine} '(all flavor (one-of moderate delicate))) (cl-add-rule 'merlot-body @c{merlot-wine} '(all body (one-of light medium))) (cl-add-rule 'merlot-sugar @c{merlot-wine} '(fills sugar dry)) ;; regional varieties ; BORDEAUX (cl-define-concept 'bordeaux-wine '(and wine (fills region bordeaux))) (cl-define-concept 'white-bordeaux '(and bordeaux-wine white-wine)) (cl-add-rule 'white-bordeaux-grape @c{white-bordeaux} '(all grape (one-of semillon sauvignon-blanc))) (cl-define-concept 'red-bordeaux '(and bordeaux-wine red-wine)) (cl-add-rule 'red-bordeaux-grape @c{red-bordeaux} '(all grape (one-of cabernet-sauvignon merlot))) ; MEDOC: a subconcept of BORDEAUX (cl-define-concept 'medoc '(and wine (fills region medoc))) (cl-add-rule 'medoc-color @c{medoc} '(fills color red)) (cl-add-rule 'medoc-sugar @c{medoc} '(fills sugar dry)) (cl-define-primitive-concept 'pauillac 'medoc) (cl-add-rule 'pauillac-body @c{pauillac} '(fills body full)) (cl-add-rule 'pauillac-flavor @c{pauillac} '(fills flavor strong)) (cl-add-rule 'pauillac-grape @c{pauillac} '(and (fills grape cabernet-sauvignon) )) (cl-define-primitive-concept 'margaux 'medoc) (cl-add-rule 'margaux-flavor @c{margaux} '(fills flavor delicate)) (cl-add-rule 'margaux-body @c{margaux} '(fills body medium)) (cl-add-rule 'margaux-grape @c{margaux} '(and (fills grape merlot) )) ;; All wines have a harvest, but we are only using harvest for bordeaux. (cl-define-disjoint-primitive-concept 'early-harvest 'wine 'wine-harvest) (cl-add-rule 'early-harvest-sugar @c{early-harvest} '(all sugar (one-of dry off-dry))) (cl-define-disjoint-primitive-concept 'late-harvest 'wine 'wine-harvest) (cl-add-rule 'late-harvest-sugar @c{late-harvest} '(fills sugar sweet)) (cl-add-rule 'late-harvest-flavor @c{late-harvest} '(all flavor (one-of moderate strong))) ;; subconcepts of BORDEAUX (cl-define-primitive-concept 'st-emilion 'bordeaux-wine) (cl-add-rule 'st-emilion-color @c{st-emilion} '(fills color red)) (cl-add-rule 'st-emilion-flavor @c{st-emilion} '(fills flavor strong)) (cl-add-rule 'st-emilion-grape @c{st-emilion} '(and (fills grape cabernet-sauvignon) )) (cl-define-primitive-concept 'sauterne 'bordeaux-wine) (cl-add-rule 'sauterne-body @c{sauterne} '(fills body medium)) (cl-add-rule 'sauterne-color @c{sauterne} '(fills color white)) (cl-add-rule 'sauterne-harvest @c{sauterne} 'late-harvest) ; BURGUNDY (cl-define-concept 'burgundy '(and wine (fills region bourgogne))) (cl-add-rule 'burgundy-sugar @c{burgundy} '(fills sugar dry)) (cl-define-concept 'white-burgundy '(and burgundy white-wine)) (cl-add-rule 'white-burgundy-grape @c{white-burgundy} '(and (fills grape chardonnay) )) (cl-define-concept 'red-burgundy '(and burgundy red-wine)) (cl-add-rule 'red-burgundy-grape @c{red-burgundy} '(and (fills grape pinot-noir) )) (cl-define-primitive-concept 'cotes-d-or 'red-burgundy) (cl-add-rule 'cotes-d-or-flavor @c{cotes-d-or} '(fills flavor moderate)) (cl-define-primitive-concept 'meursault 'white-burgundy) (cl-add-rule 'meursault-body @c{meursault} '(fills body full)) ; BEAUJOLAIS (cl-define-primitive-concept 'beaujolais '(and wine (fills region beaujolais))) (cl-add-rule 'beaujolais-grape @c{beaujolais} '(and (fills grape gamay) )) (cl-add-rule 'beaujolais-color @c{beaujolais} '(fills color red)) (cl-add-rule 'beaujolais-body @c{beaujolais} '(fills body light)) (cl-add-rule 'beaujolais-flavor @c{beaujolais} '(fills flavor delicate)) ;LOIRE (cl-define-concept 'loire '(and wine (fills region loire))) (cl-define-concept 'white-loire '(and loire white-wine)) (cl-add-rule 'white-loire-grape @c{white-loire} '(all grape (one-of chenin-blanc pinot-blanc sauvignon-blanc))) (cl-define-primitive-concept 'muscadet 'loire) (cl-add-rule 'muscadet-grape @c{muscadet} '(and (fills grape pinot-blanc) )) (cl-add-rule 'muscadet-body @c{muscadet} '(fills body light)) (cl-add-rule 'muscadet-flavor @c{muscadet} '(fills flavor delicate)) (cl-add-rule 'muscadet-sugar @c{muscadet} '(fills sugar dry)) (cl-define-primitive-concept 'sancerre 'loire) (cl-add-rule 'sancerre-grape @c{sancerre} '(and (fills grape sauvignon-blanc) )) (cl-add-rule 'sancerre-body @c{sancerre} '(fills body medium)) (cl-add-rule 'sancerre-sugar @c{sancerre} '(fills sugar off-dry)) (cl-add-rule 'sancerre-flavor @c{sancerre} '(fills flavor delicate)) (cl-define-primitive-concept 'tours 'loire) ;; all the other characteristics are associated with chenin-blanc. (cl-add-rule 'tours-grape @c{tours} '(and (fills grape chenin-blanc) )) (cl-define-primitive-concept 'anjou 'loire) ;; Leave off the grape for anjou, because anjou is a strange case ;; where the grape is cabernet-sauvignon and the color is rose. All ;; wines thought of as cabernet-sauvignons are red. ;; Also, just deal with the rose anjous here, not the white ones. ;(cl-add-rule 'anjou-grape ; @c{anjou} '(all grape (one-of chenin-blanc cabernet-sauvignon))) (cl-add-rule 'anjou-color @c{anjou} '(fills color rose)) (cl-add-rule 'anjou-body @c{anjou} '(fills body light)) (cl-add-rule 'anjou-flavor @c{anjou} '(fills flavor delicate)) (cl-add-rule 'anjou-sugar @c{anjou} '(fills sugar off-dry)) ; ALSATIAN (cl-define-concept 'alsatian-wine '(and wine (fills region alsace))) ; AMERICAN (cl-define-concept 'american-wine '(and wine (all region AMERICAN-WINE-REGION))) ; GERMAN (cl-define-concept 'german-wine '(and wine (fills region germany))) ; ITALIAN (cl-define-concept 'italian-wine '(and wine (fills region italy))) (cl-define-primitive-concept 'chianti ' italian-wine) (cl-add-rule 'chianti-color @c{chianti} '(fills color red)) (cl-add-rule 'chianti-grape @c{chianti} '(fills grape sangiovese)) (cl-add-rule 'chianti-body @c{chianti} '(all body (one-of light medium))) (cl-add-rule 'chianti-flavor @c{chianti} '(fills flavor moderate)) (cl-add-rule 'chianti-sugar @c{chianti} '(fills sugar dry)) ; PORTUGUESE (cl-define-primitive-concept 'port '(and red-wine (fills region portugal))) (cl-add-rule 'port-body @c{port} '(fills body full)) (cl-add-rule 'port-flavor @c{port} '(fills flavor strong)) (cl-add-rule 'port-sugar @c{port} '(fills sugar sweet)) ;;;(lload "Helper/just-wines.lisp") ;;(in-package 'USER) ;; THE WINE INSTANCES ; (Sorry, the notational conventions are not observed in this file) (print "load wine instances") (cl-create-ind 'forman-chardonnay '(and chardonnay (fills body full) (fills flavor moderate) (fills sugar dry) (fills maker forman))) (cl-create-ind 'fritz-chardonnay '(and chardonnay (fills body medium) (fills flavor moderate) (fills sugar dry) (fills maker fritz-cellars))) (cl-create-ind 'corton-montrachet-white-burgundy '(and white-burgundy (fills body full) (fills flavor strong) (fills sugar dry) (fills maker corton-montrachet))) (cl-create-ind 'puligny-montrachet-white-burgundy '(and white-burgundy (fills body medium) (fills flavor moderate) (fills sugar dry) (fills maker puligny-montrachet))) (cl-create-ind 'fritz-cellars-sauvignon-blanc '(and sauvignon-blanc (fills body medium) (fills flavor moderate) (fills sugar dry) (fills maker fritz-cellars))) (cl-create-ind 'corbans-sauvignon-blanc '(and sauvignon-blanc (fills body medium) (fills flavor strong) (fills sugar dry) (fills maker corbans))) (cl-create-ind 'handley-sauvignon-blanc '(and sauvignon-blanc (fills body medium) (fills flavor delicate) (fills sugar dry) (fills maker handley))) (cl-create-ind 'kalin-cellars-sauvignon-blanc '(and sauvignon-blanc (fills body full) (fills flavor strong) (fills sugar dry) (fills maker kalin-cellars))) (cl-create-ind 'kalin-cellars-semillon '(and semillon (fills body full) (fills flavor strong) (fills sugar dry) (fills maker kalin-cellars))) (cl-create-ind 'congress-springs-semillon '(and semillon (fills body medium) (fills flavor moderate) (fills sugar dry) (fills maker congress-springs))) (cl-create-ind 'mt-adam-riesling '(and dry-riesling (fills body medium) (fills flavor delicate) (fills sugar dry) (fills maker mt-adam))) (cl-create-ind 'ventana-white-riesling '(and riesling (fills body medium) (fills flavor moderate) (fills sugar off-dry) (fills maker ventana))) (cl-create-ind 'schloss-volrad-trochenbierenauslese-riesling '(and riesling (fills body full) (fills flavor moderate) (fills sugar sweet) (fills maker schloss-volrad))) (cl-create-ind 'schloss-rothermel-trochenbierenauslese-riesling '(and riesling (fills body full) (fills flavor strong) (fills sugar sweet) (fills maker schloss-rothermel))) (cl-create-ind 'ventana-chenin-blanc '(and chenin-blanc (fills body medium) (fills flavor moderate) (fills sugar off-dry)(fills maker ventana))) (cl-create-ind 'congress-springs-late-harvest-semillon '(and late-harvest (fills color white) (fills body medium) (fills flavor moderate) (fills maker congress-springs))) (cl-create-ind 'marietta-cabernet-sauvignon '(and cabernet-sauvignon-wine (fills body medium) (fills flavor moderate) (fills sugar dry) (fills maker marietta))) (cl-create-ind 'b-r-cohn-cabernet-sauvignon '(and cabernet-sauvignon-wine (fills body full) (fills flavor strong) (fills sugar dry) (fills maker b-r-cohn))) (cl-create-ind 'cotturi-zinfandel '(and zinfandel (fills body full) (fills flavor strong) (fills sugar dry) (fills maker cotturi))) (cl-create-ind 'mazocco-zinfandel '(and zinfandel (fills body full) (fills flavor moderate) (fills sugar dry) (fills maker mazocco))) (cl-create-ind 'rosenblum-zinfandel '(and zinfandel (fills body medium) (fills flavor moderate) (fills sugar dry) (fills maker rosenblum))) (cl-create-ind 'sea-ridge-pinot-noir '(and pinot-noir (fills body light) (fills flavor delicate) (fills sugar dry) (fills maker sea-ridge))) (cl-create-ind 'taylor-port '(and port (fills maker taylor))) (cl-create-ind 'chateau-lafite-rothschild-pauillac '(and pauillac (fills maker chateau-lafite-rothschild))) (cl-create-ind 'chateau-margaux '(and margaux (fills maker chateau-margaux-winery))) (cl-create-ind 'chateau-cheval-blanc-st-emilion '(and st-emilion (fills maker chateau-cheval-blanc))) (cl-create-ind 'chateau-morgon-beaujolais '(and beaujolais (fills maker chateau-morgon))) (cl-create-ind 'chateau-d-ychem-sauterne '(and sauterne (fills maker chateau-d-ychem))) (cl-create-ind 'chateau-de-meursault-meursault '(and meursault (fills maker chateau-de-meursault))) (cl-create-ind 'sevre-et-maine-muscadet '(and muscadet (fills maker sevre-et-maine))) (cl-create-ind 'clos-de-la-poussie-sancerre '(and sancerre (fills maker clos-de-la-poussie))) (cl-create-ind 'rose-d-anjou '(and anjou (fills maker d-anjou))) (cl-create-ind 'chianti-classico '(and chianti (fills maker mcguinnesso))) ;;;;;;;;;;;food-wines.lisp ;;Feb 10 14:13 1994 food-wines.lisp Page 1 (sent feb 16) ;(in-package 'USER) ; FRUITS-wines (cl-add-rule 'fruit-wine-color @c{fruit} '(all appropriate-drink (fills color white))) (cl-add-rule 'fruit-wine-body @c{fruit} '(all appropriate-drink (fills body medium))) (cl-add-rule 'sweet-fruit-wine-flavor @c{sweet-fruit} '(all appropriate-drink (fills flavor moderate))) (cl-add-rule 'sweet-fruit-wine-sugar @c{sweet-fruit} '(all appropriate-drink (fills sugar sweet))) (cl-add-rule 'non-sweet-fruit-wine-flavor @c{non-sweet-fruit} '(all appropriate-drink (fills flavor delicate))) (cl-add-rule 'non-sweet-fruit-wine-sugar @c{non-sweet-fruit} '(all appropriate-drink (fills sugar off-dry))) ; DESSERTS (cl-add-rule 'dessert-appropriate-drink-body @c{dessert} '(all appropriate-drink (fills body full))) (cl-add-rule 'dessert-appropriate-drink-flavor @c{dessert} '(all appropriate-drink (fills flavor strong))) (cl-add-rule 'dessert-appropriate-drink-sugar @c{dessert} '(all appropriate-drink (fills sugar sweet))) (cl-add-rule 'cheese/nuts-dessert-appropriate-drink-color @c{cheese/nuts-dessert} '(all appropriate-drink (fills color red))) (cl-add-rule 'sweet-dessert-wine-color @c{sweet-dessert} '(all appropriate-drink (fills color white))) ; SEAFOOD (cl-add-rule 'seafood-wine-color @c{seafood} '(all appropriate-drink (fills color white))) (cl-add-rule 'shellfish-wine-body @c{shellfish} '(all appropriate-drink (fills body full))) ;Feb 10 14:13 1994 food-wines.lisp Page 2 (cl-add-rule 'shellfish-wine-flavor @c{shellfish} '(all appropriate-drink (all flavor (one-of moderate strong)))) (cl-add-rule 'oyster-shellfish-wine-sugar @c{oyster-shellfish} '(all appropriate-drink (fills sugar sweet))) (cl-add-rule 'non-oyster-shellfish-wine-sugar @c{non-oyster-shellfish} '(all appropriate-drink (fills sugar dry))) (cl-add-rule 'fish-wine-body @c{fish} '(all appropriate-drink (fills body medium))) (cl-add-rule 'fish-wine-sugar @c{fish} '(all appropriate-drink (fills sugar dry))) (cl-add-rule 'bland-fish-wine-flavor @c{bland-fish} '(all appropriate-drink (fills flavor delicate))) (cl-add-rule 'non-bland-fish-wine-flavor @c{non-bland-fish} '(all appropriate-drink (fills flavor moderate))) ; MEAT (cl-add-rule 'meat-wine-sugar @c{meat} '(all appropriate-drink (fills sugar dry))) (cl-add-rule 'red-meat-wine-color @c{red-meat} '(all appropriate-drink (fills color red))) ;(cl-add-rule 'non-spicy-red-meat-wine-color @c{non-spicy-red-meat} ; '(all appropriate-drink (fills color red))) (cl-add-rule 'non-spicy-red-meat-wine-body @c{non-spicy-red-meat} '(all appropriate-drink (fills body medium))) (cl-add-rule 'non-spicy-red-meat-wine-flavor @c{non-spicy-red-meat} '(all appropriate-drink (all flavor (one-of strong moderate)))) ;(cl-add-rule 'non-spicy-red-meat-wine-sugar @c{non-spicy-red-meat} ; '(all appropriate-drink (fills sugar dry))) ;Feb 10 14:13 1994 food-wines.lisp Page 3 ;(cl-add-rule 'spicy-red-meat-wine-color @c{spicy-red-meat} ; '(all appropriate-drink (fills color red))) (cl-add-rule 'spicy-red-meat-wine-body @c{spicy-red-meat} '(all appropriate-drink (fills body full))) (cl-add-rule 'spicy-red-meat-wine-flavor @c{spicy-red-meat} '(all appropriate-drink (fills flavor moderate))) ;(cl-add-rule 'spicy-red-meat-wine-sugar @c{spicy-red-meat} ; '(all appropriate-drink (fills sugar dry))) (cl-add-rule 'non-red-meat-wine-color @c{non-red-meat} '(all appropriate-drink (fills color white))) (cl-add-rule 'non-red-meat-wine-body @c{non-red-meat} '(all appropriate-drink (fills body medium))) (cl-add-rule 'non-red-meat-wine-flavor @c{non-red-meat} '(all appropriate-drink (fills flavor strong))) ;(cl-add-rule 'non-red-meat-wine-sugar @c{non-red-meat} ; '(all appropriate-drink (fills sugar dry))) (cl-add-rule 'fowl-wine-sugar @c{fowl} '(all appropriate-drink (fills sugar dry))) (cl-add-rule 'light-meat-fowl-wine-color @c{light-meat-fowl} '(all appropriate-drink (fills color white))) (cl-add-rule 'light-meat-fowl-wine-body @c{light-meat-fowl} '(all appropriate-drink (fills body medium))) (cl-add-rule 'light-meat-fowl-wine-flavor @c{light-meat-fowl} '(all appropriate-drink (fills flavor moderate))) ;(cl-add-rule 'light-meat-fowl-wine-sugar @c{light-meat-fowl} ; '(all appropriate-drink (fills sugar dry))) ;; Classic does not have defaults. This rule forces you to appropriate-drink ;; red wine with a dark meat fowl course - it doesn't give you ;; the choice of appropriate-drinking white, medium, moderate, dry wine instead. (cl-add-rule 'dark-meat-fowl-wine-color @c{dark-meat-fowl} '(all appropriate-drink (fills color red))) (cl-add-rule 'dark-meat-fowl-wine-body @c{dark-meat-fowl} '(all appropriate-drink (fills body light))) (cl-add-rule 'dark-meat-fowl-wine-flavor @c{dark-meat-fowl} '(all appropriate-drink (fills flavor delicate))) ;(cl-add-rule 'dark-meat-fowl-wine-sugar @c{dark-meat-fowl} ; '(all appropriate-drink (fills sugar dry))) (cl-add-rule 'pasta-with-red-sauce-wine-color @c{pasta-with-red-sauce} '(all appropriate-drink (fills color red))) ;(cl-add-rule 'pasta-with-spicy-red-sauce-wine-color ; @c{pasta-with-spicy-red-sauce} ; '(all appropriate-drink (fills color red))) (cl-add-rule 'pasta-with-spicy-red-sauce-wine-body @c{pasta-with-spicy-red-sauce} '(all appropriate-drink (fills body full))) (cl-add-rule 'pasta-with-spicy-red-sauce-wine-flavor @c{pasta-with-spicy-red-sauce} '(all appropriate-drink (fills flavor strong))) (cl-add-rule 'pasta-with-spicy-red-sauce-wine-sugar @c{pasta-with-spicy-red-sauce} '(all appropriate-drink (fills sugar dry))) ;(cl-add-rule 'pasta-with-non-spicy-red-sauce-wine-color ; @c{pasta-with-non-spicy-red-sauce} ; '(all appropriate-drink (fills color red))) (cl-add-rule 'pasta-with-non-spicy-red-sauce-wine-body @c{pasta-with-non-spicy-red-sauce} '(all appropriate-drink (fills body medium))) (cl-add-rule 'pasta-with-non-spicy-red-sauce-wine-flavor @c{pasta-with-non-spicy-red-sauce} '(all appropriate-drink (fills flavor moderate))) (cl-add-rule 'pasta-with-non-spicy-red-sauce-wine-sugar @c{pasta-with-non-spicy-red-sauce} '(all appropriate-drink (fills sugar dry))) (cl-add-rule 'pasta-with-white-sauce-wine-color @c{pasta-with-white-sauce} '(all appropriate-drink (fills color white))) ;(cl-add-rule 'pasta-with-heavy-cream-wine-color ; @c{pasta-with-heavy-cream-sauce} ; '(all appropriate-drink (fills color white))) (cl-add-rule 'pasta-with-heavy-cream-wine-body @c{pasta-with-heavy-cream-sauce} '(all appropriate-drink (fills body medium))) (cl-add-rule 'pasta-with-heavy-cream-wine-flavor @c{pasta-with-heavy-cream-sauce} '(all appropriate-drink (fills flavor moderate))) (cl-add-rule 'pasta-with-heavy-cream-wine-sugar @c{pasta-with-heavy-cream-sauce} '(all appropriate-drink (fills sugar dry))) ;(cl-add-rule 'pasta-with-light-cream-wine-color ; @c{pasta-with-light-cream-sauce} ; '(all appropriate-drink (fills color white))) (cl-add-rule 'pasta-with-light-cream-wine-body @c{pasta-with-light-cream-sauce} '(all appropriate-drink (fills body light))) (cl-add-rule 'pasta-with-light-cream-wine-flavor @c{pasta-with-light-cream-sauce} '(all appropriate-drink (fills flavor delicate))) (cl-add-rule 'pasta-with-light-cream-wine-sugar @c{pasta-with-light-cream-sauce} '(all appropriate-drink (fills sugar dry))) ;;(loop for i in (cl-concept-instances @meal-food) do ;; (cl-ind-add i `(fills appropriate-drink ,(gensym))))