JESS: WMEs as slot values

2007-06-11 Thread Wolfgang Laun
Greetings to everybody on this list. The general idea of this approach is to use WME references as slot values. Retrieval of one fact will then permit efficient access to one or more related facts, via some (constant) slots. I haven't found any hint that this isn't permitted, but in the Jess

JESS: breaking loops broken

2007-06-11 Thread Wolfgang Laun
Jess Version 7.0p1 12/21/2006 Using return to break a (for) or (foreach) is documented behaviour. (It isn't for (while), but perhaps this is just an omission in the documentation.) However: ;; Using return to exit from a loop confuses Jess. ;; Loops won't work any more. A (clear) appears to

Re: JESS: WMEs as slot values

2007-06-11 Thread Ernest Friedman-Hill
On Jun 11, 2007, at 3:24 AM, Wolfgang Laun wrote: The following Jess program uses working memory elements as slot values, and this one doesn't fire the rule crossover, although I think it should. (defrule crossover ?e - (side (name ?ename) {occup == FALSE}) ?w - (side (name

Re: JESS: breaking loops broken

2007-06-11 Thread Ernest Friedman-Hill
I think you'll find that any of the loops below will work fine in a context where return has a defined meaning: in particular, in a deffunction or the RHS of a defrule. I could weasel out of this by calling this undefined behavior, as returning from a loop at the prompt has no useful

Re: JESS: breaking loops broken

2007-06-11 Thread Wolfgang Laun
16.70 and 16.71 probably shouldn't mention return at all; this was indeed leading me up the garden path. (I was thinking of (for) and (foreach) as some inline function definition plus call, and that's why you can use return to break from them.) Ernest Friedman-Hill wrote: I think you'll

JESS: Weighted facts

2007-06-11 Thread Andrei Boutyline
Hello, I am trying to find an efficient way of making a Jess workflow that work with facts that behave like singletons. Any approach I can think of seems against the rule engine paradigm. Could you please advise me on how to do this properly? This is what I am considering: * A set of