Re: JESS: Lisp is maddening

2010-09-18 Thread Win Carus
, GA, NV, TN, CA, OK, OH, WY, FM, FL, SD, SC, CT, WV, DC, WI, KY, KS, OR, LA, GU, WA, CO, PA] Regards, Win Carus On 09/18/2010 09:24 AM, Donald Winston wrote: Why doesn't this work? (defglobal ?*usps-state-codes* = (progn (bind ?hash-set (new java.util.HashSet 59)) (call ?hash-set add

Re: JESS: How to compare the value of two slots in the same fact?

2010-03-12 Thread Win Carus
Try the following instead: (deftemplate t (slot a) (slot b) (slot c) (slot d)) (assert (t (a 5) (b 4) (c 3) (d 2))) (defrule rl (t (a ?a) (b ?b) (c ?c) (d ?d)) (test ( ?a ?b)) (test (or ( ?b ?d) ( ?c ?d))) = (printout t test crlf) ) (run) test 1 There are, of course, other

Re: JESS: Error : Calendar or GregorianCalendar in Jess.

2010-02-02 Thread Win . Carus
Hello Khalid. There is an extensive entry on date handling in Jess and Java (with many working functions) in the Jess Wiki by contributor George Williamson: http://www.jessrules.com/jesswiki/view?WorkingWithDates Regards, Win Hai There, I am having difficult time to use Calendar Class from

Re: JESS: making str-cat correctly interpret \ signs

2008-03-31 Thread Win Carus
Hi Chirag. You might consider using the much richer and more flexible (format) function with a nil router instead of (str-cat). If ?predicate, ?subject, and ?object are all strings: (retract-string (format nil (triple (predicate \%s\) (subject \%s\) (object \%s\)) ?predicate ?subject

Re: JESS: Logical CE bug?

2007-08-25 Thread Win Carus
mod) (defrule bad-rule (b) = (printout t BAD!!! crlf)) (watch all) (reset) ;; added by Win Carus (assert (a)) (facts *) ;; added by Win Carus (run) (retract 1) ;; (retract (b)) (run) (facts *) ;; added by Win Carus (retract 0) ;; (retract (a)) (focus mod) (run) (facts *) Regards, Win begin:vcard

Re: JESS: Logical CE bug?

2007-08-24 Thread Win Carus
(a)) (not (b)) = (assert (b))) (defmodule mod) (defrule bad-rule (b) = (printout t BAD!!! crlf)) (watch all) (reset) ;; added by Win Carus (assert (a)) (facts *) ;; added by Win Carus (run) (retract 1) ;; (retract (b)) (run) (facts *) ;; added by Win Carus (retract 0) ;; (retract (a)) (focus mod) (run

Re: JESS: Defining logical dependencies outside of rules?

2007-03-05 Thread Win Carus
Hi Eithon. Take a look at the logical conditional element in the Jess on-line manual: The logical conditional element lets you specify /logical dependencies/ among facts. All the facts asserted on the RHS of a rule become dependent on the matches to the logicalpatterns on that rule's LHS. If

Re: JESS: How to compare that one list of object contains all objects from other list ?

2007-02-07 Thread Win Carus
Hi Michal. This is really a basic Java programming question, I think. Using Java, you can iterate over the elements of the first ArrayList to ensure they are contained in the second ArrayList. Assume that the first list is contained in the second and seek evidence to the contrary: boolean

Re: JESS: Regular Expressions help needed

2006-07-04 Thread Win Carus
Hi Zafer. Regular expression matching uses the java.util.regex match functionality (The |matches| http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Matcher.html#matches%28%29 method attempts to match the entire input sequence against the pattern.). So, if you want to match an embedded

Re: JESS: Regular expression syntax

2003-11-04 Thread Win Carus
[EMAIL PROTECTED] wrote: I think Mihai Barbuceanu wrote: And for multislot binding would you allow $/[a-z]*/, meaning each value in the set has to match the regex? E.g. (animal (legs $/[a-z]*/)) or (animal (legs ?leg1 ?leg2 $/[a-z]*/)). Mihai Hey, that's a cool idea! Do people agree?

Re: JESS: Newbie question (Coin puzzle-SOLVED)

2003-08-14 Thread Win Carus
Hi Ernest and Mitch. I made one small mistake in the test. The test should have been for = instead of . This does not materially affect performance (it's still just as fast), but some missing answers are now generated. (defrule find-solution (coin (denomination penny) (count ?cp) (amount ?ap))

Re: JESS: Newbie question (Coin puzzle-SOLVED)

2003-08-14 Thread Win Carus
: Monday, August 11, 2003 1:20 PM To: [EMAIL PROTECTED] Subject: Re: JESS: Newbie question (Coin puzzle-SOLVED) I think Win Carus wrote: Ernest's approach reduces matching time substantially and does make it possible in a realistic time to compute the $2.00 change combinations using a version

Re: JESS: Newbie question (Coin puzzle-SOLVED)

2003-08-14 Thread Win Carus
Ernest's approach reduces matching time substantially and does make it possible in a realistic time to compute the $2.00 change combinations using a version of your script modified as he suggest. However ... the generate-and-test approach is still very memory-intensive and a still-better

Re: JESS: Newbie question (Coin puzzle-SOLVED)

2003-08-14 Thread Win Carus
Hi Ernest and Mitch. Not to be outdone ... An even greater performance boost can be achieved not only by Ernest's reordering-the-tests + pennies-are-0-modulo-5-test approach, but also by adding summation at each denomination: (defrule find-solution (coin (denomination penny) (count ?cp)

Re: JESS: Jess IDE - Eclipse plug-in

2003-07-23 Thread Win Carus
Hi Ernest. For Jess 7.0 I would vote in favor of a well-written Eclipse plug-in and more attention given to core engine features (e.g., performance and new functionality). Since you are uniquely positioned to add the Jess-specific functionality, I would strongly vote in favor of focussing on

Re: JESS: Einstein's Riddle in Jess

2003-06-12 Thread Win Carus
the zebra.clp example supplied by the Jess distribution (which is taken, in turn, directly from the Giarratano and Riley's Expert Systems: Principles and Programming). Regards, Win Carus Dear Jessers, I am a newbie to Jess. I would like to solve the following riddle using Jess. I have previously

Re: JESS: Convert a string to integer

2003-06-11 Thread Win Carus
Hello Dukle. I believe that you've misinterpreted the Jess documentation. There are three string-number conversion function in Jess (float, integer, and long). They work by calling the type-X-specific parseX method: (float 25) is equivalent to (call Float parseFloat 25) (integer 25) is

Re: JESS: PDF version of manual

2003-03-21 Thread Win Carus
[EMAIL PROTECTED] wrote: Hi Folks, A few quick announcements. First, the first release candidate for Jess 6.1 will come out on Monday, barring any unforeseen problems. If you've got any 6.1 prerelease bug reports, please let me know now! Secondly, I tried using html2ps from

Re: JESS: Jess book news

2002-09-09 Thread Win Carus
Hi Ernest. This is great news about your book! Some things you might consider: FAQ. Newbies on the jess-users list seems to have some rather common themes (esp. related to installation, Java, rule writing, performance, missing features, and so forth) that might be gathered in a single place