Jim, on LHS of your rule, you are actually testing
(test
(and(= ?servicecode 847314565)(= ?quantity 1))
)
AND
(test(or(= ?amount 4.17)))
so make no differenec if you put "or" or "and" inside the second test.
Maybe that is what you need?
(test
(or
(and (= ?servicecode 847314565)(= ?quantity 1))
(= ?amount 4.17)
)
)
Yuping
On 4/24/07, Jim Yates <[EMAIL PROTECTED]> wrote:
I don't understand why fact 1 does not match in the following:
(watch activations facts)
(deftemplate BTransactions
(slot amount) (slot quantity)
(slot servicecode))
(defrule Jim_Rule "Jim Rule Comment"
(BTransactions
(amount ?amount)
(quantity ?quantity)
(servicecode ?servicecode)
)
(test(and(= ?servicecode 847314565)(= ?quantity 1)))
(test(or(= ?amount 4.17)))
=>
(printout t "Rule Matched" crlf)
)
(reset)
;Fact 1 No Match Why?
(assert (BTransactions
(quantity 1) (amount 4.19)(servicecode 847314565)))
; Fact 2 Match
(assert (BTransactions
(quantity 1) (amount 4.17) (servicecode 847314565)))
(run)