Hi Aaron.
Correct. I did a quick cut-and-paste from the original memo and forgot
to change the offsets. The original point stands, however.
Win
Aaron Novstrup wrote:
Asserting the initial-fact shifts the fact-ids by 1, so you have to
make the corresponding changes in the code:
(defrule r
(logical (a))
(not (b))
=>
(assert (b)))
(defmodule mod)
(defrule bad-rule
(b)
=>
(printout t "BAD!!!" crlf))
(watch all)
(reset)
(assert (a))
(run)
(retract 2) ;; (retract (b))
(run)
(retract 1) ;; (retract (a))
(focus mod)
(run)
(facts *)
Hi Ernest.
I took a short look at this problem yesterday and noticed: If you
perform a (reset) -- and create an initial-fact -- before performing
(run) this problem does NOT appear. Here's what I ran (a very
slightly modified form of the original list of commands):
(defrule r
(logical (a))
(not (b))
=>
(assert (b)))
(defmodule mod)
(defrule bad-rule
(b)
=>
(printout t "BAD!!!" crlf))
(watch all)
(reset) ;; added by Win Carus
(assert (a))
(facts *) ;; added by Win Carus
(run)
(retract 1) ;; (retract (b))
(run)
(facts *) ;; added by Win Carus
(retract 0) ;; (retract (a))
(focus mod)
(run)
(facts *)
Regards,
Win
begin:vcard
fn:Win Carus
n:Carus;Win
org:Information Extraction Systems, Inc. (tm)
adr:;;20 East Quinobequin Road;Waban;MA;02468;USA
email;internet:[EMAIL PROTECTED]
title:President
tel;work:(617) 244-5068
tel;fax:(617) 244-5068
note;quoted-printable:=E2=80=9CInformation Extraction Systems=E2=80=9D,
=E2=80=9CInfoExtract=E2=
=80=9D, and =E2=80=9CIEBuilder=E2=80=9D are trademarks or registered
trad=
emarks owned by Information Extraction Systems, Inc.
x-mozilla-html:FALSE
url:http://www.InfoExtract.com
version:2.1
end:vcard