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

📄 rx7.clp

📁 一个有关专家系统的CLISP 源代码
💻 CLP
📖 第 1 页 / 共 4 页
字号:
  "                  0.) Return to previous menu." crlf
  "                  1.) Deformation or abnormal wear of side housing." crlf
  "                  2.) Malfunction of rotor (blowholes)." crlf
  "                  3.) Scratched or burred rotor land." crlf
  "                  4.) Malfunction of oil seal (incorrect angle)." crlf
  "        Choice: ")
    (bind ?response (read))
    (assert (possible-cause ?problem ?response))
    (printout t crlf))
;;
;;*******************************************************
;; This is the sub menu for leakage into coolant        *
;; passages under problem of excessive oil consumption. *
;; If leakage into coolant passages is a possible cause *
;;    of some problem,                                  *
;; Then present the possible causes of leakage into     *
;;      coolant passages.                               *
;;                                                     *
;; Variables:                                          *
;;   ?pc - used for retracting the possible cause.     *
;;   ?problem - the problem selected by the user.      *
;;   ?response - the users response to the menu prompt.*
;;*******************************************************
(defrule possible-causes-of-leakage-into-coolant-passages
  (troubleshoot-mode engine)
  (menu-level engine possible-causes-1-3-2)
  ?pc <- (possible-cause ?problem leakage-into-coolant-passages)
=>
  (retract ?pc)
  (printout t crlf crlf crlf)
  (printout t
  "        You selected LEAKAGE INTO COOLANT PASSAGES as a possible" crlf
  "        cause of the problem " ?problem ".  If you" crlf
  "        change your mind and would like to review the previous" crlf
  "        choices, press 0 now, otherwise select one of the possible" crlf
  "        causes of LEAKAGE INTO COOLANT PASSAGES listed below." crlf crlf
  "                  0.) Return to previous menu." crlf
  "                  1.) Deformed rotor housing." crlf
  "                  2.) Malfunction of sealing rubber." crlf
  "        Choice: ")
    (bind ?response (read))
    (assert (possible-cause ?problem ?response))
    (printout t crlf))
;;
;;*******************************************************
;; This is the sub menu for gas seal noise under        *
;; problem of excessive oil consumption.                *
;; If gas seal noise is a possible cause                *
;;    of some problem,                                  *
;; Then present the possible causes of gas seal noise   *
;;                                                     *
;; Variables:                                          *
;;   ?pc - used for retracting the possible cause.     *
;;   ?problem - the problem selected by the user.      *
;;   ?response - the users response to the menu prompt.*
;;*******************************************************
(defrule possible-causes-of-gas-seal-noise
  (troubleshoot-mode engine)
  (menu-level engine possible-causes-1-4-1)
  ?pc <- (possible-cause ?problem gas-seal-noise)
=>
  (retract ?pc)
  (printout t crlf crlf crlf)
  (printout t
  "        You selected GAS SEAL NOISE as a possible cause of the" crlf
  "        problem " ?problem ".  If you change your mind and" crlf
  "        would like to review the previous choices, press 0" crlf
  "        now, otherwise select one of the possible causes of" crlf
  "        GAS SEAL NOISE listed below." crlf crlf
  "                  0.) Return to previous menu." crlf
  "                  1.) Malfunction of gas seal." crlf
  "                  2.) Malfunction of housing." crlf
  "                  3.) Malfunction of seal spring." crlf
  "                  4.) Malfunction of metering oil pump." crlf
  "        Choice: ")
    (bind ?response (read))
    (assert (possible-cause ?problem ?response))
    (printout t crlf))
