;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;; Inference Rules (For importance, higher values go first.) ;;;;;; Domain: American Food!Specific! ! ! ! ! ! ! ;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;! ;;; Meal Type(defrule full-meal-american (:backward :certainty 1.0 :importance 91) if [and ! [food-ethnicity ?user american] ! ! ! [or [meal ?user lunch] ! ! ! ! [meal ?user dinner]]] then [full-meal-american ?user yes]) (defrule dessert-meal-american (:backward :certainty 1.0 :importance 91) if [and ! [food-ethnicity ?user american] ! ! ! [meal ?user dessert]] then! [dessert-meal-american ?user yes]) ! ! !(defrule full-meal-american-exclusion (:forward :certainty 1.0 :importance 90)! if [full-meal-american ?user yes] then [and [dessert-meal-american ?user no] ! ! ! [having-dessert ?user no]]) ! ! !(defrule dessert-meal-american-exclusion (:backward :certainty 1.0 :importance 91) if [and ! [food-ethnicity ?user american] ! ! ! [meal ?user dessert]] then [full-meal-american ?user no]) ! ;;; Figure out meat ! ! ! ! ;;; General selection (defrule meat-type-healthy-american (:backward :certainty 1.0 :importance 96) if [and ! [food-ethnicity ?user american] ! ! ! [full-meal-american ?user yes] ! ! ! [health-conscious ?user yes]] then [meat-american-round1 ?user poultry/seafood])(defrule meat-type-not-healthy-american (:backward :certainty 1.0 :importance 95) if [and ! [food-ethnicity ?user american] ! ! ! [full-meal-american ?user yes] ! ! ! [health-conscious ?user no]] then [meat-american-round1 ?user pork/beef]) ! ! ;;; final selection (defrule bbq-american (:backward :certainty 1.0 :importance 94) if [and [food-ethnicity ?user american] !! [full-meal-american ?user yes] !! [meat-american-round1 ?user pork/beef] ! ! [is-south ?user yes] ! ! [is-summer ?user yes] ! ! [use-bbq-sauce ?user yes]]! ! then![final-meat ?user BBQ])! (defrule beef-american (:backward :certainty 1.0 :importance 93) if [and ![food-ethnicity ?user american] !! ! [full-meal-american ?user yes]!! ! [meat-american-round1 ?user pork/beef] ! ! ! ! ! ! [is-midwest ?user yes]] then [beef ?user yes]) (defrule beef-american-no (:backward :certainty 1.0 :importance 93) if [and ![food-ethnicity ?user american] !! ! [full-meal-american ?user yes] !! ! [meat-american-round1 ?user pork/beef] ! ! ! ! ! ! [is-midwest ?user no]] then [beef ?user no]) (defrule beef-american-no-2 (:backward :certainty 1.0 :importance 93) if [and ![food-ethnicity ?user american] !! ! [full-meal-american ?user yes] !! ! [meat-american-round1 ?user poultry/seafood]] then [beef ?user no]) (defrule seafood-american (:backward :certainty 1.0 :importance 92) if [and ![food-ethnicity ?user american] !! ! [full-meal-american ?user yes] !! ! [meat-american-round1 ?user poultry/seafood] ! ! ![is-near-coast ?user yes]] then [seafood ?user yes]) (defrule seafood-american-no (:backward :certainty 1.0 :importance 92) if [and ![food-ethnicity ?user american] !! ! [full-meal-american ?user yes] !! ! [meat-american-round1 ?user poultry/seafood] ! ! ![is-near-coast ?user no]] then [seafood ?user no]) (defrule seafood-american-no2 (:backward :certainty 1.0 :importance 92) if [and ![food-ethnicity ?user american] !! ! [full-meal-american ?user yes] !! ! [meat-american-round1 ?user pork/beef]] then [seafood ?user no]) (defrule poultry-american (:backward :certainty 1.0 :importance 91) if [and ![food-ethnicity ?user american] !! ! [full-meal-american ?user yes] !! ! [meat-american-round1 ?user poultry/seafood] ! ! ![is-near-coast ?user no]] then [poultry ?user yes]) (defrule poultry-american-no (:backward :certainty 1.0 :importance 91) if [and ![food-ethnicity ?user american] !! ! [full-meal-american ?user yes] !! ! [meat-american-round1 ?user poultry/seafood] ! ! ![is-near-coast ?user yes]] then [poultry ?user no]) (defrule poultry-american-no2 (:backward :certainty 1.0 :importance 91) if [and ![food-ethnicity ?user american] !! ! [full-meal-american ?user yes] !! ! [meat-american-round1 ?user pork/beef]] then [poultry ?user no]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;; Inference Rules (For importance, higher values go first.) ;;;;;; Domain: Caribbean Food Specific! ! ! ! ! ! ! ;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;! ;;; Meal Type(defrule full-meal-caribbean (:backward :certainty 1.0 :importance 91) if [and ! [food-ethnicity ?user caribbean] ! ! ! [or [meal ?user lunch] ! ! ! ! [meal ?user dinner]]] then [full-meal-caribbean ?user yes])(defrule dessert-meal-caribbean (:backward :certainty 1.0 :importance 91) if [and ! [food-ethnicity ?user caribbean] ! ! ! [meal ?user dessert]] then! [dessert-meal-caribbean ?user yes])(defrule full-meal-caribbean-exclusion (:forward :certainty 1.0 :importance 90)! if [full-meal-caribbean ?user yes] then [and [dessert-meal-caribbean ?user no] ! ! ! [having-dessert ?user no]]) ! ! !(defrule dessert-meal-caribbean-exclusion (:backward :certainty 1.0 :importance 91) if [and ! [food-ethnicity ?user caribbean] ! ! ! [meal ?user dessert]] then [full-meal-caribbean ?user no]) ! ;;; Figure out meat!! ! ;;; General selection(defrule meat-type-healthy-caribbean (:backward :certainty 1.0 :importance 10) if [and ! [food-ethnicity ?user caribbean] ! ! ! [full-meal-caribbean ?user yes] ! ! ! [health-conscious ?user yes]] then [meat-caribbean-round1 ?user poultry/seafood])(defrule meat-type-not-healthy-caribbean (:backward :certainty 1.0 :importance 10) if [and ! [food-ethnicity ?user caribbean] ! ! ! [full-meal-caribbean ?user yes] ! ! ! [health-conscious ?user no]] then [meat-caribbean-round1 ?user pork/beef]) ! ! ;;; final selection (defrule pork-caribbean (:backward :certainty 1.0 :importance 10) if [and ![food-ethnicity ?user caribbean] !! ! [meat-caribbean-round1 ?user pork/beef] ! ! ![is-expensive ?user yes]] then [pork ?user yes]) (defrule pork-caribbean-no (:backward :certainty 1.0 :importance 10) if [and ![food-ethnicity ?user caribbean] !! ! [meat-caribbean-round1 ?user pork/beef] ! ! ![is-expensive ?user no]] then [pork ?user
View Full Document