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

📄 drtest09.exp

📁 NASA 开发使用的一个专家系统
💻 EXP
📖 第 1 页 / 共 2 页
字号:
CLIPS> (clear)                ; DR0753CLIPS> (defmodule MAIN (export ?ALL))CLIPS> (defrule MAIN::foo  =>  (assert (a))  (focus B)  (return))CLIPS> (defrule MAIN::bar  (a)  =>  (focus B)  (return))CLIPS> (defmodule B (import MAIN ?ALL))CLIPS> (defrule B::yak  =>)CLIPS> (reset)CLIPS> (run 1)CLIPS> (list-focus-stack) ; Just B should be on stackBCLIPS> (reset)CLIPS> (focus MAIN B)TRUECLIPS> (list-focus-stack) ; Should be MAIN B MAINMAINBMAINCLIPS> (run 1)CLIPS> (list-focus-stack) ; Should be B B MAINBBMAINCLIPS> (clear)                ; DR0754CLIPS> (defclass A (is-a USER)  (role concrete)  (pattern-match reactive)  (slot foo (create-accessor read-write)))CLIPS> (defclass B (is-a A)  (pattern-match non-reactive))CLIPS> (defrule foo  (test (send [b] put-foo blah))  =>)CLIPS> (make-instance b of B)[b]CLIPS> (assert (initial-fact)) ; Should not generate error<Fact-0>CLIPS> (clear)                ; DR0756 - Should not crashCLIPS> (defclass A (is-a USER) (role concrete))CLIPS> (make-instance a of A)[a]CLIPS> (any-instancep ((?long-var A)) ?long-var:)[EVALUATN1] Variable long-var: is unboundFALSECLIPS> (clear)                ; DR0757 - Error ID should be [INSMNGR11]CLIPS> (defclass A (is-a USER) (role concrete))CLIPS> (make-instance BOGUS::A of A)[INSMNGR11] Invalid module specifier in new instance name.FALSECLIPS> (clear)                ; DR0758CLIPS> (defclass A (is-a USER)  (role concrete))CLIPS> (defglobal ?*x* = (assert (foo))           ?*y* = (make-instance [a] of A))CLIPS> (reset)CLIPS> (facts)f-0     (foo)f-1     (initial-fact)For a total of 2 facts.CLIPS> (instances)[a] of A[initial-object] of INITIAL-OBJECTFor a total of 2 instances.CLIPS> (clear)                ; DR0759CLIPS> (deftemplate A   (slot foo (type INTEGER)             (allowed-instance-names [a])))[CSTRNPSR1] The type attribute conflicts with the allowed-instance-names attribute.ERROR:(deftemplate MAIN::A   (slot foo (type INTEGER) (allowed-instance-names [a]))CLIPS> (clear)                ; DR0763CLIPS> (deffunction bug (?state)   (switch ?state     (case instance then TRUE)     (case logical then TRUE)     (default (return error))))CLIPS> (bsave foo.bin)TRUECLIPS> (clear)                ; DR0765CLIPS> (deftemplate bar   (slot foo (type INTEGER)             (allowed-values abc def)))[CSTRNPSR1] The type attribute conflicts with the allowed-values attribute.ERROR:(deftemplate MAIN::bar   (slot foo (type INTEGER) (allowed-values abc def))CLIPS> (clear)                ; DR0766CLIPS> (deftemplate temp   (multislot foofoo (type INTEGER LEXEME))   (slot after-foo (type STRING)))CLIPS> (set-dynamic-constraint-checking TRUE)FALSECLIPS> (assert (temp (foofoo 11)))<Fact-0>CLIPS> (deftemplate temp2   (multislot foofoo (type INTEGER LEXEME)))CLIPS> (assert (temp2 (foofoo (progn 3.4))))[CSTRNCHK1] Slot value (3.4) found in fact f-1     does not match the allowed types for slot foofoo.<Fact-1>CLIPS> (set-dynamic-constraint-checking FALSE)TRUECLIPS> (clear)                ; DR0770CLIPS> (defclass A (is-a USER)  (role concrete)  (pattern-match reactive)  (multislot foo (default x)))CLIPS> (defrule bomb  (object (foo $? x $?))  (object (foo $? ? $?))=>)CLIPS> (make-instance a of A)[a]CLIPS> (clear)                ; DR0778CLIPS> (deffacts example   (a b c d e d c b a a a a a a a a a a a a))CLIPS> (defrule foo   (a ?x $?y d $?z ?x)   =>   (printout t "x = " ?x " y = " ?y " z = " ?z crlf))CLIPS> (reset)CLIPS> (agenda)CLIPS> (clear)               ; DR0782CLIPS> (set-strategy breadth)depthCLIPS> (set-strategy depth)breadthCLIPS> (deftemplate t1       ; DR0783  (field code)  (field a))CLIPS> (deftemplate t2  (field code)  (field a))CLIPS> (deftemplate t1  (field code)  (field a))CLIPS> (deftemplate t2  (field code)  (field b))CLIPS> (clear)CLIPS> (defclass fifty (is-a USER)       (role   concrete)         (pattern-match  reactive)  (slot   s1      (type   SYMBOL))  (slot   s2      (type   INTEGER))  (slot   s3      (type   SYMBOL))  (slot   s4      (type   INTEGER))  (slot   s5      (type   SYMBOL))  (slot   s6      (type   INTEGER))  (slot   s7      (type   SYMBOL))  (slot   s8      (type   INTEGER))  (slot   s9      (type   SYMBOL))  (slot   s10     (type   INTEGER))  (slot   s11     (type   SYMBOL))  (slot   s12     (type   INTEGER))  (slot   s13     (type   SYMBOL))  (slot   s14     (type   INTEGER))  (slot   s15     (type   SYMBOL))  (slot   s16     (type   INTEGER))  (slot   s17     (type   SYMBOL))  (slot   s18     (type   INTEGER))  (slot   s19     (type   SYMBOL))  (slot   s20     (type   INTEGER))  (slot   s21     (type   SYMBOL))  (slot   s22     (type   INTEGER))  (slot   s23     (type   SYMBOL))  (slot   s24     (type   INTEGER))  (slot   s25     (type   SYMBOL))  (slot   s26     (type   INTEGER))  (slot   s27     (type   SYMBOL))  (slot   s28     (type   INTEGER))  (slot   s29     (type   SYMBOL))  (slot   s30     (type   INTEGER))  (slot   s31     (type   SYMBOL))  (slot   s32     (type   INTEGER))  (slot   s33     (type   SYMBOL))  (slot   s34     (type   INTEGER))  (slot   s35     (type   SYMBOL))  (slot   s36     (type   INTEGER))  (slot   s37     (type   SYMBOL))  (slot   s38     (type   INTEGER))  (slot   s39     (type   SYMBOL))  (slot   s40     (type   INTEGER))  (slot   s41     (type   SYMBOL))  (slot   s42     (type   INTEGER))  (slot   s43     (type   SYMBOL))  (slot   s44     (type   INTEGER))  (slot   s45     (type   SYMBOL))  (slot   s46     (type   INTEGER))  (slot   s47     (type   SYMBOL))  (slot   s48     (type   INTEGER))  (slot   s49     (type   SYMBOL))  (slot   s50     (type   INTEGER)))CLIPS> (deffunction f(?limit ?class)   (reset)   (loop-for-count (?i 1 ?limit)      (bind ?t (time))      (loop-for-count (?j 1 500) (make-instance of ?class))      (printout t ?i crlf)))CLIPS> (f 3 fifty)123FALSECLIPS> (clear)               ; DR0784CLIPS> (defrule testing   ?f1<-(orders $?first&:(> (length$ ?first) 0))   ?f2<-(orders $?others&:(subsetp ?first ?others))   =>)CLIPS> (defrule testing   (orders $?first&:(implode$ ?first)                   :(implode$ ?first))   =>)CLIPS> (clear)               ; DR0785CLIPS> (defglobal ?*x* = 0)CLIPS> (defmodule MAIN (export ?ALL))CLIPS> (defmodule FOO (import MAIN ?ALL))CLIPS> (defclass FOO (is-a USER) (role concrete))CLIPS> (bind ?*x* (instance-address (make-instance foo of FOO)))<Instance-foo>CLIPS> (focus MAIN)TRUECLIPS> (send [FOO::foo] print)[MSGPASS2] No such instance FOO::foo in function send.FALSECLIPS> (send ?*x* print)[INSFUN2] No such instance foo in function send.FALSECLIPS> (clear)               ; DR0786CLIPS> (deftemplate nanu   (slot a (type INTEGER))   (slot b (type FLOAT)))CLIPS> (assert (nanu))<Fact-0>CLIPS> (modify 0 (c 4))[TMPLTDEF1] Invalid slot c not defined in corresponding deftemplate nanu.FALSECLIPS> (clear)               ; DR0788CLIPS> (defrule r1    (or (P1 p1) (P2 p2))    =>)CLIPS> (reset)CLIPS> (bsave r1.bin)TRUECLIPS> (clear)CLIPS> (bload r1.bin)TRUECLIPS> (reset)CLIPS> (watch all)CLIPS> (unwatch all)CLIPS> (clear)               ; DR0789CLIPS> (deffacts MAIN:: the-suit-list)[PRNTUTIL2] Syntax Error:  Check appropriate syntax for construct name.ERROR:(deffacts MAIN::CLIPS> (clear)               ; DR0790CLIPS> (defrule init   =>  (assert (p 1)))CLIPS> (defrule crash  (p ?X)  (not (test (eq ?X 1)))  (p ?Y)  (not (and (test (neq ?Y 20))(test (neq ?Y 30))))  =>)CLIPS> (reset)CLIPS> (run)CLIPS> (clear)               ; DR0791CLIPS> (defrule autorule2_B2  (or (foo ?st_B1)      (bpc-newdata))  =>  ?st_B1)[PRCCODE3] Undefined variable st_B1 referenced in RHS of defrule.ERROR:(defrule MAIN::autorule2_B2   (or  (foo ?st_B1)        (bpc-newdata))   =>   ?st_B1)CLIPS> (clear)CLIPS> (dribble-off)

⌨️ 快捷键说明

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