Yeah, that's better than slot-values, but I was hoping for something
specific to extended template, thanks anyway :)
Two others questions,
1) Since there is no multiple inheritance (extends can be done only on one
fact), what would be the best way to create this :
A has two slots, X, Y
B has one slot Z
C would have X, Y, Z.
(Of course, the simple answer is to create C with those 3 slot).
2) One of the first thing I tried to do was to put a fact-id in a slot. (To
act as a kind of pointer from a fact to another one without using an integer
ID like in a relational database). However, I never saw a exemple in the
documention doing it, or nothing saying "that's good" or "that's bad".
So, I would like to know if there is some problems with it ?
Thanks again.
Jean-François
From: "friedman_hill ernest j" <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Subject: Re: JESS: asserting a fact from another
Date: Sat, 26 Aug 2006 18:08:15 -0700 (PDT)
You can just bind the values to variables on the rule's LHS, right?
(defrule example
(A (x ?x) (y ?y))
=>
(assert (B (x ?x) (y ?y) (z someValue))))
If A and B weren't different templates, you could use the
underappreciated "duplicate" function, but you can't.
I think Skeptic 2000 wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
>
> Hi,
>
> Let's say I have a deftemplate A with two slot : x, and y.
>
> I have another deftemplate B whom extends A, adding slot z.
>
> Then I have a rule that checks for any A-fact with special values for x
and
> or y.
>
> If the rule fire, I want to create a B fact with the same values as in
the A
> fact (and a value for z of course).
>
> I know that I can use fact-slot-value to get the A-fact values, but is
there
> a cleaner way ?
>
> Thanks.
>
> Jean-Francois
> --------------------------------------------------------------------
> 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]
> --------------------------------------------------------------------
>
---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov
--------------------------------------------------------------------
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]
--------------------------------------------------------------------