I have a question about accumulation, which is going to span a couple of slack cells. The code and output above shows what I understand is the basic accumulation formalism, which is that the accumulated result acts like a fact. So when the (acc/all)
above changes due to the (insert (->Num 3))
after the first fire-rules
, the previously inserted Nums
fact gets retracted, and a new one inserted.
If I change the insert!
in the collect-nums
rule to be insert-unconditional!
, then I get the output above, where nothing is ever retracted.
The behavior I'd like to achieve is to have the output look like the above. This keeps the inserted facts resulting from an accumulator as long as the binding fact set remains valid. So after inserting (->Num 3)
, we still have the group coming from 1 and 2. But once I retract 2, those groups are retracted, and I'm only left with the group fact for those facts remaining in the rulebase. I'm pretty sure I could achieve this using my own custom rules with insert-unconditional!
and retract!
, but wonder if there's a way to have the TMS handle this without having to write explicit specialized rules.
so you essentially want a history as long as all members of that history are present
given how much the tms relies on present state alone that would be quite a doozy
Yeah, digging around the code, I'm not sure it even makes sense with how rete works. It seems like it would require some modification.
Seems similar to a join-node, but has to appear in a different place in the network or something.
you could envisions something like layered sessions that join their nodes (3d memory from a visulization point of view) and query "downward" but thats all a ton of work
but ya i agree....doesnt really mesh with rete imo