无法断言内存中的相同事实
Cannot assert the same fact in the memory
在剪辑中,我在记忆中有以下事实。我想按照某种规则重新生成它。当我重新生成它时,它不会将其添加到事实中。因为所有字段值都相同。这个问题有什么解决办法吗?
(objct (name food) (edible? yes) (isa Object))
基本编程指南,第 13.4.4 节,设置事实的复制行为。 http://clipsrules.sourceforge.net/documentation/v630/bpg.pdf
CLIPS> (clear)
CLIPS> (deftemplate objct (slot name) (slot edible?) (slot isa))
CLIPS> (assert (objct (name food) (edible? yes) (isa Object)))
<Fact-1>
CLIPS> (assert (objct (name food) (edible? yes) (isa Object)))
FALSE
CLIPS> (facts)
f-0 (initial-fact)
f-1 (objct (name food) (edible? yes) (isa Object))
For a total of 2 facts.
CLIPS> (set-fact-duplication TRUE)
FALSE
CLIPS> (assert (objct (name food) (edible? yes) (isa Object)))
<Fact-2>
CLIPS> (facts)
f-0 (initial-fact)
f-1 (objct (name food) (edible? yes) (isa Object))
f-2 (objct (name food) (edible? yes) (isa Object))
For a total of 3 facts.
CLIPS>
在剪辑中,我在记忆中有以下事实。我想按照某种规则重新生成它。当我重新生成它时,它不会将其添加到事实中。因为所有字段值都相同。这个问题有什么解决办法吗?
(objct (name food) (edible? yes) (isa Object))
基本编程指南,第 13.4.4 节,设置事实的复制行为。 http://clipsrules.sourceforge.net/documentation/v630/bpg.pdf
CLIPS> (clear)
CLIPS> (deftemplate objct (slot name) (slot edible?) (slot isa))
CLIPS> (assert (objct (name food) (edible? yes) (isa Object)))
<Fact-1>
CLIPS> (assert (objct (name food) (edible? yes) (isa Object)))
FALSE
CLIPS> (facts)
f-0 (initial-fact)
f-1 (objct (name food) (edible? yes) (isa Object))
For a total of 2 facts.
CLIPS> (set-fact-duplication TRUE)
FALSE
CLIPS> (assert (objct (name food) (edible? yes) (isa Object)))
<Fact-2>
CLIPS> (facts)
f-0 (initial-fact)
f-1 (objct (name food) (edible? yes) (isa Object))
f-2 (objct (name food) (edible? yes) (isa Object))
For a total of 3 facts.
CLIPS>