📄 factscmd.exp
字号:
TRUECLIPS> (batch "factscmd.bat")TRUECLIPS> (clear)CLIPS> (facts) ; factsCLIPS> (assert (a) (b) (c) (d) (e) (f))<Fact-5>CLIPS> (facts)f-0 (a)f-1 (b)f-2 (c)f-3 (d)f-4 (e)f-5 (f)For a total of 6 facts.CLIPS> (facts 1 2 3 4 5)[ARGACCES4] Function facts expected no more than 4 argument(s)CLIPS> (facts "a")[ARGACCES5] Function facts expected argument #1 to be of type symbol or positive numberCLIPS> (facts 1 a)[ARGACCES5] Function facts expected argument #2 to be of type integerCLIPS> (facts 1 2 a)[ARGACCES5] Function facts expected argument #3 to be of type integerCLIPS> (facts -1 5 2)[ARGACCES5] Function facts expected argument #1 to be of type symbol or positive numberCLIPS> (facts 4 -1 2)[ARGACCES5] Function facts expected argument #2 to be of type positive numberCLIPS> (facts 3 4 -2)[ARGACCES5] Function facts expected argument #3 to be of type positive numberCLIPS> (facts 4 2)CLIPS> (facts 4)f-4 (e)f-5 (f)For a total of 2 facts.CLIPS> (facts 2 4)f-2 (c)f-3 (d)f-4 (e)For a total of 3 facts.CLIPS> (facts 1 5 2)f-1 (b)f-2 (c)For a total of 2 facts.CLIPS> (save-facts) ; save-facts and load-facts[ARGACCES4] Function save-facts expected at least 1 argument(s)CLIPS> (save-facts 10)[ARGACCES5] Function save-facts expected argument #1 to be of type symbol or stringCLIPS> (save-facts factscmd.tmp 10)[ARGACCES5] Function save-facts expected argument #2 to be of type symbolCLIPS> (save-facts factscmd.tmp)TRUECLIPS> (clear)CLIPS> (facts)CLIPS> (load-facts)[ARGACCES4] Function load-facts expected exactly 1 argument(s)CLIPS> (load-facts 10)[ARGACCES5] Function load-facts expected argument #1 to be of type symbol or stringCLIPS> (load-facts factscmd.tmp 10)[ARGACCES4] Function load-facts expected exactly 1 argument(s)CLIPS> (load-facts factscmd.tmp)TRUECLIPS> (facts)f-0 (a)f-1 (b)f-2 (c)f-3 (d)f-4 (e)f-5 (f)For a total of 6 facts.CLIPS> (clear) ; dependencies and dependentsCLIPS> (defrule foo1 (logical (a) (b)) => (assert (e)))CLIPS> (defrule foo2 (logical (b)) (c) => (assert (e)))CLIPS> (defrule foo3 (logical (d) (b) (a)) (c) => (assert (e)))CLIPS> (defrule foo4 (logical (d) (b) (a) (c)) => (assert (e)))CLIPS> (defrule foo5 (logical (a) (c) (d)) => (assert (e)))CLIPS> (defrule foo6 (declare (salience -1)) (logical (c) (d)) => (assert (f)))CLIPS> (defrule foo7 (declare (salience -1)) (logical (a)) (c) => (assert (f)))CLIPS> (defrule foo8 (declare (salience -1)) (logical (c) (a)) (d) => (assert (f)))CLIPS> (defrule foo9 (declare (salience -2)) (logical (d) (c) (b)) => (assert (g)))CLIPS> (assert (a) (b) (c) (d))<Fact-3>CLIPS> (run)CLIPS> (facts)f-0 (a)f-1 (b)f-2 (c)f-3 (d)f-4 (e)f-5 (f)f-6 (g)For a total of 7 facts.CLIPS> (dependencies)[ARGACCES4] Function dependencies expected exactly 1 argument(s)CLIPS> (dependencies a)[PRNTUTIL1] Unable to find instance a.CLIPS> (dependencies 9)[PRNTUTIL1] Unable to find fact f-9.CLIPS> (dependencies 4 5)[ARGACCES4] Function dependencies expected exactly 1 argument(s)CLIPS> (dependencies 4)f-0,f-1f-1f-0,f-2,f-3f-3,f-1,f-0,f-2f-3,f-1,f-0CLIPS> (dependencies 2)NoneCLIPS> (dependents)[ARGACCES4] Function dependents expected exactly 1 argument(s)CLIPS> (dependents a)[PRNTUTIL1] Unable to find instance a.CLIPS> (dependents 9)[PRNTUTIL1] Unable to find fact f-9.CLIPS> (dependents 4 5)[ARGACCES4] Function dependents expected exactly 1 argument(s)CLIPS> (dependents 0)f-4,f-5CLIPS> (dependents 1)f-4,f-6CLIPS> (dependents 2)f-4,f-5,f-6CLIPS> (dependents 3)f-4,f-5,f-6CLIPS> (dependents 4)NoneCLIPS> (dependents 5)NoneCLIPS> (clear) ; get-fact-duplication and set-fact-duplicationCLIPS> (assert (a))<Fact-0>CLIPS> (assert (a))FALSECLIPS> (facts)f-0 (a)For a total of 1 fact.CLIPS> (get-fact-duplication) FALSECLIPS> (get-fact-duplication TRUE)[ARGACCES4] Function get-fact-duplication expected exactly 0 argument(s)CLIPS> (set-fact-duplication)[ARGACCES4] Function set-fact-duplication expected exactly 1 argument(s)CLIPS> (set-fact-duplication TRUE FALSE)[ARGACCES4] Function set-fact-duplication expected exactly 1 argument(s)CLIPS> (set-fact-duplication 10)FALSECLIPS> (get-fact-duplication)TRUECLIPS> (set-fact-duplication TRUE)TRUECLIPS> (get-fact-duplication)TRUECLIPS> (clear)CLIPS> (assert (a))<Fact-0>CLIPS> (assert (a))<Fact-1>CLIPS> (facts)f-0 (a)f-1 (a)For a total of 2 facts.CLIPS> (set-fact-duplication FALSE)TRUECLIPS> (get-fact-duplication)FALSECLIPS> (clear)CLIPS> (assert (a))<Fact-0>CLIPS> (assert (a))FALSECLIPS> (facts)f-0 (a)For a total of 1 fact.CLIPS> (clear) ;; New 6.0 StuffCLIPS> (defmodule A)CLIPS> (assert (x) (y) (z))<Fact-2>CLIPS> (defmodule B)CLIPS> (assert (a) (b) (c))<Fact-5>CLIPS> (facts)f-3 (a)f-4 (b)f-5 (c)For a total of 3 facts.CLIPS> (facts A)f-0 (x)f-1 (y)f-2 (z)For a total of 3 facts.CLIPS> (facts B)f-3 (a)f-4 (b)f-5 (c)For a total of 3 facts.CLIPS> (facts *)f-0 (x)f-1 (y)f-2 (z)f-3 (a)f-4 (b)f-5 (c)For a total of 6 facts.CLIPS> (clear)CLIPS> (dribble-off)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -