I think Foertsch, Eric wrote:
>
> (bind $?symptoms (create$ (fact-slot-value ?fact symptoms)))
Note that you're crating a multifield with create$, and the first
element of that multifield is the multifield that the "symptoms" slot
contains. Jess normally "flattens" nested lists, but in this
particular circumstance, it doesn't.
Note also that the variables $?symptoms and ?symptoms will refer to
the same storage; the "$" just tells Jess to treat the variable a
special way when it's actually being matched on the LHS of a fact. A
plain ?symptoms variable is perfectly capable of holding a list, and
as a matter of style that's what you should use. So applying both of
these suggestions, we get
(bind ?symptoms (fact-slot-value ?fact symptoms))
>
> 1. What am I doing wrong in not being able to isolate the individual
> items in a multislot?
You built a nested list; makes sense now, right?
>
> 2. From prior emails on the archive I get the impression I should
> 'normalize' the data something along the lines of
>
> (deftemplate symptom (slot name)) or just use for
> example (assert (symptom "Fever"))
> (deftemplate illness (slot name) (multislot symptoms))
>
> And then assert facts like:
> (bind ?Fever (assert (symptom name("Fever"))) )
> (bind ?Abdominal_Pain (assert (symptom (name "Abdominal
> Pain"))) )
> (assert (illness (name "Disentery") (symptoms ?Fever
> ?Abdominal_Pain)) )
>
> Is the above a better way of assigning the values to a multislot
> from an efficiency and access point of view?
>
No, there's nothing intrinsically "better" about this; it uses more
memory. If a symptom had more data than just a name, then it would
start to make sense. But if it's functionally equivalent to a String,
then might as well just use a string.
---------------------------------------------------------
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]
--------------------------------------------------------------------