I think lai wrote:
> Hello
> 
> How can I have the same value of ?i and ?slot between rule (matching-similar-case) 
> and rule(idea-combination)? (see the following two rules)
> Could anyone help me?

I'm afraid I don't understand your question; perhaps you could explain
what you want to happen.

Note that fact-slot-value is for the (fairly unusual) case where you
have a reference to a fact object which didn't come from matching a
fact on the LHS of a rule. Otherwise, it's much nicer to simply bind
the value of the slot of interest to a variable on the LHS. What I'm
finding hard to follow is why, in the following rule, you're using
fact-slot-value to get the contents of a slot whose value you've
already matched, and setting the variable that already contains that
value to contain it once again. The following rule (which simply omits
the call to fact-slot-value entirely) is precisely equivalent to your
"idea-combination:"

(defrule idea-combination
   (answer (ident q2)(text ?i))
   ?fact <- (idea (issue ?i) (concept ?slot))
   =>
   (printout t "Combined idea is " ?fact crlf)
   (printout t ?slot crlf)) 


> (defrule idea-combination
>    (answer (ident q2)(text ?i))
>    ?fact <- (idea (issue ?i)(concept ?slot))
>    =>
>    (printout t "Combined idea is " ?fact crlf)
>    (bind ?slot (fact-slot-value ?fact concept))
>    (printout t ?slot crlf)) 


---------------------------------------------------------
Ernest Friedman-Hill  
Science and Engineering PSEs        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