📄 drtest06.exp
字号:
TRUECLIPS> (batch "drtest06.bat")TRUECLIPS> (clear) ; DR0501CLIPS> (defmessage-handler USER foo ()) ; DR0501CLIPS> (clear) ; DR0501CLIPS> (list-defmessage-handlers) ; DR0501 - Noneinit primary in class USERdelete primary in class USERprint primary in class USERdirect-modify primary in class USERmessage-modify primary in class USERdirect-duplicate primary in class USERmessage-duplicate primary in class USERFor a total of 7 message-handlers.CLIPS> (defclass a (is-a USER)) ; DR0501CLIPS> (defmessage-handler a foo ()) ; DR0501CLIPS> (defclass a (is-a USER)) ; DR0501CLIPS> (list-defmessage-handlers a) ; DR0501 - Update 1/1/93CLIPS> (conserve-mem off) ; DR0501CLIPS> (defmessage-handler USER foo ()) ; DR0501CLIPS> (conserve-mem on) ; DR0501CLIPS> (defmessage-handler USER foo ()) ; DR0501CLIPS> (clear) ; DR0501CLIPS> (release-mem) ; DR05012330 ;; Different number is OKCLIPS> (conserve-mem off) ; DR0501CLIPS> (clear) ; DR0502CLIPS> (defclass a (is-a USER)) ; DR0502CLIPS> (defmessage-handler a get-bar ()) ; DR0502CLIPS> (defclass a (is-a USER) (slot bar)) ;; Update 1/1/93CLIPS> (list-defmessage-handlers a) ; DR0502 - NoneCLIPS> (clear) ; DR0503CLIPS> (defglobal ?*global-list* = (mv-append 1 2 3 4))CLIPS> (defrule foo ; DR0503 (items $?list) (test (subset ?list ?*global-list*)) => (printout t "Success!" crlf))CLIPS> (assert (items 2 3)) ; DR0503<Fact-0>CLIPS> (run) ; DR0503 - Success!Success!CLIPS> (clear) ; DR0504CLIPS> (defrule blah =>) ; DR0504CLIPS> (deffacts a (x y) (z q)) ; DR0504CLIPS> (deftemplate foob (field x)) ; DR0504CLIPS> (defglobal ?*x* = 6) ; DR0504CLIPS> (deffunction quox (?x) (* ?x 3)) ; DR0504CLIPS> (defclass hip (is-a USER)) ; DR0504CLIPS> (bsave "drtest06.bin") ; DR0504[CSTRNBIN1] WARNING: Constraints are not saved with a binary image when dynamic constraint checking is disabled.TRUECLIPS> (bload "drtest06.bin") ; DR0504TRUECLIPS> (bload "drtest06.bin") ; DR0504TRUECLIPS> (clear) ; DR0504CLIPS> (clear) ; DR0506CLIPS> (retract *) ; DR0506CLIPS> (clear) ; DR0508CLIPS> (deffacts list-fact ; DR0508 (list 12 "=" 3.0 i2))CLIPS> (defrule test-member ; DR0508 (list $?list) => (printout t "position=" (member i2 ?list) crlf))CLIPS> (reset) ; DR0508CLIPS> (run) ; DR0508 - position=4position=4CLIPS> (clear) ; DR0511CLIPS> (deftemplate calculate ; DR0511 (field operation (type SYMBOL) (default ?NONE)))CLIPS> (assert (calculate (operation +))) ; DR0511<Fact-0>CLIPS> (modify 1 (calculate (operation op2))) ; DR0511 - Error[EXPRNPSR3] Missing function declaration for operation.CLIPS> (duplicate 1 (calculate (operation word))) ; DR0511 - Error[EXPRNPSR3] Missing function declaration for operation.CLIPS> (clear) ; DR0512CLIPS> (deftemplate calculate ; DR0512 (field operation (type SYMBOL) (default ?NONE)))CLIPS> (assert (calculate (operation 4<56))) ; DR0512 - Error[TMPLTDEF2] The single field slot operation can only contain a single field value.CLIPS> (assert (calculate (operation go)))<Fact-0>CLIPS> (modify 0 (operation 467<789))) ; DR0512 - Error[TMPLTFUN2] Attempted to assert a multifield value into the single field slot operation of deftemplate calculate.FALSECLIPS> (duplicate 0 (operation 54<2345))) ; DR0512 - Error[TMPLTFUN2] Attempted to assert a multifield value into the single field slot operation of deftemplate calculate.FALSECLIPS> (clear) ; DR0517CLIPS> (deftemplate r ; DR0517 (field mine) (field yours)) ; DR0517CLIPS> (watch facts) ; DR0517CLIPS> (assert (r (mine "string"))) ; DR0517==> f-0 (r (mine "string") (yours nil))<Fact-0>CLIPS> (assert (r (yours this-is-a-word)))==> f-1 (r (mine nil) (yours this-is-a-word))<Fact-1>CLIPS> (modify 0 (mine "string")) ; DR0517<== f-0 (r (mine "string") (yours nil))==> f-2 (r (mine "string") (yours nil))<Fact-2>CLIPS> (modify 1 (yours wordie)) ; DR0517<== f-1 (r (mine nil) (yours this-is-a-word))==> f-3 (r (mine nil) (yours wordie))<Fact-3>CLIPS> (modify 3 (yours is-mine)) ; DR0517<== f-3 (r (mine nil) (yours wordie))==> f-4 (r (mine nil) (yours is-mine))<Fact-4>CLIPS> (unwatch facts) ; DR0517CLIPS> (clear) ; DR0519CLIPS> (deftemplate result ; DR0519 (field x (type NUMBER) (allowed-floats 5.0 6.0 7.0 8.8 9.0 8.0) (allowed-integers 1 2 3 4) (default ?NONE)))CLIPS> (assert (result (x 6))) ; DR0519[CSTRNCHK1] A literal slot value found in the assert commanddoes not match the allowed values for slot x.CLIPS> (clear) ; DR0520CLIPS> (assert (a) (b) (c)) ; DR0520<Fact-2>CLIPS> (facts) ; DR0520f-0 (a)f-1 (b)f-2 (c)For a total of 3 facts.CLIPS> (facts 0 2 2) ; DR0520f-0 (a)f-1 (b)For a total of 2 facts.CLIPS> (facts 2) ; DR0520f-2 (c)For a total of 1 fact.CLIPS> (not FALSE) ; DR0521 - TRUETRUECLIPS> (not "FALSE") ; DR0521 - FALSEFALSECLIPS> (clear) ; DR0522CLIPS> (deftemplate foo (field x)) ; DR0522CLIPS> (assert (foo (x (1 2)))) ; DR0522 - Error[EXPRNPSR1] A function name must be a symbolCLIPS> (facts) ; DR0522 - NoneCLIPS> (print-region 1 1) ; DR0524 - Error[ARGACCES5] Function print-region expected argument #1 to be of type symbolCLIPS> (print-region 3 "foo.lis" ROOT SUBTOPIC) [ARGACCES5] Function print-region expected argument #1 to be of type symbolCLIPS> (print-region t 3 ROOT SUBTOPIC) ; DR0524 - Error[ARGACCES5] Function print-region expected argument #2 to be of type symbol or stringCLIPS> (deffunction mftest () ; DR0525 (bind ?result (mv-append)) (bind ?i 140) (while (> ?i 0) do (bind ?result (mv-append ?i ?result)) (bind ?i (- ?i 1))) ?result)CLIPS> (mftest) ; DR0525(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140)CLIPS> (clear) ; DR0526CLIPS> (defrule dr0384 ; DR0526 => (bind ?a (** 2 (- -11 (numberp 3)))) (if (and (< ?a 0.000245) (>= ?a 0.000244)) then (assert (DR0384 OK))))[ARGACCES5] Function - expected argument #2 to be of type integer or floatERROR:(defrule MAIN::dr0384 => (bind ?a (** 2 (- -11 (numberp 3))CLIPS> (seed (5)) ; DR0527[EXPRNPSR1] A function name must be a symbolCLIPS> (sym-cat (str-explode "a s d g e f")) ; DR0528 - Error[ARGACCES5] Function sym-cat expected argument #1 to be of type string, instance name, symbol, float, or integernilCLIPS> (str-length ; DR0529 - Error (str-implode ((mv-append 1 2 3 4) (mv-append 4 3 2 1))))[EXPRNPSR1] A function name must be a symbolCLIPS> (deg-grad 90) ; DR0532 - 100.0100.0CLIPS> (* 3.6 15.0) ; DR0533 - 54.054.0CLIPS> (* 3.0 15.0) ; DR0533 - 45.045.0CLIPS> 898~898 ; DR0536 - 898898CLIPS> (format nil "%ld" 12) ; DR0539 - "12""12"CLIPS> (format nil "|%ld|" 12) ; DR0539 - "|12|""|12|"CLIPS> (clear) ; DR0540CLIPS> (defglobal ?*x* = ?*r*) ; DR0540 - Error[GLOBLDEF1] Global variable ?*r* is unbound.ERROR:(defglobal MAIN ?*x* = ?*r*CLIPS> (defglobal ?*w* = 4) ; DR0540 - OKCLIPS> (clear) ; DR0541CLIPS> (defclass a (is-a OBJECT)) ; DR0541CLIPS> (defclass b (is-a OBJECT)) ; DR0541CLIPS> (defclass c (is-a a)) ; DR0541CLIPS> (defclass d (is-a b)) ; DR0541CLIPS> (defclass e (is-a c d)) ; DR0541CLIPS> (defclass f (is-a e b a)) ; DR0541CLIPS> (describe-class e) ; DR0541 - e c a d b OBJECT================================================================================********************************************************************************Abstract: direct instances of this class cannot be created.Direct Superclasses: c dInheritance Precedence: e c a d b OBJECTDirect Subclasses: f********************************************************************************================================================================================CLIPS> (describe-class f) ; DR0541 - f e c d b a OBJECT================================================================================********************************************************************************Abstract: direct instances of this class cannot be created.Direct Superclasses: e b aInheritance Precedence: f e c d b a OBJECTDirect Subclasses:********************************************************************************================================================================================CLIPS> (clear) ; DR0542CLIPS> (defclass a (is-a USER) ; DR0542 (slot x (default (+ 3 (eval "(gensym)")))))[ARGACCES5] Function + expected argument #2 to be of type integer or floatERROR:(defclass MAIN::a (is-a USER) (slot x (default (+ 3 (eval "(gensym)"))))CLIPS> (clear) ; DR0543CLIPS> (deffunction blah () (if a b)) ; DR0543 - Error[PRNTUTIL2] Syntax Error: Check appropriate syntax for if function.ERROR:(deffunction MAIN::blah () (if a bCLIPS> (blah) ; DR0543 - Undefined[EXPRNPSR3] Missing function declaration for blah.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -