亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? wine.clp

?? 一個有關專家系統的CLISP 源代碼
?? CLP
字號:

;;;======================================================
;;;   Wine Expert Sample Problem
;;;
;;;     WINEX: The WINe EXpert system.
;;;     This example selects an appropriate wine
;;;     to drink with a meal.
;;;
;;;     CLIPS Version 6.0 Example
;;;
;;;     To execute, merely load, reset and run.
;;;======================================================

(defmodule MAIN (export ?ALL))

;;****************
;;* DEFFUNCTIONS *
;;****************

(deffunction MAIN::ask-question (?question ?allowed-values)
   (printout t ?question)
   (bind ?answer (read))
   (if (lexemep ?answer) then (bind ?answer (lowcase ?answer)))
   (while (not (member ?answer ?allowed-values)) do
      (printout t ?question)
      (bind ?answer (read))
      (if (lexemep ?answer) then (bind ?answer (lowcase ?answer))))
   ?answer)

;;*****************
;;* INITIAL STATE *
;;*****************

(deftemplate MAIN::attribute
   (slot name)
   (slot value)
   (slot certainty (default 100.0)))

(defrule MAIN::start
  (declare (salience 10000))
  =>
  (set-fact-duplication TRUE)
  (focus QUESTIONS CHOOSE-QUALITIES WINES PRINT-RESULTS))

(defrule MAIN::combine-certainties ""
  (declare (salience 100)
           (auto-focus TRUE))
  ?rem1 <- (attribute (name ?rel) (value ?val) (certainty ?per1))
  ?rem2 <- (attribute (name ?rel) (value ?val) (certainty ?per2))
  (test (neq ?rem1 ?rem2))
  =>
  (retract ?rem1)
  (modify ?rem2 (certainty (/ (- (* 100 (+ ?per1 ?per2)) (* ?per1 ?per2)) 100))))
  
;;******************
;;* QUESTION RULES *
;;******************

(defmodule QUESTIONS (import MAIN ?ALL) (export ?ALL))

(deftemplate QUESTIONS::question
   (slot attribute (default ?NONE))
   (slot the-question (default ?NONE))
   (multislot valid-answers (default ?NONE))
   (slot already-asked (default FALSE))
   (multislot precursors (default ?DERIVE)))
   
(defrule QUESTIONS::ask-a-question
   ?f <- (question (already-asked FALSE)
                   (precursors)
                   (the-question ?the-question)
                   (attribute ?the-attribute)
                   (valid-answers $?valid-answers))
   =>
   (modify ?f (already-asked TRUE))
   (assert (attribute (name ?the-attribute)
                      (value (ask-question ?the-question ?valid-answers)))))

(defrule QUESTIONS::precursor-is-satisfied
   ?f <- (question (already-asked FALSE)
                   (precursors ?name is ?value $?rest))
         (attribute (name ?name) (value ?value))
   =>
   (if (eq (nth 1 ?rest) and) 
    then (modify ?f (precursors (rest$ ?rest)))
    else (modify ?f (precursors ?rest))))

(defrule QUESTIONS::precursor-is-not-satisfied
   ?f <- (question (already-asked FALSE)
                   (precursors ?name is-not ?value $?rest))
         (attribute (name ?name) (value ~?value))
   =>
   (if (eq (nth 1 ?rest) and) 
    then (modify ?f (precursors (rest$ ?rest)))
    else (modify ?f (precursors ?rest))))

;;*******************
;;* WINEX QUESTIONS *
;;*******************

(defmodule WINE-QUESTIONS (import QUESTIONS ?ALL))