;;
;;*******************************************************
;; This is the sub menu for knocking noise under the    *
;; problem of excessive oil consumption.                *
;; If gas knocking noise is a possible cause            *
;;    of some problem,                                  *
;; Then present the possible causes of knocking noise.  *
;;                                                     *
;; Variables:                                          *
;;   ?pc - used for retracting the possible cause.     *
;;   ?problem - the problem selected by the user.      *
;;   ?response - the users response to the menu prompt.*
;;*******************************************************
(defrule possible-causes-of-knocking-noise
  (troubleshoot-mode engine)
  (menu-level engine possible-causes-1-4-2)
  ?pc <- (possible-cause ?problem knocking-noise)
=>
  (retract ?pc)
  (printout t crlf crlf crlf)
  (printout t
  "        You selected KNOCKING NOISE as a possible cause of the" crlf
  "        problem " ?problem ".  If you change your mind and" crlf
  "        would like to review the previous choices, press 0" crlf
  "        now, otherwise select the possible cause of" crlf
  "        KNOCKING NOISE listed below." crlf crlf
  "                  0.) Return to previous menu." crlf
  "                  1.) Accumulation of carbon." crlf
  "        Choice: ")
    (bind ?response (read))
    (assert (possible-cause ?problem ?response))
    (printout t crlf))
;;
;;*******************************************************
;; This is the sub menu for hitting noise under         *
;; problem of excessive oil consumption.                *
;; If hitting noise is a possible cause                 *
;;    of some problem,                                  *
;; Then present the possible causes of hitting noise    *
;;                                                     *
;; Variables:                                          *
;;   ?pc - used for retracting the possible cause.     *
;;   ?problem - the problem selected by the user.      *
;;   ?response - the users response to the menu prompt.*
;;*******************************************************
(defrule possible-causes-of-hitting-noise
  (troubleshoot-mode engine)
  (menu-level engine possible-causes-1-4-3)
  ?pc <- (possible-cause ?problem hitting-noise)
=>
  (retract ?pc)
  (printout t crlf crlf crlf)
  (printout t
  "        You selected HITTING NOISE as a possible cause of the" crlf
  "        problem " ?problem ".  If you change your mind and" crlf
  "        would like to review the previous choices, press 0" crlf
  "        now, otherwise select one of the possible causes of" crlf
  "        HITTING NOISE listed below." crlf crlf
  "                  0.) Return to previous menu." crlf
  "                  1.) Malfunction of main bearing or rotor bearing." crlf
  "                  2.) Excessive end play." crlf
  "                  3.) Foreign matter in internal gear or stationary" crlf
  "                      gear, or other malfunction." crlf
  "        Choice: ")
    (bind ?response (read))
    (assert (possible-cause ?problem ?response))
    (printout t crlf))
;;
;;*******************************************************
;; This is the sub menu for OTHER under                 *
;; problem of excessive oil consumption.                *
;; If other is a possible cause                         *
;;    of some problem,                                  *
;; Then present the possible causes of other.           *
;;                                                     *
;; Variables:                                          *
;;   ?pc - used for retracting the possible cause.     *
;;   ?problem - the problem selected by the user.      *
;;   ?response - the users response to the menu prompt.*
;;*******************************************************
(defrule possible-causes-of-other
  (troubleshoot-mode engine)
  (menu-level engine possible-causes-1-4-4)
  ?pc <- (possible-cause ?problem other)
=>
  (retract ?pc)
  (printout t crlf crlf crlf)
  (printout t
  "        You selected OTHER as a possible cause of the problem" crlf
  "        " ?problem ".  If you change your mind and" crlf
  "        would like to review the previous choices, press 0" crlf
  "        now, otherwise select one of the possible causes of" crlf
  "        OTHER listed below." crlf crlf
  "                  0.) Return to previous menu." crlf
  "                  1.) Malfunction of water pump bearing." crlf
  "                  2.) Drive belt tension." crlf
  "                  3.) Malfunction of alternator bearing." crlf
  "                  4.) Exhaust gas leakage." crlf
  "                  5.) Malfunction of fuel system." crlf
  "        Choice: ")
    (bind ?response (read))
    (assert (possible-cause ?problem ?response))
    (printout t crlf))
