Re: [Lisa-users] how to bind a variable with multislots in the LHS?
Brought to you by:
youngde
From: <kro...@gm...> - 2008-03-26 23:12:35
|
"Johan Lindberg" <joh...@gm...> writes: > The problem, as you have already figured out, lies in that there are > no multislots in Lisa. thanks for your answer. At first I thought that if I put a list in a slot it was a 'multislot'. now I see that's not the case. > Personally I think you should define a template for each of the > implied facts, not only is it more readable, it is also faster. > Mutlislots are terribly slow in CLIPS. I love them because they allow > me to express a pattern match very clearly and concisely but I hate > them because whenever I pour in a few thousand facts matching such a > rule I might as well call it a day. I agree. I think they can be easily converted in this example, I suppose the only thing that will be more verbose is to translate this sequence: (defrule generate-combinations ?f <- (value ?s ?e) => (retract ?f) (assert (avh (a ?s) (v ?e) (h 1)) (avh (a ?s) (v ?e) (h 2)) (avh (a ?s) (v ?e) (h 3)) (avh (a ?s) (v ?e) (h 4)) (avh (a ?s) (v ?e) (h 5)))) where ?a would have to match a slot name in the new code. Pedro |