This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-07
Channels
- # aleph (4)
- # announcements (7)
- # arachne (1)
- # beginners (138)
- # calva (5)
- # cider (1)
- # clara (14)
- # clj-kondo (1)
- # cljsrn (2)
- # clojars (4)
- # clojure (247)
- # clojure-dev (33)
- # clojure-europe (3)
- # clojure-italy (71)
- # clojure-losangeles (6)
- # clojure-romania (6)
- # clojure-spain (11)
- # clojure-uk (17)
- # clojurescript (95)
- # core-async (2)
- # cursive (19)
- # datomic (7)
- # duct (27)
- # figwheel (1)
- # graalvm (22)
- # juxt (7)
- # kaocha (8)
- # leiningen (1)
- # luminus (7)
- # lumo (4)
- # off-topic (38)
- # reagent (4)
- # reitit (11)
- # shadow-cljs (30)
- # spacemacs (42)
- # tools-deps (103)
- # xtdb (5)
Thanks @mikerod ! I am creating an empty session at this point. That seems to resolve these errors.
If the only thing that changes in the LHS of a rule is an accumulator value, is it correct that the rule won't fire if the collection of facts matching the accumulator condition change?
I would think that if an accumulator saw a new value, and the previously accumulated objects changed that there would be work that the rhs would have to do. Though I might be misunderstanding your question
That's how I want it to behave, but I have a distant recollection that it doesn't actually work that way. Been awhile since I've played with clara.
@dave.dixon, are you thinking of the retract-fn’s behavior?
Could be. Possible I'm just writing my accumulation clause wrong or something, because sometimes it does seem to behave as you described.
Ah, I think this might help: https://github.com/cerner/clara-rules/blob/ce65c5071a271905786449db1190687ee40e4624/src/test/common/clara/test_accumulation.cljc#L1121
@dave.dixon in current version of Clara (and several before) the rule will not continue to propagate if the accumulated value hasn’t changed according to =
See lines like https://github.com/cerner/clara-rules/blob/master/src/main/clojure/clara/rules/engine.cljc#L1200
So specifically if the accumulators result from the :convert-return-fn
is =
to what it was in the previous round of accumulating fact matches, propagation stops - which would imply no RHS action being triggered/activated
The tests near what Jody pointed too could be enlightening on some more semantics though. I agree
There are quite detailed github issues out there that also discuss these semantics when we added the related changes.
@mikerod Thanks. Not exactly sure what I was thinking of. My actual problem was that I was hacking at something trying to make it update in place rather than letting truth maintenance do the lifting. Need to get back to "thinking TMS" 😉