(deffacts WINE-QUESTIONS::question-attributes
  (question (attribute main-component)
            (the-question "Is the main component of the meal meat, fish, or poultry? ")
            (valid-answers meat fish poultry unknown))
  (question (attribute has-turkey)
            (precursors main-component is turkey)
            (the-question "Does the meal have turkey in it? ")
            (valid-answers yes no unknown))
  (question (attribute has-sauce)
            (the-question "Does the meal have a sauce on it? ")
            (valid-answers yes no unknown))
  (question (attribute sauce)
            (precursors has-sauce is yes)
            (the-question "Is the sauce for the meal spicy, sweet, cream, or tomato? ")
            (valid-answers sauce spicy sweet cream tomato unknown))
  (question (attribute tastiness)
            (the-question "Is the flavor of the meal delicate, average, or strong? ")
            (valid-answers delicate average strong unknown))
  (question (attribute preferred-body)
            (the-question "Do you generally prefer light, medium, or full bodied wines? ")
            (valid-answers light medium full unknown))
  (question (attribute preferred-color)
            (the-question "Do you generally prefer red or white wines? ")
            (valid-answers red white unknown))
  (question (attribute preferred-sweetness)
            (the-question "Do you generally prefer dry, medium, or sweet wines? ")
            (valid-answers dry medium sweet unknown))) 
 
;;******************
;; The RULES module
;;******************

(defmodule RULES (import MAIN ?ALL) (export ?ALL))

(deftemplate RULES::rule
  (slot certainty (default 100.0))
  (multislot if)
  (multislot then))

(defrule RULES::throw-away-ands-in-antecedent
  ?f <- (rule (if and $?rest))
  =>
  (modify ?f (if ?rest)))

(defrule RULES::throw-away-ands-in-consequent
  ?f <- (rule (then and $?rest))
  =>
  (modify ?f (then ?rest)))

(defrule RULES::remove-is-condition-when-satisfied
  ?f <- (rule (certainty ?c1) 
              (if ?attribute is ?value $?rest))
  (attribute (name ?attribute) 
             (value ?value) 
             (certainty ?c2))
  =>
  (modify ?f (certainty (min ?c1 ?c2)) (if ?rest)))

(defrule RULES::remove-is-not-condition-when-satisfied
  ?f <- (rule (certainty ?c1) 
              (if ?attribute is-not ?value $?rest))
  (attribute (name ?attribute) (value ~?value) (certainty ?c2))
  =>
  (modify ?f (certainty (min ?c1 ?c2)) (if ?rest)))

(defrule RULES::perform-rule-consequent-with-certainty
  ?f <- (rule (certainty ?c1) 
              (if) 
              (then ?attribute is ?value with certainty ?c2 $?rest))
  =>
  (modify ?f (then ?rest))
  (assert (attribute (name ?attribute) 
                     (value ?value)
                     (certainty (/ (* ?c1 ?c2) 100)))))

(defrule RULES::perform-rule-consequent-without-certainty
  ?f <- (rule (certainty ?c1)
              (if)
              (then ?attribute is ?value $?rest))
  (test (or (eq (length$ ?rest) 0)
            (neq (nth 1 ?rest) with)))
  =>
  (modify ?f (then ?rest))
  (assert (attribute (name ?attribute) (value ?value) (certainty ?c1))))

;;*******************************
;;* CHOOSE WINE QUALITIES RULES *
;;*******************************

(defmodule CHOOSE-QUALITIES (import RULES ?ALL)
                            (import QUESTIONS ?ALL)
                            (import MAIN ?ALL))

(defrule CHOOSE-QUALITIES::startit => (focus RULES))

