George,

   indeed the use of fact-ids is a bit of a hack of mine. I need to relate
pairs of (dissimilar) facts to each other -- I could certainly do this by
adding a 'join slot' to each and then putting  a common unqiue value (via
gensym*) into both of these slots, but the facts are definstances (!) of
beans, and so I would need to extend then just to handle this bookeeping.
The alternative is to assert something like  (are-linked ?fid1 ?fid2) and
then having a rule which fires over this secondary 'index database'. This
has the problem that I can't modify the slots in facts (because, at the
moment, fact-ids can shift around when slos are modified) but doesn't
involve an extension which seemed to be a little artificial.

If there is another idiom I am missing I'd love to hear about it.

Again thanks to all
Alanl



Rudolph George-P27574 wrote:

> Alan,
>
> My suggestion is don't use the fact id in your rules.
> That facts happen to have an id is an implementation detail
> that you should not rely on.
>
> ----------
> George Rudolph
> Mad Scientist
> Motorola SSG
> ----------
>
> > -----Original Message-----
> > From: alan littleford [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, March 16, 2000 12:04 PM
> > To: 'Jess Users'
> > Subject: JESS: A problem with the OBJECT slot (?)
> >
> >
> > I'm using 5.0 (_very_ nice job, Ernest) and I seem to be
> > running into a
> > problem. I have a java bean -- B, and I defclass it:
> > (defclass C B dynamic). I then have a user function which creates a
> > fact, sets some slot values and asserts it:
> >
> >                f = new Fact("C", engine)
> >                f.setSlotValue(..)
> >                f.setSlotValue(..)
> >                engine.assert(f)
> >
> > So fas so good. In a rule set I acquire the fact ID for the asserted
> > fact. All the slots are there with all the right values except slot
> > OBJECT, which I thought should be a pointer back to the underlying
> > instance of  B. However, for some reason it is the atom 'nill'
> > ( I'm accesing it using (fact-slot-value (integer ?fid) OBJECT)).
> >
> > Am I doing something obviously wrong?
> >
> > Tnx
> > Alanl
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, send the words 'unsubscribe jess-users
> > [EMAIL PROTECTED]'
> > in the BODY of a message to [EMAIL PROTECTED], NOT to the
> > list (use your own address!) List problems? Notify
> > [EMAIL PROTECTED]
> > ---------------------------------------------------------------------
> >

---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to