Re: JESS: [EXTERNAL] Re: Limit on number of rules tried?

2013-12-20 Thread Wolfgang Laun
The rule is somewhat overengineered. Let's look at it, blow by blow. ?cell - (cell ... (row-number ?row-num)) ?cell2 - (cell ... (row-number ?row-num2)) ; (test (= ?row-num ?row-num2)) You can simply use ?cell - (cell ... (row-number ?row-num)) ?cell2 - (cell ... (row-number

Re: JESS: [EXTERNAL] Dynamic rule matching in the LHS

2013-07-31 Thread Wolfgang Laun
On 30/07/2013, Aurelien Mazurie ajmazu...@oenone.net wrote: Thank you very much for this answer. It seems like 'forall' will fire the rule only if all the 'bag-of-items' facts are validated (i.e., if all of them have 'item' facts with the names listed in their 'names' slot). Is that correct?

Re: JESS: [EXTERNAL] Jess in a multithreaded environment

2013-01-03 Thread Wolfgang Laun
Warning: I may have misunderstood the issue completely. If there is a list (or any other collection) maintaining the set of value classes, it stands to reason that it is synchronized for use in a multithreaded environment, and the contention for its lock may very well cause a performance hit. If

Re: JESS: [EXTERNAL] What does the .CLP extension stand for?

2012-11-16 Thread Wolfgang Laun
CLP = CLIPS = C Language Integrated Production System :-) -W On 15/11/2012, Grant Rettke gret...@acm.org wrote: What does the .CLP extension stand for? -- Grant Rettke | ACM, AMA, COG, IEEE gret...@acm.org | http://www.wisdomandwonder.com/ Wisdom begins in wonder. ((λ (x) (x x)) (λ (x) (x

Re: JESS: [EXTERNAL] Activate a Behaviour Jade from Jess

2012-07-12 Thread Wolfgang Laun
You cannot call the action() method of a Behaviour subtype. One of the paradigms to make an Agent do some useful work is to send it messages, and the agent's behaviour (typically a CyclingBehaviour) processes these messages. The message contents could be processed by a Jess engine. Develop an

Re: JESS: [EXTERNAL] Jess and negation

2012-07-11 Thread Wolfgang Laun
On 09/07/2012, André Lämmer andre.laem...@htwg-konstanz.de wrote: Do I have the same problems in Jess with negation and disjunction like with horn clauses in prolog? Why do you have problems with horn clauses in Prolog? -W

Re: JESS: [EXTERNAL] Jess asserts fact that is not true