(deffacts the-wine-rules

  ; Rules for picking the best body

  (rule (if has-sauce is yes and 
            sauce is spicy)
        (then best-body is full))

  (rule (if tastiness is delicate)
        (then best-body is light))

  (rule (if tastiness is average)
        (then best-body is light with certainty 30 and
              best-body is medium with certainty 60 and
              best-body is full with certainty 30))

  (rule (if tastiness is strong)
        (then best-body is medium with certainty 40 and
              best-body is full with certainty 80))

  (rule (if has-sauce is yes and
            sauce is cream)
        (then best-body is medium with certainty 40 and
              best-body is full with certainty 60))

  (rule (if preferred-body is full)
        (then best-body is full with certainty 40))

  (rule (if preferred-body is medium)
        (then best-body is medium with certainty 40))

  (rule (if preferred-body is light) 
        (then best-body is light with certainty 40))

  (rule (if preferred-body is light and
            best-body is full)
        (then best-body is medium))

  (rule (if preferred-body is full and
            best-body is light)
        (then best-body is medium))

  (rule (if preferred-body is unknown) 
        (then best-body is light with certainty 20 and
              best-body is medium with certainty 20 and
              best-body is full with certainty 20))

  ; Rules for picking the best color

  (rule (if main-component is meat)
        (then best-color is red with certainty 90))

  (rule (if main-component is poultry and
            has-turkey is no)
        (then best-color is white with certainty 90 and
              best-color is red with certainty 30))

  (rule (if main-component is poultry and
            has-turkey is yes)
        (then best-color is red with certainty 80 and
              best-color is white with certainty 50))

  (rule (if main-component is fish)
        (then best-color is white))

  (rule (if main-component is-not fish and
            has-sauce is yes and
            sauce is tomato)
        (then best-color is red))

  (rule (if has-sauce is yes and
            sauce is cream)
        (then best-color is white with certainty 40))
                   
  (rule (if preferred-color is red)
        (then best-color is red with certainty 40))

  (rule (if preferred-color is white)
        (then best-color is white with certainty 40))

  (rule (if preferred-color is unknown)
        (then best-color is red with certainty 20 and
              best-color is white with certainty 20))
  
  ; Rules for picking the best sweetness

  (rule (if has-sauce is yes and
            sauce is sweet)
        (then best-sweetness is sweet with certainty 90 and
              best-sweetness is medium with certainty 40))

  (rule (if preferred-sweetness is dry)
        (then best-sweetness is dry with certainty 40))

  (rule (if preferred-sweetness is medium)
        (then best-sweetness is medium with certainty 40))

  (rule (if preferred-sweetness is sweet)
        (then best-sweetness is sweet with certainty 40))

  (rule (if best-sweetness is sweet and
            preferred-sweetness is dry)
        (then best-sweetness is medium))

  (rule (if best-sweetness is dry and
            preferred-sweetness is sweet) 
        (then best-sweetness is medium))

  (rule (if preferred-sweetness is unknown)
        (then best-sweetness is dry with certainty 20 and
              best-sweetness is medium with certainty 20 and
              best-sweetness is sweet with certainty 20))

)

;;************************
;;* WINE SELECTION RULES *
;;************************

(defmodule WINES (import MAIN ?ALL))

(deffacts any-attributes
  (attribute (name best-color) (value any))
  (attribute (name best-body) (value any))
  (attribute (name best-sweetness) (value any)))

(deftemplate WINES::wine
  (slot name (default ?NONE))
  (multislot color (default any))
  (multislot body (default any))
  (multislot sweetness (default any)))

(deffacts WINES::the-wine-list 
  (wine (name Gamay) (color red) (body medium) (sweetness medium sweet))
  (wine (name Chablis) (color white) (body light) (sweetness dry))
  (wine (name Sauvignon-Blanc) (color white) (body medium) (sweetness dry))
  (wine (name Chardonnay) (color white) (body medium full) (sweetness medium dry))
  (wine (name Soave) (color white) (body light) (sweetness medium dry))
  (wine (name Riesling) (color white) (body light medium) (sweetness medium sweet))
  (wine (name Geverztraminer) (color white) (body full))
  (wine (name Chenin-Blanc) (color white) (body light) (sweetness medium sweet))
  (wine (name Valpolicella) (color red) (body light))
  (wine (name Cabernet-Sauvignon) (color red) (sweetness dry medium))
  (wine (name Zinfandel) (color red) (sweetness dry medium))
  (wine (name Pinot-Noir) (color red) (body medium) (sweetness medium))
  (wine (name Burgundy) (color red) (body full))
  (wine (name Zinfandel) (color red) (sweetness dry medium)))
  
