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: breaking loops broken

2007-06-11 Thread Wolfgang Laun
no higher level to return to. But thanks for the report -- return should just be equivalent to break when called in a context like this, so this should be fixed. On Jun 11, 2007, at 3:42 AM, Wolfgang Laun wrote: Jess Version 7.0p1 12/21/2006 Using return to break a (for) or (foreach

Re: JESS: Weighted facts

2007-06-12 Thread Wolfgang Laun
Andrei Boutyline wrote: A third approach is to allow multiple instances of the same feature, but have a high-salience rule that sits around and waits for the existence of two instances of the same feature, and then retracts them and restates one feature with a combined weight; my gut feeling is

JESS: Another rule that doesn't fire

2007-06-27 Thread Wolfgang Laun
In the program below, Jess will only fire the second rule if both are uncommented, but each of them fires if the other one isn't there. If the order of rule definitions is reversed, the second one wins again. Jess Version 7.0p1 Kind regards Wolfgang (clear) (deftemplate Obj (slot id

Re: JESS: Another rule that doesn't fire

2007-06-27 Thread Wolfgang Laun
it; and indeed, if you move your reset to after the rules are defined, they both fire correctly. Thanks for the report; we'll look into this further and get it fixed. On Jun 27, 2007, at 10:34 AM, Wolfgang Laun wrote: In the program below, Jess will only fire the second rule if both

Re: JESS: Help: OutOfMemory problem

2007-06-28 Thread Wolfgang Laun
Not knowing the details, I can only quote divide and conquer. If the sets of facts (F) and rules (R) can be divided so that F = union(F1, F2,... Fn) and R = union(R1, R2,...Rn) and these may be paired to run as F1/R1,...Fn/Rn then you might be able to process even bigger Java programs.

Re: JESS: Another rule that doesn't fire

2007-06-28 Thread Wolfgang Laun
includes a default of false for a boolean slot. Due to case sensitivity, the default should probably be FALSE. OK, but not relevant for the problem. (I've changed things as compared to the original source.) -W Bob Kirby At 08:39 AM 6/27/2007, Wolfgang Laun wrote: Perhaps

Re: JESS: Re: Real deftemplate of extended fact - Solved it!

2007-06-29 Thread Wolfgang Laun
This Userfunction is another way of getting the deftemplate name of some fact: http://herzberg.ca.sandia.gov/jesswiki/view?GetTemplateUserFunction HTH Wolfgang Henrique Lopes Cardoso wrote: Hi, Just to let you know that I solved my own problem. I had not realized that with a query like

JESS: Announcing wiki contributions

2007-07-03 Thread Wolfgang Laun
(LambdaCall), * accessing facts (AsBean, GetTemplate), * timer functions (AfterEvery) and * miscellaneous (WhatIs). Any comments (critique, suggestions for improvement,...) more than welcome. Kind regards Wolfgang Laun

Re: JESS: Announcing wiki contributions

2007-07-05 Thread Wolfgang Laun
On 7/3/07, Wolfgang Laun [EMAIL PROTECTED] wrote: There are some recent contributions to the topic Design Patterns on the Jess Wiki (http://www.jessrules.com/jesswiki/view). And here's FactsAsSlotValues, another design pattern. Given the right data, it may be used to answer questions

Re: JESS: Problem with bload and System functions

2007-07-07 Thread Wolfgang Laun
I can reproduce that error with Foo and Bar, running Jess7.1a1, due to some null pointer exception in the eval. But the documentation for the Jess function call says: The functor call may be omitted if the method being called is non-static. I guess that means that the call, as tried by Henrique,

Re: JESS: Problem with bload and System functions

2007-07-07 Thread Wolfgang Laun
Here is another check on the effect of bsave/bload. I define this function: (deffunction ppallfunctions () (bind ?sb (new StringBuffer)) (bind ?it ((engine) listFunctions)) (while (?it hasNext) (bind ?f (?it next)) (bind ?class (call ?f getClass)) (?sb append ?class) (?sb

JESS: An inconsistency between listFunctions() and PrettyPrinter()

2007-07-07 Thread Wolfgang Laun
This is surprising: (deffunction ppallfunctions () (bind ?sb (new StringBuffer)) (bind ?it ((engine) listFunctions)) (while (?it hasNext) (bind ?f (?it next)) ;; The following call isn't possible because the intrinsic functions ;; don't implement jess.Visitable, and the only

Re: JESS: Problem with bload and System functions

2007-07-07 Thread Wolfgang Laun
The same problem occurs when running bin/jess, and (most likely) with any other of the import-ed things. Statics of some classes are automatically (imports are in jess/scriptlib.clp) defined as functions, and that's why there are some exceptions to the rule stated in the documentation on

Re: JESS: Defmodule vs. defrule

2007-07-23 Thread Wolfgang Laun
Isn't a (defmodule X) just a way of setting the default namespace for templates, facts, queries and rules? This, then, means that the execution of a (defmodule X) doesn't really imply that a module has come into existence. (Or does it create an empty module X and does (focus X) achieve

JESS: Who needs class as a slot in a shadow fact?

2007-07-24 Thread Wolfgang Laun
After Jess (deftemplate Signal (declare (from-class at.laune.jess.Signal))) TRUE Jess (ppdeftemplate Signal) (deftemplate MAIN::Signal \$JAVA-OBJECT$ at.laune.jess.Signal\ (declare (from-class at.laune.jess.Signal))) Jess (bind ?f1 (assert (Signal))) Fact-1 Jess (facts) f-0

Re: JESS: Who needs class as a slot in a shadow fact?

2007-07-25 Thread Wolfgang Laun
Ernest Friedman-Hill wrote: On Jul 24, 2007, at 12:17 PM, Wolfgang Laun wrote: we see that the fact includes a slot class, inherited from Object . Why is this not suppressed? It never has been. Although I don't think the class property is *extremely* useful, I could certainly come up

Re: JESS: Java 1.5 enums

2007-07-27 Thread Wolfgang Laun
To match a slot with the result or a method call, prefix the call with an equal sign: (MyShadowFact (OBJECT ?o) (property1 =(MyEnum.xyz))) krW On 7/27/07, Krasnigor, Scott L (N-AST) [EMAIL PROTECTED] wrote: I believe you need to surround the enum with ( ), e.g. (property1

Re: JESS: No rules firing

2007-07-31 Thread Wolfgang Laun
One might very well argue that the automatic definition of a template for ordered facts, as in (defrule r (t 1 ?two) = ... ) or any fact definition is somewhat dangerous since it might cover up anything from a simple typos to a major syntax error. Adding the option of suppressing the

Re: JESS: query distinct values of a slot

2007-08-03 Thread Wolfgang Laun
Two solutions. (A) You define a query: (defquery personQuery (person (firstName ?fn)(lastName ?ln)(age ?age))) The Jess function values-of runs the query and processes the result, collecting the values of the result component with the name given as the function argument name into the list

Re: JESS: Constraining values of a slot

2007-08-08 Thread Wolfgang Laun
To at least *detect* bad slot values consider setting up suitable rules that throw an exception, or whatever. The task of generating these straightforward rules can be automated with a userfunction. You might then, for instance, write (deftemplate SrcTemp (slot destFact)) (deftemplate

JESS: multislot matching and binding

2007-08-19 Thread Wolfgang Laun
Is it correct that it isn't possible to bind the entire value of a multislot to a variable *and* use some list pattern to restrict the facts at the same time? Consider: (deftemplate AE (multislot ae)) (deffacts facts (AE (ae a b c d e)) (AE (ae b c d e a)) (AE (ae e d c b a)) )

Re: JESS: Java objects

2007-08-20 Thread Wolfgang Laun
Noël Huebers wrote: Hi, I'm new to the Jess language and have some questions. 1. I work with Java object. I stored them in Jess with store and assert/fetch commands. But I could not call there member in the lhs of my rule. No function calls allowed, right? So, for every object I made a rule

Re: JESS: Java objects

2007-08-22 Thread Wolfgang Laun
Noel Huebers wrote (defquery searchcontext (declare (variables ?name ?task ?val)) (context (username ?name) (action Bewertet) (task ?task) (value ?val))) Now I want to delete the some facts. How do I get a fact from the queryresult '?result' ?

Re: JESS: Rules firing only once

2007-08-27 Thread Wolfgang Laun
Another solution to your problem could be based on a deftemplate Category which is used for finding a group of experts. Experts' facts are kept in a linked list used for assigning another expert for every new problem. (The code assumes that one expert is servicing only one Category, but this

Re: JESS: Jess JessTab protege

2007-09-11 Thread Wolfgang Laun
velven wrote: Hi everyone, I'm new to Jess and I have some questions 1) I'm using (mapclass) to map my protege classes into jess, but I found What is (mapclass), please? that the function maps all userdefined slots to be multislots although i have set them to be required single

Re: JESS: Jess JessTab protege

2007-09-13 Thread Wolfgang Laun
velven wrote: Is this due to the way i have written my rule such that for each agent, atleast (:X-coordinate ?x2:(= 1 (abs (- ?x2 ?x1 had to be checked by jess with another 199 agents? or something else? welcome any suggestions to optimise, Thank you for your time Forget my doubts

Re: JESS: How can I write this rule?

2007-10-18 Thread Wolfgang Laun
Nicolas Fortin wrote: Hello everybody, Suppose that I have the following template: (deftemplate MAIN::My-Template (slot id (type INTEGER)) (slot index1 (type INTEGER)) (slot index2 (type INTEGER))) I want a rule that would be activated by the fact with the greatest index1

Re: JESS: Java and Jess: Hashtable etc.

2007-10-20 Thread Wolfgang Laun
Hello Waschtl, Neither the code snippets nor the explanations you provided indicate what sort of facts you want to process with your rules, so I'm using classes of my own, which describe the facts I'm going to use: public class Song { private String myTitle; private String myAuthor;

Re: JESS: How can I write this rule?

2007-10-21 Thread Wolfgang Laun
On 10/21/07, Robert Kirby [EMAIL PROTECTED] wrote: If you want to consider only enabled instances, (defrule CP::enabled-example-rule Enabled My-Template with the greatest index1 and among those enabled with the smallest index2. (My-Template (id ?id) (enabled TRUE) (index1 ?index1)

Re: JESS: How can I write this rule?

2007-10-22 Thread Wolfgang Laun
of (matches MAIN::Station-3-Rule) function call (Matches.txt). Sorry for giving a lot of details. I rather like to give smallest example but I am not able to reproduce the problem. Any help or advice that could help me to debug this rule would be appreciate. Regards, Nicolas. Wolfgang Laun-2 wrote

Re: JESS: Is this feature available in Jess?

2007-10-24 Thread Wolfgang Laun
The first way proposed by Ernest can be implemented in a Userfunction. See http://herzberg.ca.sandia.gov/jesswiki/edit?FactOnFiring With some rule A and a deftemplate FiredA you call the function (fact-on-firing A FiredA) Using FiredA in some other rule should give you the desired behavior.

Re: JESS: Is this feature available in Jess?

2007-10-24 Thread Wolfgang Laun
The better link to the Userfunction is http://herzberg.ca.sandia.gov/jesswiki/view?FactOnFiring Sorry -W On 10/24/07, Wolfgang Laun [EMAIL PROTECTED] wrote: The first way proposed by Ernest can be implemented in a Userfunction. See http://herzberg.ca.sandia.gov/jesswiki/edit?FactOnFiring

JESS: Avoiding slot class in shadow facts

2007-10-25 Thread Wolfgang Laun
Deriving a deftemplate from a Java class with, e.g., (deftemplate Account (declare (from-class Account))) invariably adds a slot class, due to getClass() inherited from java.lang.Object. If you want to get rid of this, see the Jess userfunction I've added to the Jess Wiki:

Re: JESS: Avoiding slot class in shadow facts

2007-10-25 Thread Wolfgang Laun
of course an Eclipse-specific version would also be possible.) On Oct 25, 2007, at 12:01 PM, Wolfgang Laun wrote: Deriving a deftemplate from a Java class with, e.g., (deftemplate Account (declare (from-class Account))) invariably adds a slot class, due to getClass() inherited from

JESS: multislot and its alternatives

2007-10-30 Thread Wolfgang Laun
Recently, on this list, there was a question about how to find a pair of facts ?a and ?b (of templates A, B) where multislot ?a.props contains element ex and multislot ?a.props contains element ey. The posting did not include sufficient information about the nature of the values stored in the

Re: JESS: Pattern matching nested objects

2007-11-01 Thread Wolfgang Laun
Darrel Davis wrote: I am a real newbie having some difficulty understanding how I would test/access nested Java objects from the LHS of a rule. Given the following declarations: (deftemplate AgreementVO (declare (from-class AgreementVO))) (deftemplate HostVO (declare (from-class HostVO))) A

JESS: The JessEvent trap

2007-11-07 Thread Wolfgang Laun
Playing around with Jess Event handling, I've just run into this one: I defined a handler in Jess, using JessEventAdapter, to run a simple deffunction whenever a new fact appears. Tested, works fine. Next, I wrote a more general event handler, in Java, to fire whenever something interesting

Re: JESS: matching problem

2007-11-14 Thread Wolfgang Laun
Or this one which is subtly different: (deftemplate things (slot Id) (multislot elements)) (deftemplate otherthing (slot one_Element)) (defrule FindIt ?ot - (otherthing (one_Element ?el )) ?th - (things (Id ?Id) (elements $? ?el $?)) = (printout t found ?el in ?Id crlf) ) (deffacts

Re: JESS: Forward and Backward chaining

2007-11-20 Thread Wolfgang Laun
I doubt very much that an approach combining forward and backward chaining would simplify matters. Given that we're still discussing the user/systems/resources application: I'd extend the set of rules (including dynamically created ones) so that the system would come up with the info which

Re: JESS: Ranking facts

2007-11-27 Thread Wolfgang Laun
Maybe this is coming close to what you want. ; your fact template (deftemplate Fact (slot id)(slot a)(slot b)(slot c)) ; supposed to contain the rating functions for the slot values (deftemplate Func (slot fa)(slot fb)(slot fc)) ; the computed ranking for a fact (deftemplate Rank (slot r)(slot

Re: JESS: Updating shadow facts from object copies

2007-12-11 Thread Wolfgang Laun
I have understood Will's problem to be within a single Rete object. Basically, the Rete.add() method returns a reference to the created jess.Fact. As a shadow fact in good standing it'll have a slot OBJECT containing a reference to the original Java object. Therefore, the original object is

Re: JESS: Updating shadow facts from object copies

2007-12-13 Thread Wolfgang Laun
to update Rete with the new object. Thanks. -Original Message- From: [EMAIL PROTECTED] [mailto:owner-jess- [EMAIL PROTECTED] On Behalf Of Wolfgang Laun Sent: Tuesday, December 11, 2007 4:48 AM To: jess-users@sandia.gov Subject: Re: JESS: Updating shadow facts from object copies I

Re: JESS: insert data into database in JESS

2007-12-17 Thread Wolfgang Laun
And there is the body of the while loop: (while (?result next) (?statement execute insert into test (persen) values (?result getString y))) which looks strange to me, as the string literal contains (presumably) some SQL statement, where the embedded Jess (?result getString y) may be,

Re: JESS: Floating issue

2008-01-08 Thread Wolfgang Laun
This is not a Jess problem. Using reals for non-atomic monetary units (e.g., dollar, euro, pound) is a no-no. Absolutely. Don't do it. You might turn to integers representing the subunit (e.g., cent or penny or whatever). Or use java.math.BigDecimal. Kind regards Wolfgang Nara Hari wrote:

Re: JESS: Design check - Tempral Issues

2008-01-08 Thread Wolfgang Laun
The Jess Wiki contains a Jess User Function that might be useful: http://herzberg.ca.sandia.gov/jesswiki/view?AfterEveryUserFunction Assuming that, at some point in time, you know that Y should fire within the next minute, you can set up a fact that says expecting Y. (In Y's RHS, you retract

Re: JESS: Java Vector iterator/Application Design issue

2008-01-08 Thread Wolfgang Laun
There is no '=' separating the RHS and the LHS in your rule rule_test. Processing slots containing a java.util.Vector (or a multislot) requires you to write rather complicated rules. It seems that a simple fact that associates, say, a category name with a *single* charge code, and is used

Re: JESS: cost/objective function ?

2008-01-08 Thread Wolfgang Laun
Mohd. Noor wrote: Dear all What is it means by cost or objective function? http://en.wikipedia.org/wiki/Objective_function one more things. How I am going to map (using rules) between two different attributes from users and resources let say user need to run the job and get results in 1

Re: JESS: Jess Casting/ Inheritance

2008-01-14 Thread Wolfgang Laun
Gary Napier wrote: I have an alarm deftemplate derived from my Alarm class. I would like jess to analyse these incoming alarms and highlight the important ones. So the output from jess is Super_Alarm. Both classes share many slots / fields. Now the question. If i have *deftemplate*

Re: JESS: Checking list equality

2008-02-13 Thread Wolfgang Laun
intersection of the two lists have the same length as their union. all best, Szymon - Original Message - From: Wolfgang Laun [EMAIL PROTECTED] To: jess-users@sandia.gov Sent: Wednesday, February 13, 2008 3:16 PM Subject: Re: JESS: Checking list equality You can apply (=) to more than 2

Re: JESS: batch require

2008-02-14 Thread Wolfgang Laun
Jess 71b1: ;;;defclass.clp (deftemplate tempA (slot s1)(slot s2)) (provide Temps) (printout t defclass crlf) ;;;defrule1.clp (require* Temps defclass.clp) (defrule rule1 (tempA (s1 1)) = (printout t fired rule1 crlf) ) (printout t defrule1 crlf) ;;;defrule2.clp (require* Temps defclass.clp)

Re: JESS: Matching on multi-slot length

2008-02-20 Thread Wolfgang Laun
I would not use this rule provided I understood the problem correctly as: Find all facts foo where the length of foo.my-list equals the value of slot foo.desired. The proposed solution does not compare a length with foo.desired, and binding of a multislot vaue should use a variable starting with

Re: JESS: Rules for detecting changes of a multislot

2008-02-20 Thread Wolfgang Laun
While reading the original posting I didn't (and I still don't) see the reason for the rules you're looking for. Somewhere in the system, there must be some action that adds or removes an element from the multislot list (perhaps using (modify)). There you know what is going on, and the old

Re: JESS: Rules for detecting changes of a multislot

2008-02-20 Thread Wolfgang Laun
Martijn Tromm wrote: Lars, With activations and retractions I was thinking about something like this: For every object in (c (m a b c)) assert a separate relation-fact (object ?x) and keep a object-status template-fact for reference. Once an object gets asserted it will be remembered by a

Re: JESS: Matching on multi-slot length

2008-02-20 Thread Wolfgang Laun
Another way (assuming that indeed a pair of facts with equal-length multislots is to be found): (defrule find-eql ?b1 - (bar (list $?l1)) ?b2 - (bar (list $?l2 :(= (length$ $?l1)(length$ $?l2 (test ( ?b1 ?b2)) = (printout t lists $?l1 and $?l2 have equal length crlf) ) This doesn't

Re: JESS: Rules for detecting changes of a multislot

2008-02-20 Thread Wolfgang Laun
PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wolfgang Laun Sent: woensdag 20 februari 2008 15:41 To: jess-users@sandia.gov Subject: Re: JESS: Rules for detecting changes of a multislot Martijn Tromm wrote: Lars, With activations and retractions I was thinking about something like

Re: JESS: Global Variables

2008-02-28 Thread Wolfgang Laun
It's difficult to guess what you tried. Is it similar to this: (defglobal ?*count* = 0) (defrule test-glob (test ( ?*count* 10)) = (printout t exceeds 10 crlf) ) (defrule inc-glob (record) = (++ ?*count*) ) This doesn't work since the test of ?*count* is evaluated only once. Only changes to

Re: JESS: Jess newbie does not know how to ....

2008-03-05 Thread Wolfgang Laun
The object behind the shadow fact is available in the slot OBJECT. Simply bind that slot to a Jess variable: (MC ... (OBJECT ?mcObj)) --- (call ?mcObj setPassed TRUE) If MC is sufficiently beanish you have a slot Passed and can use modify with some variable bound to the fact which will

Re: JESS: Jess newbie does not know how to ....

2008-03-05 Thread Wolfgang Laun
- firstName = (call ?h1 getFirstName) crlf) (printout t Java object 2 - firstName = (call ?h2 getFirstName) crlf) vanhaabe wrote: Still no progress. Can't bind OBJECT, error I'm getting is Undefined function OBJECT. Can you please elaborate to call OBJECT in cpl file. Thanks, E Wolfgang Laun wrote

Re: JESS: Calling a function on all elements in a list

2008-03-10 Thread Wolfgang Laun
Why do you want to avoid foreach which happens to cater for your needs? Just write a simple wrapper (I'll call it apply$) and use it just like (apply): ; a function to be called on each element of a list (deffunction show (?x) (printout t show: ?x crlf) ) ; (apply$ function expression*) ;

Re: JESS: A question about running a java function from jess

2008-03-11 Thread Wolfgang Laun
Or, if both the area and the object are facts in the database, the rule might also be written as (defrule object-inside-are (area {name == restricted area}(OBJECT ?area)) (object (OBJECT ?object : (?area isInside ?object))) = ;; RHS ) This should detect all objects that are inside some

Re: JESS: A question about running a java function from jess

2008-03-12 Thread Wolfgang Laun
it as userFunction? Regards, Joao Mourao Wolfgang Laun wrote: Or, if both the area and the object are facts in the database, the rule might also be written as (defrule object-inside-are (area {name == restricted area}(OBJECT ?area)) (object (OBJECT ?object : (?area isInside ?object

Re: JESS: Managing the firing of rules

2008-04-18 Thread Wolfgang Laun
Matthew, several techniques would be possible. Here are some ideas. Avoid overlap. The not conditional element would be useful. It will, of course, increase the complexity of patterns. Use salience. To quote the Jess User Manual, this is considered bad style, but it is done, nevertheless.

Re: JESS: [JESS]: Removing rules from a session.

2008-05-06 Thread Wolfgang Laun
This Jess snippet will get rid of all your rules and queries (bind ?iter ((engine) listDefrules)) (while (?iter hasNext) (bind ?rule (?iter next)) (undefrule (?rule getName))) If the object returned from the iterator is instanceof Defrule/Defquery it is a rule/query, so you could

Re: JESS: Jess and a magic square

2008-05-07 Thread Wolfgang Laun
There are two tasks to be solved: (1) generate all possible squares and (2) check for magic-ness. Jeff's solution is based on the fact that some square has a certain value, so that the value can be used in one of the 8 sums. For an alternative approach, consider that there are some other facts

Re: JESS: Puzzle 15

2008-05-08 Thread Wolfgang Laun
I have never seen a program for this one in any language. Have you, or anybody else? -W On Thu, May 8, 2008 at 2:39 PM, Senlin Liang [EMAIL PROTECTED] wrote: Dear all, I am trying to solve the puzzle 15 problem using jess, but failed to find a good solution. Is anyone has a ready program for

Re: JESS: Accumulating values in a Variable in JESS

2008-05-09 Thread Wolfgang Laun
On Fri, May 9, 2008 at 3:43 AM, Marcelo Alvarenga Pedrosa [EMAIL PROTECTED] wrote: I need to accumulate the all values obtained by the rules in the same variable, I mean, sum the variable value to another value and storing in the variable. String rule1 = (defrule ruleage; rule1

Re: JESS: Puzzle 15

2008-05-09 Thread Wolfgang Laun
that part up to someone else. -- Dane Wyrick [EMAIL PROTECTED] 402-544-0872 Wolfgang Laun I have never seen a program for this one in any language. Have you, or anybody else? -W On Thu, May 8, 2008 at 2:39 PM, Senlin Liang wrote: Dear all, I am trying to solve

Re: JESS: Linked list / Sorted List Design Pattern

2008-05-10 Thread Wolfgang Laun
As you state it, there is no need to sort all open and close events so that you can combine an OPEN to ist closest CLOSE. The conditions that define, for any OPEN, the matching CLOSE are simple enough: deftemplate Open (slot time)) (deftemplate Close (slot time)) (deftemplate Access (slot

JESS: Jess function : fix documentation or implementation?

2008-05-12 Thread Wolfgang Laun
The Jess manual documents as returning TRUE if the first argument is not equal to all subsequent arguments. It would appear, however, that the function returns TRUE if any two adjacent arguments are not equal. (I can envisage the implementation being a copy of the implementations of , =, , = and

Re: JESS: Classes and Interfaces

2008-05-18 Thread Wolfgang Laun
It is not possible to refer to an interface in the from-class clause of a deftemplate. A class hierarchy including an abstract class can be mirrored as shown below. (deftemplate ClassA (declare (from-class AbstractClassA))) (deftemplate ClassB extends ClassA (declare (from-class ClassB)))

Re: JESS: [JESS]: Refresh rules during runtime.

2008-05-20 Thread Wolfgang Laun
I can see only one solution (besides hacking Jess itself). It would require that the right hand sides of all rules would have to be written as an if statement, with the condition testing some global variable ?*fire*. To update the rules, stop the engine, remove all rules, set ?*fire* to false,

Re: JESS: Ruleml to Jess

2008-05-20 Thread Wolfgang Laun
Well, it looks like a typo, and it is a typo. Just point your browser to http://www.daml.org/2001/02/gedcom-ruleml/jess.xsl kr Wolfgang On 5/20/08, Juan Ondiviela [EMAIL PROTECTED] wrote: I've been searching for a long time for a xsl translator from ruleml to jess rules until I found this

Re: JESS: [Jess] Visual programming.

2008-05-28 Thread Wolfgang Laun
Looking at the Jess Manual's Reference section, you can see the distinctions between (a) Jess Constructs and (b) Jess functions. (a) I can imagine that designing templates and left hand sides (for rules and queries) graphically could be nice to have. Graphics for templates would be very similar

Re: JESS: Maintaining session in JESS

2008-06-25 Thread Wolfgang Laun
Deepak Pol wrote: Now following are some questions I have: 1. Since the rules defined are being applied to any data, I want the rules to be created once and shared by different sessions for different data. For eg there can be a rule which says if total 100 then return list of users u1, u2 and

Re: JESS: How to parse the Conditions ?

2008-06-25 Thread Wolfgang Laun
You have to determine the class of a ConditionalElement (this is an interface for things common to Pattern, Group and Accumulate. If it is a Pattern, you proceed by iterating over the tests, either thos in a particular slot or over all. Add this after your println: if( e instanceof Pattern ){

Re: JESS: Slot name restrictions

2008-07-14 Thread Wolfgang Laun
Are these slot names generated by a program or written by hand? Is there any chance of using %2e instead of a period? According to RFC 2396, this is an alternative representation. Wolfgang On Mon, Jul 14, 2008 at 6:14 PM, Greenblatt, Alan [EMAIL PROTECTED] wrote: I see there is a new

Re: JESS: using annotations

2008-07-17 Thread Wolfgang Laun
I've tried to think up a few annotations as an alternative to the Bean introspection for deriving Jess templates from Java classes. Given that you can use BeanInfo and/or write your own extension of ReflectionClassResearcher I'd say that the extra effort isn't really worth it - unless you could

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: Using count-query-results in a rule LHS

2008-08-27 Thread Wolfgang Laun
On 8/27/08, Jan Willem Lokin [EMAIL PROTECTED] wrote: Wolfgang, One thing in your reply stiil confuses me, which is where you state that you can't limit your asserted tracking-actuals by the number of *either* of those two. From the code it is indeed not immediately clear that the

Re: JESS: Performance question

2008-08-29 Thread Wolfgang Laun
On 8/29/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: (MetricValue (name foo) (group A) (testslot ?A_testslot) ) (MetricValue (name foo) (group B) (testslot ?B_testslot:(similar ?B_testslot ?A_testslot) ) )

Re: JESS: Focus, defmodules through Jess Java API

2008-09-03 Thread Wolfgang Laun
It's Rete.setFocus( String name ) From the Jess side, this call (focus foomodule) is the same as (call (engine) setFocus foomodule) In Java: myRete.setFocus( foomodule ); -W On Wed, Sep 3, 2008 at 12:18 PM, John Chrysakis [EMAIL PROTECTED]wrote: Is there a method through Jess Java

Re: JESS: Dynamic Property Changes - Jess Java API

2008-09-08 Thread Wolfgang Laun
I suggest that you run (ppdeftemplate CurrentEvent) from within your EventRules.clp to see the kind of shadow fact Jess makes from your class. The code is somewhat incomplete (where is the initialization for CurrentEvent.bs?) but I surmise that Jess has a shadow fact with one slot: reading. But

Re: JESS: Reproducing a reasoning path

2008-09-10 Thread Wolfgang Laun
Jess is capable of reflection on rules and other objects. But reflection delivers formal/structural information but no semantic insights. Are you prepared to add meta-facts that would, for instance, define the meaning of (uncleOf a b)? If so, it would be possible to produce the reasoning by

Re: JESS: Replacing Facts

2008-09-11 Thread Wolfgang Laun
Perhaps a wrapper fact with a single slot containing a reference of the actual fact could server as a stable point of reference. That means that the many references in other real facts would remain stable, but, of course, dereferencing becomes more complicated. Only the pointer in the wrapper

Re: JESS: Replacing Facts

2008-09-12 Thread Wolfgang Laun
you Wolfgang, this is a clever idea. I will think about it some more. On Sep 11, 2008, at 10:24 AM, Wolfgang Laun wrote: Perhaps a wrapper fact with a single slot containing a reference of the actual fact could server as a stable point of reference. That means that the many references

Re: JESS: How to use templates inside facts

2008-09-30 Thread Wolfgang Laun
The decision between using a hard (fact) reference and a key has arguments for either side. I'm not going to try to list them all ;-) - Hard references are readily available, but building structures is more complicated. - If you don't have a primary key, you'll have to invent an artificial one.

Re: JESS: How to test if a var is bound/not-bound?

2008-10-08 Thread Wolfgang Laun
There are several problems with this rule. The notion of a slot of some fact being bound doesn't make sense. A slot always has a value, possibly nil, and you can simply compare a slot to this symbol. You cannot simply write a boolean function as another term in a rule's LHS. So, the ( ...) must

Re: JESS: Using a slot in a rule

2008-10-28 Thread Wolfgang Laun
I've been trying to guess what's bothering you or what your actual problem is, since setting a slot via setSlotValue doesn't affect the way slots can be bound to variables in left hand side patterns of rules. If you are having problems: You didn't use setSlotValue on a fact that was already

Re: JESS: Using a slot with blanks on its definition

2008-10-29 Thread Wolfgang Laun
You can trick the Jess parser into using leads to as a slot identifier by escaping the space with a backslash, so: (deftemplate temp (slot leads\ to)) (bind ?f (assert (temp (leads\ to confusion (modify ?f (leads\ to sore eyes)) etc. On Wed, Oct 29, 2008 at 7:57 AM, Uiratan Cavalcante

Re: JESS: Using a slot in a rule

2008-10-29 Thread Wolfgang Laun
they are asserted. On Oct 29, 2008, at 7:01 AM, John Chrysakis wrote: On Tue, 28 Oct 2008, Wolfgang Laun wrote: I've been trying to guess what's bothering you or what your actual problem is, since setting a slot via setSlotValue doesn't affect the way slots can be bound

Re: JESS: Using a slot with blanks on its definition

2008-10-30 Thread Wolfgang Laun
Although I really should have been more outspoken in my previous mail, I do hope that the choice of words in my example (confusion, sore eyes) is an indication that I'm very much against using this trick (which isn't even a hack, let alone a haque), too. Looking at the suitable places in the Jess

JESS: Minor undetected error: (list) in regular slot

2008-10-30 Thread Wolfgang Laun
The distinction between a (slot s) and a (multislot m) is that the former can hold a single value and the latter a list. Jess enforces this by the Jess parser accepting just a single expression for slots, as opposed to a list of expressions for multislots. Therefore the following construct where

Re: JESS: Use deffacts in assert object in slot value

2008-10-30 Thread Wolfgang Laun
On Wed, Oct 29, 2008 at 3:17 PM, Nopphadol Chalortham [EMAIL PROTECTED]wrote: Thank you for your answer. I have tried this method already. It works. But I would like to use only deffacts construct. Do you have any answer? There is a somewhat roundabout way to achieve that. In the deffacts

JESS: no initial-fact causes rule not to fire

2008-10-31 Thread Wolfgang Laun
This Jess program works correctly if executed with the initial reset, but the rule does not fire if there is not initial-fact. ;; (reset) (deftemplate Pair (slot a)(slot b)) (assert (Pair (a a)(b b))) (defrule noabeq (not (Pair (a ?x)(b ?x))) = (printout t no a=b! crlf)) (run) If the presence

Re: JESS: Use deffacts in assert object in slot value

2008-10-31 Thread Wolfgang Laun
))) ?p - (person (name ?m)) = (modify ?f (mother ?p)) ) What about rule for modifing children-slot? On Thu, Oct 30, 2008 at 4:07 PM, Wolfgang Laun [EMAIL PROTECTED]wrote: On Wed, Oct 29, 2008 at 3:17 PM, Nopphadol Chalortham [EMAIL PROTECTED] wrote

Re: JESS: no initial-fact causes rule not to fire

2008-10-31 Thread Wolfgang Laun
if there is no initial-fact to insert? Or is there some convincing reason to not have it? On Oct 31, 2008, at 8:45 AM, Wolfgang Laun wrote: This Jess program works correctly if executed with the initial reset, but the rule does not fire if there is not initial-fact. ;; (reset) (deftemplate Pair

  1   2   3   >