⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 acqclips.clp

📁 NASA 开发使用的一个专家系统
💻 CLP
📖 第 1 页 / 共 4 页
字号:
  (ae8 ?ae8)  (envvalue allenvvalue)  =>(bind ?totalenv (+ ?ae1 ?ae2 ?ae3 ?ae4 ?ae5 ?ae6 ?ae7 ?ae8))    (if (and (>= ?totalenv 25) (<= ?totalenv 27))     then (assert (sume e)))    (if (and (>= ?totalenv 20) (<= ?totalenv 24))     then (assert (sume g)))    (if (and (>= ?totalenv 12) (<= ?totalenv 19))     then (assert (sume f)))    (if (and (>= ?totalenv 0) (<= ?totalenv 11))     then (assert (sume p)))    (assert (envtotal ?totalenv))    (assert (envvalue preenvreport)))(defrule preenvreport   (envvalue preenvreport)   (sume ?sume)   =>      (if (eq ?sume e)     then (assert (sumenv excellent)))    (if (eq ?sume g)     then (assert (sumenv good)))    (if (eq ?sume f)     then (assert (sumenv fair)))    (if (eq ?sume p)     then (assert (sumenv poor)))    (assert (report envreport)))(defrule envreport    (report envreport)    (sumenv ?sumenv)    (sume ?sume)    (envtotal ?totalenv)    =>     (printout t "Based on your input to environmental factors questions,"crlf)    (printout t "the overall environmental factors score for acquisition"crlf)    (printout t "purpose is evaluated to be " ?sumenv "."crlf)    (printout t "The actual score of environmental questions is "crlf)    (printout t ?totalenv ".  " crlf)    (printout t "The environmental factors score is evaluated as follows:"crlf)    (printout t "excellent 27-25"crlf)    (printout t "good 24-20"crlf)    (printout t "fair 19-12"crlf)    (printout t "poor 11-0."crlf)    (printout t "Would you like to see a detailed report of your response"crlf)    (printout t "to 8 environmental factors questions?"crlf)    (printout t "yes or no? Please enter yes or no."crlf)    (bind ?answer (read))    (if (eq ?answer yes)     then (assert (report envresponse1)))    (if (eq ?answer no)     then (printout t "THE FOLLOWING IS AN OVERALL MANAGERIAL FACTORS EVALUATION."crlf)          (assert (phase management-value))))(defrule envreponse1   (report envresponse1)   (ae1 ?ae1)   (ae2 ?ae2)   (ae3 ?ae3)   (ae4 ?ae4)   (ae5 ?ae5)   (ae6 ?ae6)   (ae7 ?ae7)   (ae8 ?ae8)   =>    (printout t "Your responses to environmental factor questions"crlf)   (printout t "are as follows.  The response is shown exactly as you"crlf)   (printout t "entered along with possible answer choices."crlf)   (printout t " product life cycle? " ?ae1  " among  0 1 2 3."crlf)   (printout t " competition? " ?ae2 " among 0 1 2 3."crlf)   (printout t " labor market? " ?ae3 " among 0 1 2 3 4."crlf)   (printout t " acquisition occurred? " ?ae4 " among 0 1 3."crlf)   (printout t " technology disturbance? " ?ae5 " among 0 1 2 3."crlf)   (printout t " regulatory change? " ?ae6 " among 0 1 2 3."crlf)   (printout t " line of business synergy? " ?ae7 " among 0 1 4."crlf)   (printout t " economies of scale? " ?ae8 " among 0 1 4."crlf)   (printout t "THE FOLLOWING IS AN OVERALL MANAGERIAL FACTORS EVALUATION."crlf)   (assert (phase management-value)));; This phase contains managerial evaluation of the user's;; input for acquisition consideration.  It returns one overall;; evaluation of managerial input and offers an explanation;; for the evaluation.  The possible values for the evaluation;; are excellent, good, fair, or poor.  Each of the 3 groups of;; user input will be assessed by the expert system and will be;; given one of the four values.  Based on the 64 combination ;; of evaluation values (4 values for each group and 3 groups =;; 4x4x4=64), a final overall evaluation will be presented by;; the expert system as explained earlier using 10 point scale.(defrule phase-5 ?phase <- (phase management-value)  => (retract ?phase) (printout t "This phase contains managerial evaluation of the user's "crlf) (printout t "input for acquisition consideration.  It returns one overall "crlf) (printout t "evaluation of managerial input and offers an explanation "crlf) (printout t "for the evaluation.  The possible values for the evaluation "crlf) (printout t "are excellent, good, fair, or poor.  Each of the 3 groups of"crlf) (printout t "user input will be assessed by the expert system and will be"crlf) (printout t "given one of the four values.  Based on the 64 combination"crlf)  (printout t "of evaluation values (4 values for each group and 3 groups = "crlf) (printout t "4x4x4=64), a final overall evaluation will be presented by"crlf) (printout t "the expert system as explained earlier using 10 point scale."crlf) (assert (manvalue allmanvalue)));; The following rule stores the user's response to be used in ;; printing and explaining the expert system's evaluation, and;; the next rule adds the user's response values;; to give the overall managerial evaluation value as ;; excellent, good, fair, or poor. (defrule  allmanvalue  (am1 ?am1)  (am2 ?am2)  (am3 ?am3)  (am4 ?am4)  (am5 ?am5)  (am6 ?am6)  (am7 ?am7)  (am8 ?am8)  (am9 ?am9)  (am10 ?am10)  (am11 ?am11)  (am12 ?am12)   (manvalue allmanvalue)  =>(bind ?totalman (+ ?am1 ?am2 ?am3 ?am4 ?am5                       ?am6 ?am7 ?am8 ?am9 ?am10 ?am11 ?am12))    (if (and (>= ?totalman 35) (<= ?totalman 39))     then (assert (summ e)))    (if (and (>= ?totalman 28) (<= ?totalman 34))     then (assert (summ g)))    (if (and (>= ?totalman 15) (<= ?totalman 27))     then (assert (summ f)))    (if (and (>= ?totalman 0) (<= ?totalman 14))     then (assert (summ p)))    (assert (mantotal ?totalman))    (assert (manvalue premanreport)))(defrule premanreport   (manvalue premanreport)   (summ ?summ)   =>      (if (eq ?summ e)     then (assert (summan excellent)))    (if (eq ?summ g)     then (assert (summan good)))    (if (eq ?summ f)     then (assert (summan fair)))    (if (eq ?summ p)     then (assert (summan poor)))    (assert (report manreport)))(defrule manreport    (report manreport)    (summan ?summan)    (summ ?summ)    (mantotal ?totalman)    =>     (printout t "Based on your input to managerial factors questions,"crlf)    (printout t "the overall managerial factors score for acquisition"crlf)    (printout t "purpose is evaluated to be " ?summan  "." crlf)    (printout t "The actual score of managerial questions is "crlf)    (printout t ?totalman ".  " crlf)    (printout t "The managerial factors score is evaluated as follows:"crlf)    (printout t "excellent 39-35"crlf)    (printout t "good 34-28"crlf)    (printout t "fair 27-15"crlf)    (printout t "poor 14-0."crlf)    (printout t "Would you like to see a detailed report of your response"crlf)    (printout t "to 12 managerial factors questions?"crlf)    (printout t "yes or no? Please enter yes or no."crlf)    (bind ?answer (read))    (if (eq ?answer yes)     then (assert (report manresponse1)))    (if (eq ?answer no)     then (printout t "THE FOLLOWING IS AN OVERALL FINANCIAL FACTORS EVALUATION."crlf)          (assert (phase finance-value))))(defrule manreponse1   (report manresponse1)   (am1 ?am1)   (am2 ?am2)   (am3 ?am3)   (am4 ?am4)   (am5 ?am5)   (am6 ?am6)   (am7 ?am7)   (am8 ?am8)   (am9 ?am9)   (am10 ?am10)   (am11 ?am11)   (am12 ?am12)    =>    (printout t "Your responses to managerial factor questions"crlf)   (printout t "are as follows.  The response is shown exactly as you"crlf)   (printout t "entered along with possible answer choices."crlf)   (printout t " corporate cultures synergy? " ?am1  " among  0 1 2 3."crlf)   (printout t " CEO involuntary succession? " ?am2 " among 0 1 4."crlf)   (printout t " audited opinion? " ?am3 " among 0 1 2 3."crlf)   (printout t " internal control? " ?am4 " among 0 1 2 3."crlf)   (printout t " lawsuit? " ?am5 " among 0 1 2 3."crlf)   (printout t " accounting choice? " ?am6 " among 0 1 4."crlf)   (printout t " nonfinancial negative publicity? " ?am7 " among 0 1 3."crlf)   (printout t " budgeting policy? " ?am8 " among 0 1 2 3."crlf)   (printout t " strategic planning? " ?am9 " among 0 1 2 3."crlf)   (printout t " tax planning? " ?am10 " among 0 1 2 3."crlf)   (printout t " growth-expansion match? " ?am11 " among 0 1 4."crlf)   (printout t " management attitude? " ?am12 " among 0 1 2 3."crlf)   (printout t "THE FOLLOWING IS AN OVERALL FINANCIAL FACTORS EVALUATION."crlf)   (assert (phase finance-value)));; This phase contains financial evaluation of the user's;; input for acquisition consideration.  It returns one overall;; evaluation of financial input and offers an explanation;; for the evaluation.  The possible values for the evaluation;; are excellent, good, fair, or poor.  Each of the 3 groups of;; user input will be assessed by the expert system and will be;; given one of the four values.  Based on the 64 combination ;; of evaluation values (4 values for each group and 3 groups =;; 4x4x4=64), a final overall evaluation will be presented by;; the expert system as explained earlier using 10 point scale.(defrule phase-6 ?phase <- (phase finance-value)  => (retract ?phase) (printout t "This phase contains financial evaluation of the user's "crlf) (printout t "input for acquisition consideration.  It returns one overall "crlf) (printout t "evaluation of financial input and offers an explanation "crlf) (printout t "for the evaluation.  The possible values for the evaluation "crlf) (printout t "are excellent, good, fair, or poor.  Each of the 3 groups of"crlf) (printout t "user input will be assessed by the expert system and will be"crlf) (printout t "given one of the four values.  Based on the 64 combination"crlf)  (printout t "of evaluation values (4 values for each group and 3 groups = "crlf) (printout t "4x4x4=64), a final overall evaluation will be presented by"crlf) (printout t "the expert system as explained earlier using 10 point scale."crlf) (assert (finvalue allfinvalue)));; The following rule stores the user's response to be used in ;; printing and explaining the expert system's evaluation, and;; the next rule adds the user's response values;; to give the overall managerial evaluation value as ;; excellent, good, fair, or poor. (defrule  allfinvalue  (af1 ?af1)  (af2 ?af2)  (af3 ?af3)  (af4 ?af4)  (af5 ?af5)  (af6 ?af6)  (af7 ?af7)  (af8 ?af8)  (af9 ?af9)  (af11 ?af11)  (af13 ?af13)  (af15 ?af15)  (af17 ?af17)   (finvalue allfinvalue)  =>(bind ?totalfin (+ ?af1 ?af2 ?af3 ?af4 ?af5 ?af6 ?af7 ?af8                       ?af9 ?af11 ?af13 ?af15 ?af17))    (if (and (>= ?totalfin 50) (<= ?totalfin 55))     then (assert (sumf e)))    (if (and (>= ?totalfin 35) (<= ?totalfin 49))     then (assert (sumf g)))    (if (and (>= ?totalfin 19) (<= ?totalfin 34))     then (assert (sumf f)))    (if (and (>= ?totalfin 0) (<= ?totalfin 18))     then (assert (sumf p)))    (assert (fintotal ?totalfin))    (assert (finvalue prefinreport)))(defrule prefinreport   (finvalue prefinreport)   (sumf ?sumf)   =>      (if (eq ?sumf e)     then (assert (sumfin excellent)))    (if (eq ?sumf g)     then (assert (sumfin good)))    (if (eq ?sumf f)     then (assert (sumfin fair)))    (if (eq ?sumf p)     then (assert (sumfin poor)))    (assert (report finreport)))(defrule finreport    (report finreport)    (sumfin ?sumfin)    (sumf ?sumf)    (fintotal ?totalfin)    =>     (printout t "Based on your input to financial factors questions,"crlf)    (printout t "the overall financial factors score for acquisition"crlf)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -