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 immediately
get an error.

Now, I understand the error. But maybe Jess should be nicer by noticing
that if the comparison cannot be made, then it should simply not fire
the rule (quietly).

Henrique

---
Jess, the Rule Engine for the Java Platform
Copyright (C) 2008 Sandia Corporation
Jess Version 7.1RC1 6/23/2008

Jess> (deftemplate a (slot s))
TRUE
Jess> (deftemplate b (slot s))
TRUE
Jess> (defrule r1 (a (s ?sa)) (b {s < ?sa}) => (printout t "Yes!" crlf))
TRUE
Jess> (assert (a))
<Fact-0>
Jess> (assert (b (s 1)))
Jess reported an error in routine <
       while executing (< ?__synth0(1,0,-1) ?sa(0,0,-1))
       while executing rule LHS (Node2)
       while executing rule LHS (TECT)
       while executing (assert (MAIN::b (s 1))).
 Message: Not a number: nil.
 Program text: ( assert ( b ( s 1 ) ) )  at line 5.
Jess>


--------------------------------------------------------------------
To unsubscribe, send the words '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]
--------------------------------------------------------------------

Reply via email to