Re: how to bind a variable with multislots in the LHS?
[email protected] (Pedro Kröger) Wed, 26 Mar 2008 20:12:16 -0300
| Newsgroups | gmane.lisp.lisa.general |
|---|---|
| Message-ID | <[email protected]> |
"Johan Lindberg" <[email protected]> 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 ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace