oracle-samples/clara-rules

Add negation conditions to :condition-matches returned by session inspect

Closed this issue · 2 comments

Currently we only return the facts matching a condition when that node is a join node; see the implementation here. As can be seen in the schema the possible node types are :join, :test, :negation, and :accumulator.

After this change, in the case of a rule like

(defrule not-freezing
     [:not [Temperature (< temperature 0)]]
     =>
     (insert! (->AboveFreezing)))

we'd be able to determine what temperatures matching the condition, and thus preventing the insertion of an AboveFreezing facts, were present in the session.

I created a draft of this at #290

The PR has been merged. Closing.