(defrule WINES::generate-wines
  (wine (name ?name)
        (color $? ?c $?)
        (body $? ?b $?)
        (sweetness $? ?s $?))
  (attribute (name best-color) (value ?c) (certainty ?certainty-1))
  (attribute (name best-body) (value ?b) (certainty ?certainty-2))
  (attribute (name best-sweetness) (value ?s) (certainty ?certainty-3))
  =>
  (assert (attribute (name wine) (value ?name)
                     (certainty (min ?certainty-1 ?certainty-2 ?certainty-3)))))

;;*****************************
;;* PRINT SELECTED WINE RULES *
;;*****************************

(defmodule PRINT-RESULTS (import MAIN ?ALL))

(defrule PRINT-RESULTS::header ""
   (declare (salience 10))
   =>
   (printout t t)
   (printout t "        SELECTED WINES" t t)
   (printout t " WINE                  CERTAINTY" t)
   (printout t " -------------------------------" t)
   (assert (phase print-wines)))

(defrule PRINT-RESULTS::print-wine ""
  ?rem <- (attribute (name wine) (value ?name) (certainty ?per))		  
  (not (attribute (name wine) (certainty ?per1&:(> ?per1 ?per))))
  =>
  (retract ?rem)
  (format t " %-24s %2d%%%n" ?name ?per))

(defrule PRINT-RESULTS::remove-poor-wine-choices ""
  ?rem <- (attribute (name wine) (certainty ?per&:(< ?per 20)))
  =>
  (retract ?rem))

(defrule PRINT-RESULTS::end-spaces ""
   (not (attribute (name wine)))
   =>
   (printout t t))




