Re: JESS: Re: functions as values and calling them

2008-08-25 Thread Wolfgang Laun
Thanks for finding this bug. You have seen that this can (now) be done using the builtin call. Just to set the record straight, the fix should be in one if earlier, where we test that some things have to be evaluated in the current context before we really know what we have. if

Re: JESS: Retrieving a fact id

2008-08-25 Thread Wolfgang Laun
This can be done by binding the entire fact, as in a rule's LHS. (defquery allPersons ?p - (Person)) (bind ?res (run-query* allPersons)) (while (?res next) (bind ?person (?res get p)) (modify ?person (visited TRUE)) ) On Mon, Aug 11, 2008 at 12:44 PM, Borislav Bonev [EMAIL PROTECTED]

Re: JESS: Using count-query-results in a rule LHS

2008-08-25 Thread Wolfgang Laun
On Tue, Aug 19, 2008 at 8:52 AM, Jan Willem Lokin [EMAIL PROTECTED] wrote: I'd like to use a rule of the following form: (defrule rule557 (logical (is-active (name Some name)) (in-coverage (tid ?tid) (cid ?cid) (distance ?distance:( 2 (count-query-results

RE: JESS: Jess Problem

2008-08-25 Thread Matt Accola
All last week we did testing on both internal and customer environments. Could never replicate the issue on our internal environments. On the customer environment the issue is reproducible, however, there is not a set of steps to reproduce consistently. The issue either does/does not manifest

Re: JESS: functions as values and calling them

2008-08-25 Thread Hal Hildebrand
Yea, asserting before defining the rule definitely has a tendency to make things confusing... On Aug 24, 2008, at 8:42 PM, Jason Morris wrote: Hi Hal, Clean up your code a bit, and I think it works fine. :-) ; hal.clp (clear) (watch all) (deftemplate functional-fact (slot func))

Re: JESS: Re: functions as values and calling them

2008-08-25 Thread Hal Hildebrand
Thanks for providing the function ;) On Aug 25, 2008, at 3:55 AM, Wolfgang Laun wrote: Thanks for finding this bug. You have seen that this can (now) be done using the builtin call. Just to set the record straight, the fix should be in one if earlier, where we test that some things have to

Re: JESS: GUI and defquery

2008-08-25 Thread seyed hossein
Hi,Thanks Mr. Kirby for the response, As I mentioned in my previous email, I've called next in my program's deffunction running-query [(?result next)], but why does it return false? I think the problem is caused by calling the defquery within a deffuction. Does anyone know a better way of

JESS: multilevel backward chaining

2008-08-25 Thread Marcin Krol
Hello everyone, I'm new to Jess and struggling with making one example work, based on problem from http://en.wikipedia.org/wiki/Backward_chaining The goal is to find the pet's color if given that pet is a frog or a canary. I have defined such rules: === (do-backward-chaining

Re: JESS: multilevel backward chaining

2008-08-25 Thread Jason Morris
Hi Marcin, First of all, be careful how you do your pattern matching. The symbol frog and the string frog are not the same things. This was causing a problem in your (pet-kind) rule. BTW -- It also helps to be consistent in how you name your variables. I prefer being verbose

Re: JESS: GUI and defquery

2008-08-25 Thread Robert Kirby
The next method returns FALSE if there are no more records, which in your case probably means that there were no records returned at all. It would be good practice to always check the return value of next even if you expect at least one record from the defquery call. I have successfully used