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)
(or (not (a))
(and ?x <- (a)
(b ?x) ) )
(test (= qwe asd)) ; stupid test, just to expose the problem
=>
(printout t "tssss!" crlf) )
Using (ppdefrule), we see that this rule compiles to:
(defrule MAIN::r3
(or
(and
(s)
(not (a)))
(and
(s)
?x <- (a)
(and (b ?x)
(test (= qwe asd)))))
=>
(printout t "tssss!" crlf))
Therefore, the test is not done in the first branch of (or).
Is there a way to stop Jess from transforming rules and keep the
original coding, possibly with some loss of performance? The point here
is to avoid the apparently buggy transformations that are being made.
Thanks.
Henrique
Ernest Friedman-Hill wrote:
> Indeed, the rule doesn't seem to compile correctly; the two ?x's are
> not merged.
>
> Jess> (ppdefrule r)
> "(defrule MAIN::r
> (initial-fact)
> (not ?x <- (and ?x <- (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 facts are in working memory as intended.
>>
>> Anyway, I tried (assert)ing them one by one and it still does not work
>> as expected.
>>
>> It must be something else.
>>
>> Henrique
>>
>>
>
--------------------------------------------------------------------
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].
--------------------------------------------------------------------