?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产麻豆9l精品三级站| 丁香婷婷综合五月| 国产成人午夜高潮毛片| 色欧美日韩亚洲| 精品久久久网站| 亚洲精品国产一区二区精华液 | 国产亚洲精品中文字幕| 亚洲黄色小视频| 国产精品996| 制服丝袜亚洲网站| 亚洲另类色综合网站| 国产一区二区女| 欧美激情综合在线| 日韩av中文字幕一区二区三区| caoporn国产精品| 精品久久久久香蕉网| 日韩精品视频网| 欧美羞羞免费网站| 中文字幕中文字幕在线一区| 国产精品一区免费视频| 日韩欧美一区电影| 亚洲国产人成综合网站| 色综合一个色综合| 中文字幕一区二区三区av| 国产精品综合一区二区三区| 日韩午夜精品视频| 天天综合网天天综合色| 欧美日韩卡一卡二| 亚洲一级在线观看| 欧美亚一区二区| 亚洲一二三四在线观看| 在线一区二区三区四区五区| 亚洲精品少妇30p| 波多野结衣中文字幕一区二区三区 | 亚洲午夜久久久久久久久久久| 99精品桃花视频在线观看| 久久综合久久99| 精品一区二区免费在线观看| 久久综合九色综合97婷婷| 精彩视频一区二区| 久久中文娱乐网| 国产成人免费高清| 国产精品久久99| 色综合久久久久综合体| 亚洲影视在线观看| 日韩一区二区在线观看| 理论电影国产精品| 国产欧美一区二区精品秋霞影院| 国产成人久久精品77777最新版本| 国产精品少妇自拍| 91老师片黄在线观看| 亚洲18女电影在线观看| 91精品国产手机| 国产一区二区女| ...中文天堂在线一区| 色先锋aa成人| 麻豆成人久久精品二区三区红 | 国产欧美精品一区| 不卡在线观看av| 亚洲午夜精品网| 精品国产一区二区国模嫣然| 成人网男人的天堂| 一区二区三区精品| 日韩一区二区免费视频| 国产精品一二三在| 亚洲一二三四久久| 久久品道一品道久久精品| 色婷婷久久久久swag精品| 偷偷要91色婷婷| 欧美国产一区二区| 欧美区一区二区三区| 国产精品一区二区黑丝| 一区二区三区蜜桃网| 日韩亚洲电影在线| 不卡一二三区首页| 偷拍一区二区三区四区| 中文在线一区二区| 欧美一区欧美二区| 一本到不卡精品视频在线观看| 日本不卡一二三区黄网| 亚洲日本中文字幕区| 精品福利一区二区三区免费视频| 色天天综合久久久久综合片| 六月丁香婷婷久久| 亚洲国产成人av好男人在线观看| www久久久久| 欧美精品久久99| 99综合电影在线视频| 久久国产综合精品| 亚洲丶国产丶欧美一区二区三区| 国产拍揄自揄精品视频麻豆| 69堂国产成人免费视频| 91极品视觉盛宴| 国v精品久久久网| 久久精品99久久久| 午夜在线成人av| 亚洲欧美日韩一区| 国产精品天干天干在观线| 欧美成人一区二区三区片免费| 欧美色爱综合网| 色综合久久久久综合体桃花网| 国产成人精品影视| 国产一区二区三区综合| bt欧美亚洲午夜电影天堂| 国产九九视频一区二区三区| 免费视频最近日韩| 亚洲国产精品久久人人爱 | 91蜜桃网址入口| 成人网在线免费视频| 从欧美一区二区三区| 国产91色综合久久免费分享| 国产主播一区二区| 国精产品一区一区三区mba视频| 日本免费在线视频不卡一不卡二 | 欧美日韩午夜精品| 在线视频国产一区| 在线一区二区三区四区五区| 91免费国产视频网站| 91在线国产福利| 91丨porny丨国产| 欧美综合色免费| 在线看日韩精品电影| 欧美在线看片a免费观看| 欧洲日韩一区二区三区| 欧美视频第二页| 欧美人与禽zozo性伦| 555www色欧美视频| 日韩欧美高清一区| 欧美精品一区二区三区在线| 久久久久亚洲蜜桃| 中文字幕精品一区| 亚洲一区二区三区在线看| 亚洲一二三区在线观看| 亚洲高清不卡在线观看| 日韩av一二三| 麻豆成人久久精品二区三区小说| 国产精品自拍三区| av男人天堂一区| 精品污污网站免费看| 在线播放一区二区三区| 久久夜色精品国产噜噜av| 国产日产精品一区| 樱桃视频在线观看一区| 男男视频亚洲欧美| 国产成+人+日韩+欧美+亚洲| 91玉足脚交白嫩脚丫在线播放| 欧美色精品在线视频| 欧美一区二区视频在线观看2020| 久久精品在这里| 国产精品不卡在线观看| 日韩国产精品91| 成人视屏免费看| 欧美美女直播网站| 日本一区二区三区在线观看| 亚洲精品久久嫩草网站秘色| 麻豆国产精品官网| 色婷婷综合久久久久中文一区二区| 欧美日韩综合色| 国产三区在线成人av| 亚洲高清免费观看高清完整版在线观看| 美女精品自拍一二三四| 91色|porny| 精品福利二区三区| 亚洲一卡二卡三卡四卡| 韩国女主播成人在线观看| 欧美主播一区二区三区| 久久蜜桃av一区精品变态类天堂| 亚洲精品免费播放| 国产福利一区二区三区| 欧美人伦禁忌dvd放荡欲情| 国产精品美女久久久久久久久久久 | 久久一区二区三区国产精品| 一区二区三区欧美| 成人毛片在线观看| 91精品国产综合久久精品图片 | 在线看国产一区二区| 久久久国产精华| 日本欧美在线看| 欧美日韩综合不卡| 一区二区三区加勒比av| 99视频在线观看一区三区| 久久久亚洲国产美女国产盗摄 | 亚洲综合色婷婷| 福利电影一区二区| 精品国产乱码91久久久久久网站| 亚洲一区在线视频观看| kk眼镜猥琐国模调教系列一区二区| 精品91自产拍在线观看一区| 丝袜国产日韩另类美女| 欧洲av一区二区嗯嗯嗯啊| 亚洲图片另类小说| 99热精品国产| 中文成人av在线| 国产suv精品一区二区6| 国产日韩影视精品| 国产精品一二二区| 国产精品午夜久久| www.视频一区| 亚洲欧洲成人精品av97| 91猫先生在线|