Hi,
Is there a limitation on the use of documentation strings on deftemplates
using the from-class declaration?
I have something like:
(deftemplate Foo extends Bar
Documentation string for Foo
(declare (from-class Foo)) )
Whe accessing the docstring as per Deftemplate.getDocstring(), I
-jess-us...@sandia.gov.
--
- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEI/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
VoIP: (+351) 220413355
Phone: (+351) 225081400 ext.1315...@fe.up.pt
get a doghouse when you buy a
dog, and “add” and “definstance” will both get you a doghouse for your Java
object “dog” automatically.
** **
*From:* owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] *On
Behalf Of *Henrique Lopes Cardoso
*Sent:* Friday, May 10, 2013 4:54 AM
Hi,
I've just noticed an interesting behavior of Jess.
I was working with a couple of classes like this:
public class X {
Object obj;
// getter and setter for obj
...
}
public class Y {
int i;
// getter and setter for i
...
}
Then in Jess I wrote:
(deftemplate X
Hi,
I am concerned with the at least two different ways in which you can add,
to working memory, facts that are instances of from-class deftemplates.
Lets say I have:
(deftemplate FC (declare (from-class FC)))
I can add a shadow fact like this:
(bind ?fc (new FC))
(add ?fc)
This is the
solved?
Thanks,
Henrique
Henrique Lopes Cardoso wrote:
Hi again,
In the sequel of this problem, I've fond another (possibly related)
situation where the rule does not seem to compile correctly.
I managed to simplify the example to the following rule:
(defrule r3
(s
) ) )
(initial-fact)
(test (= qwe asd))
= ...
Alternatively you could move the test before the or.
On Sep 7, 2010, at 5:10 AM, Henrique Lopes Cardoso wrote:
Hi,
Is there any update on this issue?
Since I did not get any answer to my last question in the previous
e-mail (below), I
- (a ?_021__blank_2) (not (b ?_0022_x
=
(printout t \sure thing!\ crlf))
On Jul 20, 2010, at 4:04 PM, Henrique Lopes Cardoso wrote:
Actually, asserts do work, because (deffacts) are added to working
memory by a call to (reset). This is wy I am calling (facts) before
(run), to make sure
Hi,
I have 2 deftemplates, each of which includes a slot with a Java object.
I want to have a rule that fires when the objects inside those slots are
equal. This is my implementation:
(deftemplate t1 (slot o))
(deftemplate t2 (slot o))
(defrule r1
(t1 (o ?obj))
(t2 (o ?obj))
=
Hi,
I was trying to figure out a way of checking the status of some system.
To make things simpler, I have two kinds of facts, start and end, which
are added along time:
(deftemplate start)
(deftemplate end)
Then I want to say that I have an active system if it has started and
not ended
Hi,
I was strugling with the following code, until I remembered that rule
activations are only affected when you assert/retract or modify facts
that can match a rule's patterns. Anyway, I think I'd better share this
problem and get further advice.
; I have 3 deftemplates:
(deftemplate a (slot
seems to provide an example where it is used in the
LHS, although with a Java pattern.
Henrique
Ernest Friedman-Hill wrote:
On Jun 29, 2010, at 6:42 AM, Henrique Lopes Cardoso wrote:
Does this mean that when using dotted variables a pattern binding should
always be included before
))
(deffunction retract-them-all ()
(bind ?result (run-query* get-them-all))
(while (?result next)
(retract (?result get f)) ) )
Cheers,
Henrique
Wolfgang Laun wrote:
On Mon, Feb 9, 2009 at 3:51 PM, Henrique Lopes Cardoso h...@fe.up.pt
mailto:h...@fe.up.pt wrote:
How about
], NOT to the list
(use your own address!) List problems? Notify
[EMAIL PROTECTED]
--
- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEI/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
(+351)225081400 ext
Hi,
After a whole morning struggling with what appeared to be a bug in my
application, I managed to create a simple example:
;---
(deftemplate foo
(slot bar) )
(defrule r
(exists (foo))
= )
(reset)
(assert (foo))
(printout t (run) crlf)
(modify (fact-id 1) (bar 123))
(printout t
the other one).
Are my thoughts correct?
Cheers,
Henrique
Ernest Friedman-Hill wrote:
On Oct 17, 2008, at 9:06 AM, Henrique Lopes Cardoso wrote:
;---
The rule fires in both runs. Is this the intended behavior?
It's traditional behavior for Rete engines, yes.
Is there a
way to prevent
Hi,
I have tried the straightforward example below. I define two simple
deftemplates and a rule that compares their slots, which are assumed to
be numeric. Then, I incidentally assert a fact on which I do not define
a value for a slot.
When the rule is evaluated (after the second assertion), I
Hi,
In the change history for 7.1RC1: Template properties
(backchain-reactive, slot-specific) are inherited.
In section 5.1 of the manual: A template inherits all the slots of its
parent template, but none of its other characteristics.
And in section 17.7: The backchain-reactive and
7.0p2 plugins and not
the betas, I have not locked-up (yet).
Keep us posted on anything you find out! :-)
Cheers,
Jason
On Mon, Mar 17, 2008 at 8:17 AM, Henrique Lopes Cardoso [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
Hi all,
After a morning starting with those annoying crashes
Hi,
I've just checked the link, which is in fact wrong. But I intuitively
tried to change the target and it works:
http://www.daml.org/2001/02/gedcom-ruleml/jess.xsl
HTH,
Henrique
Juan Ondiviela wrote:
I've been searching for a long time for a xsl translator from ruleml
to jess rules until I
!
Now in module-k
Resuming focus stack in module-n
5
**/
Cheers,
Jason
On Fri, Mar 14, 2008 at 8:41 AM, Henrique Lopes Cardoso [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
Hi,
Some time ago I discussed the possibility of using auto-focus in a
module definition, instead of in each
]
--
- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEI/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
(+351)225081400 ext.1315
[EMAIL PROTECTED] | www.fe.up.pt/~hlc
Hi,
Some time ago I discussed the possibility of using auto-focus in a
module definition, instead of in each single rule in a module.
I was told that was not possible, but that it was a good idea.
Are you planning to include this feature?
This would be interesting especially when using modules
Giannis
--
---
Jason Morris
Morris Technical Solutions LLC
http://www.morris-technical-solutions.com
--
- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEI/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
(+351)225081400
There is a small bug in the 'actually-remove-things-from-c' rule:
(remove ?c ?b?) should be (remove ?c ?x)
Anyway, is 'do-something-when-something-gets-removed-from-c' guaranteed
to fire? If 'actually-remove-things-from-c' fires before, then
'do-something-when-something-gets-removed-from-c' will
? Notify [EMAIL PROTECTED]
--
- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEI/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
(+351)225081400 ext.1315
[EMAIL PROTECTED] | www.fe.up.pt/~hlc
Hi,
I have a rule looking like this:
(defrule
?b1 - (t1 (s ?s1))
?b2 - (t2 (s ?s2))
(or (test (eq ?s1 x)) (test (eq ?s2 x)))
=
...)
This example simplifies the general case. I may have any number of
bindings, and the common slot 's' is checked to see if at least one of
the bound
, at 9:28 AM, Henrique Lopes Cardoso wrote:
(defrule
?b1 - (t1 (s ?s1))
?b2 - (t2 (s ?s2))
(or (test (eq ?s1 x)) (test (eq ?s2 x)))
=
...)
This example simplifies the general case. I may have any number of
bindings, and the common slot 's' is checked to see if at least one
Hi,
I was trying to test equality for lists seen as sets (elements with any
order).
Is there any direct function, or any solution simpler than this:
(bind ?list1 (list 1 2 3))
(bind ?list2 (list 3 2 1))
(and (= (length$ ?list1) (length$ ?list2)) (= (length$ (union$ ?list1
?list2)) (length$
@sandia.gov
Sent: Wednesday, February 13, 2008 3:16 PM
Subject: Re: JESS: Checking list equality
You can apply (=) to more than 2 arguments.
(= (length$ ?list1) (length$ ?list2) (length$ (union$ ?list1 ?list2)))
kr
Wolfgang
Henrique Lopes Cardoso wrote:
Hi,
I was trying to test equality
Hi,
I was wondering if there is a way of setting a default value for a slot
to be equal to another slot.
Something like:
(deftemplate foo
(slot bar)
(slot qwe (default-dynamic this.bar
(assert (foo (bar 1)))
Slot qwe would get the value of slot bar, that is, 1.
Thanks.
Henrique
Hi,
I am considering rewriting my rules to maximize the use of the dot
notation in patterns.
For instance:
(deftemplate x (slot a) (slot b) (slot c))
(deftemplate y (slot a) (slot b))
(defrule r
?x - (x (a ?a) (b ?b) (c 1))
?y - (y (a ?a) (b ?b))
=
(printout t ?y matches ?x
is activated once for each a fact, but when it fires the
first time, the second activation is removed during the modify, and
not put back because of the no-loop.
On Dec 20, 2007 10:23 AM, Henrique Lopes Cardoso [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
Hi,
This e-mail is a follow-up
I just found a problem with pattern usage in rules. The following code
works fine in Jess 70p1, but does not work with 71b1.
Did I miss something in the change log?
;;;
(deftemplate person
(slot firstName) (slot lastName) (slot age))
(defrule teenager
(person {age 12 age 20}
Why does 'no-loop' have no effect in this case? :|
Is there a conflict between both declarations?
Henrique Lopes Cardoso wrote:
I got to a possible solution, based on the answer you gave on another
thread (related to pattern matching).
This is what I have:
;;;
(deftemplate foo
(declare
Hi,
This e-mail is a follow-up on the issue related to slot-specific that I
discussed a couple of days ago. I am using Jess 71b1
I am trying to figure out how to properly use slot-specific and/or no-loop.
I now got to the following simple example:
;;;
(deftemplate foo
(declare
Hi,
Is the slot-specific declaration not inherited by a sub-deftemplate?
I tested the following:
;;;
(deftemplate D
(declare (slot-specific TRUE))
(slot B))
(deftemplate D1 extends D)
(defrule R1
?d - (D1)
=
(printout t R1 modifying... crlf)
(modify ?d (B 3)))
(defmodule m)
I would expect them to be.
Henrique
Ernest Friedman-Hill wrote:
No, it's not inherited. Backchain-reactivity was never inheritable,
either. Should they both be?
On Dec 17, 2007, at 2:01 PM, Henrique Lopes Cardoso wrote:
Hi,
Is the slot-specific declaration not inherited by a sub
Hi,
Using Jess 7.1a3 I get the following behaviour (the same with 7.0p1):
Jess ( 1 2 3)
TRUE
Jess ( 1 2 2)
FALSE
Jess ( 1 1 2)
FALSE
Jess ( 1 2 1)
TRUE
But the documentation reads: Returns TRUE if the value of the first
argument is not equal in value to all subsequent arguments; otherwise
PROTECTED]
On Behalf Of Henrique Lopes Cardoso
Sent: Friday, June 29, 2007 7:29 AM
To: jess-users@sandia.gov
Subject: Re: JESS: Jess editor
When saving a Jess file, Eclipse stops responding.
I don't know if it helps, but after a forced close I get a log as
attached to this e-mail
Hi,
This problem got into my way when I upgraded to Jess71a2. There was no
problem with 70p1.
I have this Jess file:
;---
(deftemplate a (slot s1) (slot s2))
(defquery MAIN::q (declare (variables ?id))
?z - (a (s1 ?id) (s2 ?s2)))
(assert (a (s1 qwe) (s2 asd)))
;---
Now, if I batch() this
, at 6:39 AM, Henrique Lopes Cardoso wrote:
I am replying to an old post of mine. It referred to the absence of a
method to undefine a module.
Now I have just realized that in the JessEvent class there isn't a way
of being notified of a DEFMODULE event. Why is that?
It would seem to me
Hi,
I thought that this problem was solved before, but I am still getting
it. I am using the stable version Jess70p1.
If I remove a Userfunction and then add it again, it stops working and
throws an exception.
E.g.:
//---
Rete jess = new Rete();
FileReader fr = new
Hi,
1.
The JessEvent.getObject documentation is wrong: for a DEFRULE_FIRED
event the object is an Activation, not a Defrule.
2.
I have extended the Rete class, and have implemented both
eventHappened(JessEvent) and aboutToFire(Activation).
The thing is: when a rule fires, first I get the
of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify
[EMAIL PROTECTED]
--
- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEEC/FEUP
Rua Dr. Roberto Frias | 4200-465
();
jess.eval((System.currentTimeMillis));
It works fine if I read a .clp jess file using Jesp.
Henrique
--
- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEEC/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
(+351)225081400 ext.1315
[EMAIL PROTECTED] | www.fe.up.pt
a look at it.
On Jul 5, 2007, at 8:08 AM, Henrique Lopes Cardoso wrote:
No, that is not the case.
I tried this:
jel.assertString((qwe));
jel.retractString((qwe));
jel.assertString((qwe));
and it still doesn't work. I only get the retract event.
There must
file that prevents
some JessEvents from being notified?
Henrique
Jonathan Sewall wrote:
I didn't extend Rete just to create a JessListener, but I did find
that I needed to reregister my listeners after bload.
Henrique Lopes Cardoso wrote:
I am stumbling for some time now with the use
]
--
- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEEC/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
(+351)225081400 ext.1315
[EMAIL PROTECTED] | www.fe.up.pt/~hlc
, Henrique Lopes Cardoso wrote:
I just extended Rete to make the example simpler. I also tried it with
an independent JessListener implementing class, but the problem is
the same.
I tried to do Rete.addJessListener() after bload, just as you suggested,
but the problem remains.
So, I ask again: what
about defrules, the same should be possible with defmodules.
Henrique
Henrique Lopes Cardoso wrote:
friedman_hill ernest j wrote:
I think Henrique Lopes Cardoso wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
Hello,
I was looking for an undefmodule function in Jess
I am stumbling for some time now with the use of a JessListener. After
many tries, I figured out that the listener does not work properly when
I bload() certain files.
Since the Rete class implements JessListener, for ease of testing I
extended it and got to the class below.
From my experiences,
--
- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEEC/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
(+351)225081400 ext.1315
[EMAIL PROTECTED] | www.fe.up.pt/~hlc
- - - - - - - - - - - - -
To unsubscribe, send the words 'unsubscribe jess-users
Hi,
I tried this at Jess prompt:
(reset)
(assert (a))
(bind ?m (engine mark))
(assert (b))
(engine resetToMark ?m)
(facts)
At the end, fact (b) is still there. Shouldn't it be retracted with
resetToMark?
Henrique
To
qr = jess.runQueryStar(q, new ValueVector().add(1));
qr.next();
qr.get(x).factValue(engine.getGlobalContext()).getDeftemplate().getBaseName()
Is there an easier way to do it?
Henrique
Henrique Lopes Cardoso wrote:
Hi,
I am trying to get the real deftemplate of a fact belonging to a
sub
be to ask: is there an easy way
of making a what-if analysis of rule-firing, i.e., of asking if this
fact is asserted, what rule will fire?
Henrique
Henrique Lopes Cardoso wrote:
Hi,
I am trying to browse, through the Java API, the contents of a rule, to
check when it might be applicable
Hi,
I am trying to browse, through the Java API, the contents of a rule, to
check when it might be applicable by inspecting its LHS. This is
supposed to be done before running the Rete engine, not during (i.e., I
do not want to look for activations, or run-time pattern matches...).
I started with
--
- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEEC/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
(+351)225081400 ext.1315
[EMAIL PROTECTED] | www.fe.up.pt/~hlc
- - - - - - - - - - - - -
To unsubscribe, send the words
Hi,
I was browsing the JessML documentation. The example in 14.2.4 does not
seem consistent with the explanation at 14.2.3: the value type should be
an attribute, not an element.
Henrique
To unsubscribe, send the words
Hi,
This is just to let you know that I prepared a tutorial on JADE and Jess
integration, which is available here:
http://jade.tilab.com/doc/tutorials/jade-jess/jade_jess.html
Comments are welcome.
Maybe a link could be added in Jess site...
Cheers,
Henrique
Hi,
I have just installed Jess plugins for Eclipse, which seem to work fine.
However, I also tried installing it with IBM Rational, which runs over
Eclipse as well. I get an error message when I try to open a jess (.clp)
file:
Problems Opening Editor|Cannot open default editor on
'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify
[EMAIL PROTECTED]
--
- - - - - - - - - - - - -
Henrique Lopes
Henrique Lopes Cardoso wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
Hi,
Is there no way of getting (in Java) the deftemplates of a certain module?
Looks like listDeftemplates() gets all deftemplates from all modules.
But its jess equivalent, (list-deftemplates), includes
--
- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEEC/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
(+351)225574199 ext.3355
[EMAIL PROTECTED] | www.fe.up.pt/~hlc
- - - - - - - - - - - - -
To unsubscribe, send the words
Hi,
I was using bsave() and bload() with an engine that includes
Java-implemented user-functions. Since these are not serializable, I was
using removeUserfunction() to all Java-implemented functions before
bsave()ing. The user functions would be re-defined after bload()ing.
This approach got
]
--
- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEEC/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
(+351)225574199 ext.3355
[EMAIL PROTECTED] | www.fe.up.pt/~hlc
Hello,
I was looking for an undefmodule function in Jess, but could not find it.
How can I undefine a module? Does it need to be empty? That is, with no
rules or facts?
Thanks.
Henrique
--
- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEEC/FEUP
Rua Dr. Roberto Frias | 4200
]
--
- - - - - - - - - - - - -
Henrique Lopes Cardoso
DEEC/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
(+351)225574199 ext.3355
[EMAIL PROTECTED] | www.fe.up.pt/~hlc
How about:
(bind ?string (call string1 concat string2))
(bind ?symbol (sym-cat ?string))
(build (str-cat (assert ( ?symbol 10
Henrique
---
[EMAIL PROTECTED] wrote:
I am sorry, I should have been more detailed. What I want to do is
somethink like this:
(bind ?string (call string1 concat
stuff). That code is expecting a string in a
particular slot, which is why I was trying to convert a certain fact to
a string. Otherwise I would have to change the code... May be that is a
good thing to do!
Henrique
[EMAIL PROTECTED] wrote:
I think Henrique Lopes Cardoso wrote:
(defrule r1
Hi,
I have two problems.
--- The first:
I have a string which contains an atom. How do I convert it to an atom?
I tried this,which works:
(bind ?string henrique)
(nth$ 1 (explode$ ?string))
Is there a simpler way?
--- The second:
How do I convert a fact-id into a string?
This
Hi,
I am having trouble in getting to multifields and strings.
I was trying to evaluate the contents of a string in a rule's LHS:
(assert (a nice string))
(defrule r1
(a ?x)
?s - (explode$ ?x)
?s - (nice ?what)
=
(printout t ?what crlf)
)
I know I cannot do this. But I cannot
---
[EMAIL PROTECTED] wrote:
I think Henrique Lopes Cardoso wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
Hello,
I was trying to do something like this:
As is often the case, details matter. There's nothing wrong with the
code you've shown; if there's a problem, it's
definition
(e.g. (deftemplate m::the-facts ...)), if that module is the current
module, is irrelevant.
Thanks.
Henrique
[EMAIL PROTECTED] wrote:
I think Henrique Lopes Cardoso wrote:
In the Jess documentation (more specifically in The Jess Language
section) the following is written
Yes, Timothy's solution worked out.
However, Ernest's one had a small problem (corrected below):
;---
(deftemplate said (slot who) (slot content))
(deftemplate content (multislot payed))
(defrule payments
(said (who ?w) (content ?content))
?content - (content (payed ?payer ?amount
the fact in MAIN? I would like to avoid this for organizational purposes
(using modules as contexts).
Thanks,
Henrique Lopes Cardoso
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message
Hi,
I want to define a rule based on the contents of a
fact. For instance:
(defrule payments
(said ?who (payed ?payer ?amount ?receiver ?when)
?)
=
(assert (ifact (payment ?amount ?receiver ?time)))
Can I do this?
Or must I define a deftemplate:
(deftemplate said
(slot
Hi,
Is it possible to create modules in the RHS of a
rule?
Something like:
(defrule new-contract
(deal ?ctid ?contents)
=
(defmodule ?ctid)
(assert (contract ?contents))
)
Thanks.
Henrique
@sandia.gov
Subject: Re: JESS: Defining rules based on facts subcontents
I can't say I understand what you're asking, exactly, but I think the
answer is no, you have to define a deftemplate.
I think Henrique Lopes Cardoso wrote:
Hi,
I want to define a rule based on the contents of a fact
Henrique Lopes Cardoso wrote:
Let me simplify my question. I was trying to do something like:
(deftemplate said
(slot who)
(slot content)
)
(defrule payments
(said (who ?w) (content (payed ?payer ?amount ?receiver ?when)))
(authority ?w)
=
(assert (payment-done
The binding does not work!
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: quinta-feira, 10 de Fevereiro de 2005 19:24
To: jess-users@sandia.gov
Subject: Re: JESS: Defining rules based on facts subcontents
I think Henrique Lopes
81 matches
Mail list logo