2012-06-27 Thread Wolfgang Laun
On 26/06/2012, Dwight Hare d.h...@paritycomputing.com wrote: I am trying to reason about the passage of time in my rules. I would like to write the following rule: (defrule Test ?r - (logical (CurrentTime)) (logical (Condition (time ?time:( (+ ?time 5)

Re: JESS: [EXTERNAL] Jess exception: ' ' is a list, not a string

2012-03-13 Thread Wolfgang Laun
If you rely heavily on enums, you might consider using a userfunction that binds enum constants to Jess variables - so you don't need the parentheses. http://www.jessrules.com/jesswiki/view?BindEnumUserFunction -W On 12/03/2012, Friedman-Hill, Ernest ejfr...@sandia.gov wrote: The Jess language

Re: JESS: [EXTERNAL] Jess exception: ' ' is a list, not a string

2012-03-13 Thread Wolfgang Laun
The posted error message still puzzles me. My recollection has it that Jess reports quite accurately the statement where the exception was raised, not just the outermost control statement. Moreover, all levels between the outermost and innermost statement are displayed as well, so that you can

Re: JESS: [EXTERNAL] Jess exception: ' ' is a list, not a string

2012-03-12 Thread Wolfgang Laun
Are you sure that (?*bwapi* getMyUnits) returns a list? Jess' foreach isn't quite as tolerant as for in Java 1.5 and later. You may have to return an java.util.iterator. -W On 10/03/2012, Hunter McMillen mcmil...@gmail.com wrote: I am receiving the error in the subject line when one of my

Re: JESS: [EXTERNAL] question on sorting

2012-03-06 Thread Wolfgang Laun
This will not improve efficiency but here's a single rule doing the job, at the cost of one additional fact. (deftemplate driver (slot driverId) (slot score) (slot rank)) (deftemplate rover (slot rank)) (defrule rank-drivers ?d - (driver (score ?s1) (rank nil)) (not (driver (score ?s2:(

Re: JESS: [EXTERNAL] Using tests in query variables

2011-11-23 Thread Wolfgang Laun
Within a (defquery) you use (declare (variables ...)) to specify query parameters, and the (run-query*) function lets you provide values for them. Usually the condition would have to be part of the query pattern, with only the value being provided by the run-query* parameter. -W On 23 November

[EXTERNAL] Re: JESS: Ignore slots when matching lhs of rules

2011-11-11 Thread Wolfgang Laun
You need not worry about the object fields you don't care about when matching the unit fact in a rule. By definition, only slots used in the pattern matter; all others are literally don't care. -W On 11 November 2011 04:57, Hunter McMillen mcmil...@gmail.com wrote: Hi everyone, I am trying

Re: JESS: Is it possible to bind a Java object directly to a Jess variable without creating a new object?

2011-11-07 Thread Wolfgang Laun
I daresay, not all of us use the same terms for the same things ;-) I'll use Pojo for a Java object; it contains data in named fields. I'll use Fact for an entitiy that has been inserted into Jess' Working Memory; it contains data in named slots. And then, there is a shadow fact, which is a fact

Re: JESS: Find the minimum

2011-08-24 Thread Wolfgang Laun
Not sure whether this meets all the possibly undisclosed requirements, not sure about the relation of row numbers and words, but this is firing one, even when there is words from more than one page: (defrule find-lines-per-block-ssn ?w1 - (word (page ?page) (rowNumber

Re: JESS: Find the minimum

2011-08-23 Thread Wolfgang Laun
What makes one word different from another one? Surely *you* know (but *we*don't), and this must be a constraint in that rule. If it is the rowNumber, than this condition would be logically correct: (rowNumber ?rowNumber2 :( ?rowNumber1 ?rowNumber2)) although it were better written as

Re: JESS: multiple bindings of a multislot

2011-08-16 Thread Wolfgang Laun
...@sandia.gov] On Behalf Of Wolfgang Laun Sent: Sunday, August 14, 2011 2:30 PM To: jess-users Subject: JESS: multiple bindings of a multislot Given (deftemplate Temp (multislot m)) Cursory tests seem to indicate that a Temp pattern may be written

JESS: multiple bindings of a multislot

2011-08-15 Thread Wolfgang Laun
Given (deftemplate Temp (multislot m)) Cursory tests seem to indicate that a Temp pattern may be written with just a single set of clusters consisting of '?', '$?' and their named cousins. As an example, it's possible to write (Temp (m $? one two $?)) but not (Temp (m $? one two $?)(m

JESS: Is there a better Jess equivalent for pack.age.MyClass.class?

2011-08-10 Thread Wolfgang Laun
If there's an object of a class around, one can do (?obj getClass). Given only the class name, the only thing I can think of is (call Class forName pack.age.MyClass) which can be wrapped into a deffunction but still needs the full class name as an argument. There's no static field class in a

Re: JESS: Getting asserted fact from Activation object in JessListener

2011-08-04 Thread Wolfgang Laun
You can listen for JessEvent.DEFRULE_FIRED events. Any successive JessEvent.FACT events (up to certain other events) are assert results executed on the RHS of that rule. -W On 4 August 2011 02:30, Dwight Hare d.h...@paritycomputing.com wrote: In my JessListener I looked at all of the facts

Re: JESS: Time-varying methods inside a and in a test

2011-07-19 Thread Wolfgang Laun
(and) does a short-circuited evaluation of its operands, but it is still a single CE. Whether it returns false due to the first or second operand does not matter: it'll have to be reevaluated over and over again. Using two boolean functions in two different CEs may result in less invocations of

Re: JESS: Time-varying methods inside a and in a test

2011-07-19 Thread Wolfgang Laun
It would be interesting to see these functions. Basically I'm inclined to believe that this is not possible without some weird side effect achieved by one of the functions. -W On 18 July 2011 19:42, Skeptic . skeptic2...@hotmail.com wrote: r1 is fired, r1b is not (which is the desired

Re: JESS: reasoning about Jess Rules

2011-07-07 Thread Wolfgang Laun
You can access objects of class Defrule using the API. Methods getNActions() and getAction( int i ) let you retrieve all the actions, which are of type Funcall. You can create facts from this information. And then? How do you intend to reason over these facts? Even the simple task of determining

Re: JESS: question about writing rule that is based on comparing the number of one kind of facts and that of another

2011-07-07 Thread Wolfgang Laun
On 7 July 2011 08:25, Felix Chan chanfe...@gmail.com wrote: Hi, I am trying to find a way to write a rule that is based on comparing the number of one kind of facts and the number of another kind. I am sure experienced JESS users Actually, Ernest has seen it a long time ago, and therefore

Re: JESS: question about writing rule that is based on comparing the number of one kind of facts and that of another

2011-07-07 Thread Wolfgang Laun
On 7 July 2011 08:25, Felix Chan chanfe...@gmail.com wrote: Hi, I am trying to find a way to write a rule that is based on comparing the number of one kind of facts and the number of another kind. I am sure experienced JESS users Actually, Ernest has seen it a long time ago, and therefore

Re: JESS: Complex Event Processing

2011-03-15 Thread Wolfgang Laun
On 15 March 2011 02:17, Socrates Frangis soc.fran...@gmail.com wrote: The CEP functionality used by other Expert Systems is just managing the time slice and managing that information distro to Rete. Unfortunately some other expert systems that advertise CEP tend to bundle the feature list

Re: JESS: Complex Event Processing

2011-03-14 Thread Wolfgang Laun
But this is not a Rete issue. Rete is about managing facts for rules containing patterns that result in boolean values. You can invent any number of relational operators; they are just frontent syntactic sugar where otherwise you have to use a call to a boolean function. -W On 14 March 2011

Re: JESS: Defrule bind get-member crashes: Bad slot value at token '('.

2011-03-08 Thread Wolfgang Laun
As the message says: children is some Java thing, but not a Jess list. (A Java array would map to a Jess list.) Use the Java method for testing membership: ( test ( (?container getChildren) contains ?property) ) -W On 8 March 2011 03:16, Jevon Wright je...@jevon.org wrote: Hi all, Thanks

Re: JESS: Jess Access Control

2011-01-08 Thread Wolfgang Laun
On 8 January 2011 02:30, Ernest Friedman-Hill ejfr...@sandia.gov wrote: On Jan 7, 2011, at 8:06 PM, Michael Eugene Artz wrote: public Profile getProfile(int profileNumber) { //return new Profile(1, Mike, Artz); return (Profile)profiles.get(new Integer(profileNumber)); } Which is

Re: JESS: Re: calculating benefit costs

2011-01-08 Thread Wolfgang Laun
All the pundits advocate to put the decision logic into the LHS. Opinions vary a little wrt. to the use of static facts to reduce the number of rules. Some say, The more rules the merrier. I feel that using static facts for lookup of data is justified, considering this: - Fact data is easier

JESS: Re: calculating benefit costs

2011-01-07 Thread Wolfgang Laun
. If ?rel is nil, it's employee, else it's spouse. So ?objP is my covered person (either spouse or employee). On Wed, Jan 5, 2011 at 3:36 PM, Wolfgang Laun wolfgang.l...@gmail.comwrote: With this kind of problem, there are (at least) two approaches. Given that Employee and Spouse are represented

JESS: Re: calculating benefit costs

2011-01-05 Thread Wolfgang Laun
) ) HTH Wolfgang On 5 January 2011 22:30, Wolfgang Laun wolfgang.l...@gmail.com wrote: Sent on behalf of Derek Adams: Hey Jess Users! This is my first post, so I apologize for anything noob that I say/do... I'm very new to Jess. I understand the basics but applying my knowledge

Re: JESS: Hello To Jess User Group and How Is Jess Doing?

2010-12-30 Thread Wolfgang Laun
At this time of the year, on the northern hemisphere, it's more likely to be a white hole. Just wait until the thaw sets in ;-) -W On 30 December 2010 20:02, Donald Paul Winston satchwins...@yahoo.comwrote: I think the mailing list is on vacation for the holidays. I sent one message a

Re: JESS: Is the mail server working over the holidays?

2010-11-28 Thread Wolfgang Laun
On 28 November 2010 17:27, Donald Winston satchwins...@yahoo.com wrote: Is the Jess Users' mail server working over the holidays? I don't see some recent posts. Computers don't go on vacation. The way they sometimes behave, I think they ought to! -W Donald Paul Winston

Re: JESS: representation of deftemplate from deffacts

2010-11-22 Thread Wolfgang Laun
You are mixing technical issues with questions about fact representation. Technically, the internal structure of an ordered fact is *defined* to be close to that of an ordered fact and the slot name __data just happens to be the stand-in for the (from a user's point of view) anonymous single

Re: JESS: multislot pattern matching using accumulate

2010-11-22 Thread Wolfgang Laun
What about storing the list in another slot of variables? Also, the accumulate could be replaced by a Lisp function (filter) called in the consequence, the likes of which you might have seed in your lisping days. If you feel reckless, the actual filter can be passed in as a lambda. -W On 21

Re: JESS: multislot pattern matching using accumulate

2010-11-22 Thread Wolfgang Laun
)) = (bind ?errors (filter-out ?*varok* $?variables)) (modify ?dataset (errors ?errors) (has-errors ( (length$ ?errors) 0) )) ) (reset) (run) (facts) -W On 22 November 2010 16:12, Wolfgang Laun wolfgang.l...@gmail.com wrote: What about storing the list in another slot

Re: JESS: Modules

2010-11-11 Thread Wolfgang Laun
On 11 November 2010 07:13, Donald Winston satchwins...@yahoo.com wrote: I've got over 25 rules now and am looking at organizing them using modules the way I use to with Blaze's rule sets. If I do this then do I have to prefix all my fact references in my rules with MAIN::? No, see the Jess

Re: JESS: Modules

2010-11-11 Thread Wolfgang Laun
the java api and not inside the rule file. I'd prefer not to do this. On Nov 11, 2010, at 8:36 AM, Wolfgang Laun wrote: This (focus) call may not have to be in a rule, it can be done before calling (run). Donald Paul Winston satchwins...@yahoo.com

Re: JESS: Jess clp, JessML and Strings with embedded XML

2010-10-04 Thread Wolfgang Laun
Perhaps using the alternative CDATA representation is possible? value name=data![CDATA Values version=2.0 value name=xmlset in cell /value /Values ]]/value -W On 1 October 2010 18:10, Nguyen, Son son.ngu...@softwareag.com wrote: Hi I ran into an

Re: JESS: Setting slot values using Java api

2010-09-22 Thread Wolfgang Laun
You can't construct a Value with a type RU.ANY. If the Slot doesn't provide the information, you'll have to obtain this information from elsewhere; in getJessValue you have the value as a String, and no other information. With a String being passed to the Value constructor, you have the options

Re: JESS: ordered facts slotName=__data and slotType = ?

2010-09-21 Thread Wolfgang Laun
Slot types may be given in a deftemplate, but they aren't enforced; they are just for documentation (or for your good use in an application - you could do some type checking). Values are typed, though; so what you find in a slot may need closer inspection. -W On 21 September 2010 09:52, Donald

Re: JESS: RE: Cross post from the CLIPS user group - k closest partial matches

2010-09-20 Thread Wolfgang Laun
IIRC from my dallyings with Jess, and assuming that the facts and rules in question are all following the same simple model as the presented ones: iterate over all facts in WM and create a set S of fact names with existing facts. iterate over all rules in Rete.listDefrules() iterate over its

Re: JESS: Lisp is maddening

2010-09-18 Thread Wolfgang Laun
On 18 September 2010 15:38, Ernest Friedman-Hill ejfr...@sandia.gov wrote: That's extremely close; the only problem is on the last line of the defglobal: (?hash-set) is an attempt to call the function whose name is in ?hash-set. That's not a function name, it's a map, so it doesn't work (the

Re: JESS: No Fact-getSlotNames() method?

2010-09-15 Thread Wolfgang Laun
You can get the Deftemplate from Fact, and the slots from that. -W On 15 September 2010 06:40, Donald Winston satchwins...@yahoo.com wrote: Oops, I just found a road block. How come there's no Enumeration getSlotNames() method for the Fact class? Is there any other way to get these? The only

Re: JESS: Retrieving slot and multislot values

2010-09-15 Thread Wolfgang Laun
On 15 September 2010 17:17, Donald Winston satchwins...@yahoo.com wrote: engine.getGlobalContext() ?? I thought this was just for global variables. It's for defglobals and variables bound at the outermost level. But Jess is subject to scoping, where an inner scope may introduce an name not

Re: JESS: Rule Translators?

2010-08-30 Thread Wolfgang Laun
On 30/08/2010, p...@agh.edu.pl p...@agh.edu.pl wrote: Please note that I never intended to say that RIF core is RuleML (still can't see where that could be mixed up). My apologies if I did. My remark was not directed at anything specifically, its a general statement. Sorry! -W For the

Re: JESS: Good grief

2010-08-16 Thread Wolfgang Laun
On 16 August 2010 05:37, Donald Winston satchwins...@yahoo.com wrote: I guess you got to use toArray and as-list all the time for any kind of array. Not quite. And the remaining todo's can be nicely abstracted into a couple of deffunctions for doing the puts and gets: (deffunction putIntoMap

Re: JESS: How do I assert ordered facts from a map

2010-08-15 Thread Wolfgang Laun
, i.e., from WM to a DOM tree. But, here again, I'd investigate the option of building an Object tree (with shadow facts) and use JAXB's marshalling for serializing to XML. -W On Aug 14, 2010, at 2:50 AM, Wolfgang Laun wrote: (eval (str-cat (assert ( ?key ((fetch request-parameter-map) get

Re: JESS: How do I assert ordered facts from a map

2010-08-14 Thread Wolfgang Laun
the initial fact base for the rules. We passed data back to the app the same way after applying the rules. On Aug 13, 2010, at 2:41 PM, Wolfgang Laun wrote: Donald, Assuming you could assert facts from Map.Entry resulting in simple ordered facts such as (key value) you'd still have to adjust

Re: JESS: How do I assert ordered facts from a map

2010-08-13 Thread Wolfgang Laun
Donald, Assuming you could assert facts from Map.Entry resulting in simple ordered facts such as (key value) you'd still have to adjust the rules to each change in the key set. This is usually more demanding than adding another deftemplate. In a map all keys are necessarily distinct. This would

Re: JESS: How to use a Userfunction returning boolean in a LHS of a Jess rule

2010-07-29 Thread Wolfgang Laun
On 29 July 2010 13:24, Ana Rossello Busquet a...@fotonik.dtu.dk wrote: I am designing a java application for energy management. I have an ontology, which I use to save information about the devices (what commands a device has, what is its state (on, off, open close, etc.) among other

Re: JESS: Problem when loading Rule as a String

2010-07-28 Thread Wolfgang Laun
If the String s contains XML, you should use a JessSAXParser. Jesp parses only .clp. -W On 28 July 2010 15:46, Pierre de Leusse p...@agh.edu.pl wrote: Hello all, I receive a Jess rule through the network in XML format and when I try to load it in the Rete engine, it throws an error. I know

Re: JESS: How to trace the work of JESS and illustrate it?

2010-06-10 Thread Wolfgang Laun
You could implement a jess.JessListener, for JessEvent.DEFRULE_FIRED. When this event happens, you have a JessEvent event, and you can Activation act = (Activation)event.getObject(); Defrule rule = act.getRule(); Token token = act.getToken(); int nfact = token.size(); ...rule: +

JESS: defquery revisited

2010-05-20 Thread Wolfgang Laun
In the Jess manual, chapter 7, queries are motivated by a linear search being inefficient. But doesn't the existence of query parameters force the query implementation to do a linear search? (Of course that will, in general, still be more efficient than iterating over *all* WME elements.) If a

Re: JESS: defquery revisited

2010-05-20 Thread Wolfgang Laun
On 5/20/10, Ernest Friedman-Hill ejfr...@sandia.gov wrote: On May 20, 2010, at 9:13 AM, Wolfgang Laun wrote: BUT: you can't provide parameters the way Jess does with this form of query. Oh,but you can! What you describe is just how Jess queries work. When the rule is compiled, an extra

Re: JESS: logical - why is it the way it is?

2010-04-27 Thread Wolfgang Laun
Perhaps it could be done without yet another function, merely by adding a keyword to the (assert fact+) function? I thought of (assert uncond fact+) Other ideas: indep, nodep, firmly (?!) Of course, any of these could be combined with assert- if another function is preferred to a variant. (A

Re: JESS: logical - why is it the way it is?

2010-04-24 Thread Wolfgang Laun
the list, because David's answer shouldn't be lost.] Wolfgang Laun wrote:  (1) Given that logical() may be applied to the initial subset of CE of  some LHS, one might reason that it is the sum of all CEs on the LHS  what implies a fact asserted on the RHS. Is there some (theoretical or  practical

Re: JESS: Real Life Applications

2010-04-24 Thread Wolfgang Laun
Sashi, this is a list for discussing *technical* issues in connection with Jess in particular (and, perhaps, rule based programming in general). If you/your company are in the process of acquiring Jess, your Sales Department should contact Sandia's sales representative for Jess to discuss

JESS: logical - why is it the way it is?

2010-04-23 Thread Wolfgang Laun
Probably only Ernest really knows, but others might have come across a paper discussing this topic; therefore to the list: (1) Given that logical() may be applied to the initial subset of CE of some LHS, one might reason that it is the sum of all CEs on the LHS what implies a fact asserted on the

Re: JESS: defrule from function call

2010-03-01 Thread Wolfgang Laun
You cannot use a variable (userModel) in a rule's CE. (The scope of each rule and the scope surrounding all rules result in distinct evaluation contexts. The inheritance rule of block structured languages does not apply here.) The rule would have to be written to achieve a local binding, within

Re: JESS: Timer on JESS

2010-02-11 Thread Wolfgang Laun
There are (at least) two ways of doing this. Both rely on a Java thread which will call a method at some given time. Such a class for handling timeouts is not difficult to write, although handling a large number of simultaneously running timeouts efficiently requires a little circumspection. Now,

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

2010-02-02 Thread Wolfgang Laun
If you use Calendar.set, it has two parameters, so you can't use (call ?futureCal set Calendar.HOUR, 8) which has a single string argument. It should be (call ?futureCal set (Calendar.HOUR) 8) Note that static members are imported as Jess functions! And the error you are showing is with

Re: JESS: Rule Maintenance tools - suggestions guidance?

2010-02-01 Thread Wolfgang Laun
One way to go would be to give the rule authors Eclipse, which runs everywhere Java does, and with the plugin coming with Jess, which should help the Experts with editing basics. There are Eclipse plugins for a number of CM tools, I know of, or have used CVS, subversion and ClearCase. References

Re: JESS: Re: Mysterious behavior when using Java5 enums in Jess

2009-12-02 Thread Wolfgang Laun
You must parenthesize *every* reference to an enum constant; otherwise they'll be considered being plain symbols. If this causes you parenthesitis retinae, you may find http://www.jessrules.com/jesswiki/view?BindEnumUserFunction useful, as it binds enums to variables, so you can omit the

Re: JESS: Multiple shadow facts

2009-11-29 Thread Wolfgang Laun
On Sun, Nov 29, 2009 at 1:40 AM, Marco Zappatore marcozappat...@libero.itwrote: Dear JESS users, I'm working with shadow facts and my question is the following: let's suppose I have 3 java beans 1) A (with slot sA) 2) B (with slot sB) 3) C the type for the sA slot is the java bean B

Re: JESS: XMLPrinter and class loading.

2009-11-17 Thread Wolfgang Laun
Given that JessML doesn't represent the X in (deftemplate (declare ...(from-class X)...)...) any more but only the results from reflection-analysis of that class X, I'm not sure that it would be possible without changing JessML. -W On Mon, Nov 16, 2009 at 9:09 PM, Ernest Friedman-Hill

Re: JESS: defquery parameters

2009-11-16 Thread Wolfgang Laun
As a workaround, you can use a lambda for smuggling the list into the query: (bind ?eq-pqr (lambda (?arg) (return (eq (list p q r) ?arg))) ) (defquery q1 (declare (variables ?pa ?lam)) (myfact (a ?pa) (b ?b) (c $?v :(?lam $?v)) ) ) -W On Fri, Nov 13, 2009 at 7:04 PM, Ernest Friedman-Hill

Re: JESS: defquery parameters

2009-11-16 Thread Wolfgang Laun
)) Ah, the beauty of Lisp ;-) -W On Mon, Nov 16, 2009 at 8:45 AM, Wolfgang Laun wolfgang.l...@gmail.comwrote: As a workaround, you can use a lambda for smuggling the list into the query: (bind ?eq-pqr (lambda (?arg) (return (eq (list p q r) ?arg))) ) (defquery q1 (declare (variables

Re: JESS: Jess Unit Testing

2009-11-14 Thread Wolfgang Laun
You can create a Rete object and feed it with rules and facts from Java code. So you could use JUnit to test individual rules with different fact combinations. I see no reason why this should not give you satisfactory results. Also, notice that the Rete mehod eval lets you pass gobs of CLP to a

Re: JESS: Intermittent error: Nested exception is null

2009-11-13 Thread Wolfgang Laun
, at 09:15, Wolfgang Laun wrote: Without any information about your facts (shadow or not) and rules only very general suggestions are possible. NPE's may come up when a slot usually holding an object is null and you call a method. Less obvious are cases when a java.lang.Integer (or similar

Re: JESS: Intermittent error: Nested exception is null

2009-11-12 Thread Wolfgang Laun
Without any information about your facts (shadow or not) and rules only very general suggestions are possible. NPE's may come up when a slot usually holding an object is null and you call a method. Less obvious are cases when a java.lang.Integer (or similar) is null and the value is used in an

Re: JESS: How to load a rule file in a remote RMI client.

2009-10-23 Thread Wolfgang Laun
Assuming that JavaSpaces will let you transfer a String, you might try to use a task that creates a jess.Jesp parser object from a StringReader from that String and a Rete, and call parser.parse( false ). All theory, of course ;-) -W On Mon, Oct 19, 2009 at 4:41 AM, ameng m...@hotmail.com

Re: JESS: Re: Test CE

2009-10-15 Thread Wolfgang Laun
The answer to the question is: yes. A ppdefpattern shows that the test is just a trailing appendix of the preceding pattern: (defrule MAIN::related1 (or (and (parent ?z ?x) (parent ?z ?y)) (and (parent ?x ?y)) (and (and (parent ?y ?x) (test

Re: JESS: How to use the accumulate CE?

2009-10-06 Thread Wolfgang Laun
This is my solution: ; satisfying package/location/object combinations (deftemplate fit (slot package-name)(slot location)(slot object)) ; create the fits (defrule sat1 (pkg (package-name ?p)(location ?l)(boxes $? ?b $?)) (box (id ?b) (objects $? ?o $?)) (satisfies-need (box ?b)

Re: JESS: how to dumping rules ?

2009-09-02 Thread Wolfgang Laun
(rules) just prints, returning nil. (foreach ?v (explode$ (ppdefrule *)) (ppdefrule ?v)) -W On Wed, Sep 2, 2009 at 11:25 AM, jo etaoi...@yahoo.com wrote: Hi I tried to dump the rules loaded at some point in time as follows but it did not work out... I do not know the names beforehand and

Re: JESS: how to dumping rules ?

2009-09-02 Thread Wolfgang Laun
On Wed, Sep 2, 2009 at 1:55 PM, Wolfgang Laun wolfgang.l...@gmail.comwrote: (rules) just prints, returning nil. This is correct. (foreach ?v (explode$ (ppdefrule *)) (ppdefrule ?v)) This is nonsense, -W

Re: JESS: scalability issues

2009-08-26 Thread Wolfgang Laun
Hi, this is a nice application. I took some time reading the rules, and I've come up with the remarks below. I invite others to check me out, especially on #5. #1 Rule assert_familiar_5 is a duplicate of assert_familiar_4? #2 Consider combining assert_familiar_1, _2 and _4 into a single rule

Re: JESS: I am planning a rule based programming course on JESS and would appreciate references

2009-08-24 Thread Wolfgang Laun
, write rules ascertaining that the situation is safe: no battleship may occupy a cell that this one of the 8 immediate neighbours of a cell occupied by another battleship. Report violations. -W On Sun, Aug 23, 2009 at 4:34 PM, Wolfgang Laun wolfgang.l...@gmail.comwrote: The Jess wiki contains some

Re: JESS: I am planning a rule based programming course on JESS and would appreciate references

2009-08-23 Thread Wolfgang Laun
The Jess wiki contains some interesting examples, I should mention, since you didn't. Also, you might look at other (public domain) RBS and theit examples. Sometimes you'd have to rewrite (Drools doesn't use CLIPS as a language), sometimes you might be able to take it with perhaps just minor

JESS: Second Call for Submissions to the 2009 Rules Challenge

2009-08-21 Thread Wolfgang Laun
[Our apologies if you receive duplicates of this posting] 3rd International Rules Challenge at RuleML-2009 co-located with the Business Rules Forum November 5-7 2009, Las Vegas, Nevada, USA

Re: JESS: Accessing Java objects fields from a defrule

2009-08-21 Thread Wolfgang Laun
First, you bind to the contained object, and then you locate the containing object. (defrule mydoor ?door - (Door (weight ?weight)(color ?color)) (House (myDoor ?door)(owner Mick)) = (printout t Weight of Mick's door : ?weight crlf) ) Restrictions on weight or color,

Re: JESS: Facts Containing Facts

2009-08-20 Thread Wolfgang Laun
Your rule (not a query) might go like this, if you are using unordered facts: (defrule checkAuthorization (Attempt person ?person)(action ?action)) (Authorization (person ?person)(action ?action)) = (assert (Action (action ?action))) ) Check the manual for the correct syntax for ordered

Re: JESS: Redefining default values in deftemplates

2009-08-03 Thread Wolfgang Laun
On Mon, Aug 3, 2009 at 5:48 PM, Henrique Lopes Cardoso h...@fe.up.pt wrote: Is there a simpler way of doing this, e.g. by changing the deftemplate directly? Not yet, but asking Ernest to add a Deftemplate.setSlotDefault( Value default ) might simplify it cosiderably ;-) -W

Re: JESS: Iteration over list

2009-07-29 Thread Wolfgang Laun
-Hill ejfr...@sandia.govwrote: I think you can replace all occurrences of id with parent, removing the redundant parent reference in the first fact. On Jul 28, 2009, at 1:35 PM, Wolfgang Laun wrote: Sorry, where I have name in depends-on, that was meant to be your slot children

Re: JESS: strings and quoting

2009-07-29 Thread Wolfgang Laun
-- *From:* Wolfgang Laun wolfgang.l...@gmail.com *To:* jess-users@sandia.gov *Sent:* Tuesday, July 28, 2009 7:39:47 PM *Subject:* Re: JESS: strings and quoting How can we read your mind? I tried Tarot cards, a Crystal Ball and ESP, but somehow... Kindly show an example of Jess

Re: JESS: Test and query on LHS of rule

2009-07-29 Thread Wolfgang Laun
Assuming that you have another deftemplate representing papers: (deftemplate paper (slot author ) (slot number)) you could do away with the query and test CE and write a truly declarative rule2: (defrule rule2 (paper (number ?number)) ?c - (accumulate (bind ?list (new

Re: JESS: Iteration over list

2009-07-28 Thread Wolfgang Laun
It would be easier to detect a depends-on where the available-part would be missing for one of its name list elements. As it stands now, you'll need an identifier for depends-on so that the binding into the not (via ?x) is possible. (defrule every-subtask (depends-on (id ?x)(parent ?a)) (not

Re: JESS: Iteration over list

2009-07-28 Thread Wolfgang Laun
)(name ? ?n ?)) (available-part (name ?n))) = (assert (available-part (name ?a))) ) On Jul 28, 2009, at 10:53 AM, Wolfgang Laun wrote: It would be easier to detect a depends-on where the available-part would be missing for one of its name list elements. As it stands now

Re: JESS: strings and quoting

2009-07-28 Thread Wolfgang Laun
How can we read your mind? I tried Tarot cards, a Crystal Ball and ESP, but somehow... Kindly show an example of Jess or Java code, what it prints and what you expect it to do. -W On Tue, Jul 28, 2009 at 5:22 PM, jo etaoi...@yahoo.com wrote: Hi everybody, I am wrestling with strings in

Re: JESS: Query Problem

2009-07-24 Thread Wolfgang Laun
If you want to use fact references as slot values you'll have to assert the family facts algorithmically, i.e., not from within a deffacts. Matching via fact references requires you to match a fact to obtain the binding to a fact references, and then you can use the bound variable in a subsequent

JESS: 3rd International Rules Challenge - Call for Submissions

2009-07-19 Thread Wolfgang Laun
[Our apologies if you receive duplicates of this posting] Call for Submissions 3rd International Rules Challenge at RuleML-2009 co-located with the Business Rules Forum November

JESS: Final reminder: RuleML 2009 Submission Deadline

2009-06-27 Thread Wolfgang Laun
RuleML 2009 3rd International Symposium on Rules, Applications and Interoperability November 5-7 2009, Las Vegas, Nevada, USA http://2009.ruleml.org/ co-located with the 12th Business Rules Forum

Re: JESS: infinite loop again

2009-05-29 Thread Wolfgang Laun
The rules make sense if I assume that there is one Tumor object for each distinct value of disName, with the diagnostic weight factors. So, one (new) TumorPatient object will match each of the Tumor objects and determine the percentage of that disease. The loop results from each rule modifying,

Re: JESS: infinite loop of slot-set

2009-05-19 Thread Wolfgang Laun
You define the rule attribute no-loop as TRUE: (defrule *rule-name* (declare (no-loop TRUE)) ... -W On Mon, May 18, 2009 at 9:54 PM, Rose S black_rose...@yahoo.com wrote: Hi there, How should I avoid of infinite loop using slot-set function in the RHS of a rule? Thanks Rose

JESS: 2nd CFP RuleML-2009 - 3rd International Symposium on Rules, Applications and Interoperability

2009-05-13 Thread Wolfgang Laun
Golan, DBMind, USA RuleML Challenge Yuh-Jong Hu, National Chengchi University, Taiwan Ching-Long Yeh, Tatung University, Taiwan Wolfgang Laun, Thales Rail Signalling Solutions GesmbH, Austria RuleML 2009 Sponsors

Re: JESS: JSR-94 and JessListener

2009-05-08 Thread Wolfgang Laun
Harsh words have been said about JSR-94, which I won't repeat here. One advice to give here is that you might design your own interface to maintain potential portability to some other rule based system. -W 2009/5/8 Henschel, Jörg j.hensc...@itcampus.de I'm trying to use Jess in a JSR-94

Re: JESS: Jess questions

2009-05-06 Thread Wolfgang Laun
Jess will handle memory just like any well written Java program does. You should not load facts that aren't necessary for your rules. The way the rule emgine forms the in-memory network depends on your rules. The best practice of writing good rules depends on your application. But, as a general

Re: JESS: jess Query?

2009-04-30 Thread Wolfgang Laun
You'll have to run the second query search-by-systeme4 once for each element in the result vector of your first query. Either process the results of the second query search-by-systeme4 batch by batch, or collect them in some list or collection. Your (while...) does return something, but it's

Re: JESS: Problem with test function

2009-04-30 Thread Wolfgang Laun
You might omit the (create$) calls just for passing arguments to check() as they create unnecessary overhead. -W On Thu, Apr 30, 2009 at 1:00 PM, bohlken wilfried.bohl...@informatik.uni-hamburg.de wrote: Hello, thank you for your answer. I think I now found out the right solution. The

  1   2   3   >