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]
--------------------------------------------------------------------

Reply via email to