clara

http://www.clara-rules.org/
2021-06-16T20:38:26.084500Z

This happens because Clara allows multiple equal facts to exist in the session, and tracks the number of them inserted. So after something like (-> session (insert a) (insert a) fire-rules (retract a) you’d still have on “a” in the session.

2021-06-16T20:39:19.084700Z

The same applies for facts created as a result of rules firing.

2021-06-16T20:40:03.084900Z

If this isn’t desirable in your use-case the distinct accumulator can be used.