;;
;;***********************************************************
;; If the current menu level is difficult starting choices, *
;;    and the user selects choice 0,                        *
;; Then re-display the main menu for engine troublshooting. *
;;                                                          *
;; Variables:                                               *
;;   ?ml - for retracting the menu level fact.              *
;;   ?pc - for retracting the possible cause fact.          *
;;***********************************************************
;;
(defrule ascend-to-main-menu-1
  ?ml <- (menu-level engine possible-causes-1-1)
  ?pc <- (possible-cause ?problem 0)
=>
  (retract ?ml)
  (retract ?pc)
  (assert (menu-level engine main)))
;;
;;
;;***********************************************************
;; If the current menu level is possible-causes-1-1-1,      *
;;    and the user selects choice 0,                        *
;; Then re-display the previous menu.                       *
;;                                                          *
;; Variables:                                               *
;;   ?ml - for retracting the menu level fact.              *
;;   ?pc - for retracting the possible cause fact.          *
;;***********************************************************
(defrule ascend-to-previous-menu-1-1-1
  ?ml <- (menu-level engine possible-causes-1-1-1)
  ?pc <- (possible-cause ?problem 0)
=>
  (retract ?ml)
  (retract ?pc)
  (assert (menu-level engine possible-causes-1-1)))
;;
;;***********************************************************
;; If the current menu level is possible-causes-1-2-1,      *
;;    and the user selects choice 0,                        *
;; Then re-display the previous menu.                       *
;;                                                          *
;; Variables:                                               *
;;   ?ml - for retracting the menu level fact.              *
;;   ?pc - for retracting the possible cause fact.          *
;;***********************************************************
(defrule ascend-to-previous-menu-1-2-1
  ?ml <- (menu-level engine possible-causes-1-2-1)
  ?pc <- (possible-cause ?problem 0)
=>
  (retract ?ml)
  (retract ?pc)
  (assert (menu-level engine possible-causes-1-2)))
;;
;;***********************************************************
;; If the current menu level is possible-causes-1-3-1,      *
;;    and the user selects choice 0,                        *
;; Then re-display the previous menu.                       *
;;                                                          *
;; Variables:                                               *
;;   ?ml - for retracting the menu level fact.              *
;;   ?pc - for retracting the possible cause fact.          *
;;***********************************************************
(defrule ascend-to-previous-menu-1-3-1
  ?ml <- (menu-level engine possible-causes-1-3-1)
  ?pc <- (possible-cause ?problem 0)
=>
  (retract ?ml)
  (retract ?pc)
  (assert (menu-level engine possible-causes-1-3)))
;;
;;***********************************************************
;; If the current menu level is possible-causes-1-3-2,      *
;;    and the user selects choice 0,                        *
;; Then re-display the previous menu.                       *
;;                                                          *
;; Variables:                                               *
;;   ?ml - for retracting the menu level fact.              *
;;   ?pc - for retracting the possible cause fact.          *
;;***********************************************************
(defrule ascend-to-previous-menu-1-3-2
  ?ml <- (menu-level engine possible-causes-1-3-2)
  ?pc <- (possible-cause ?problem 0)
=>
  (retract ?ml)
  (retract ?pc)
  (assert (menu-level engine possible-causes-1-3)))
;;
;;***********************************************************
;; If the current menu level is possible-causes-1-4-1,      *
;;    and the user selects choice 0,                        *
;; Then re-display the previous menu.                       *
;;                                                          *
;; Variables:                                               *
;;   ?ml - for retracting the menu level fact.              *
;;   ?pc - for retracting the possible cause fact.          *
;;***********************************************************
(defrule ascend-to-previous-menu-1-4-1
  ?ml <- (menu-level engine possible-causes-1-4-1)
  ?pc <- (possible-cause ?problem 0)
=>
  (retract ?ml)
  (retract ?pc)
  (assert (menu-level engine possible-causes-1-4)))
;;
;;***********************************************************

⌨️ 快捷键说明

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