I don't see any rules here that can fire. rule-1 matches the asserted
student fact, but a need-course fact doesn't exist.  

rule-2 matches the asserted need-class fact, but the only student fact
doesn't match (the pattern $?c1 ?c $?c2 requires there to be at least
one item in the courses slot to match the ?c, and the only student
fact has an empty courses slot.) Because the student fact doesn't
match, the need-course fact isn't generated (that's how it works;
backward chaining is triggered by the previous patetrn being matched.)

> is there any way i can fire the rules?

I'm not exactly sure what you're trying to accomplish, or I'd make a
specific recommendation.

> Also how do i specify a default value for a multislot?

Like this:

  (deftemplate student (multislot course (default (create$ XYZ PDQ 123))))

I think =?iso-8859-1?q?Moderator?= wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hi,
> 
> I have following wme types:
> 
> (deftemplate student (slot name) (multislot courses))
> (deftemplate class (slot name) (multislot students))
> (deftemplate course (slot name) (slot prof))
> 
> (do-backward-chaining student)
> (do-backward-chaining class)
> (do-backward-chaining course)
> 
> (assert (student))
> (assert (need-class))
> 
> (defrule rule1
>      (need-course)
>      ?student <- (student 
>           (courses ))
> 
> =>
>      (bind ?c3 (assert (course (name X))))
>       (modify ?student (courses ?c3))
> )
> 
> (defrule rule2
>      (need-class)
>      ?student <- (student 
>           (courses $?c1 ?c $?c2))
>      ?c <- (course
>               (name X))
> =>
>      (bind ?class (assert (class (students
> ?student))))
>      (printout t "Rule2 fired")
> )
> 
> 
> Then when i say (run) none of the rules fire.
> 
> is there any way i can fire the rules?
> Also how do i specify a default value for a multislot?




---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems 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