clara

http://www.clara-rules.org/
sparkofreason 2018-01-05T06:27:11.000137Z

Solution turns out to be beautifully simple (encoded in a custom DSL I'm developing)

2018-01-05T14:57:33.000437Z

@dave.dixon I think that works. The only caveat is just that there are a few outstanding issues with RHS retract!. There are some edge cases with how they may work with logical insertions. I think it doesn’t typically come up. https://github.com/cerner/clara-rules/issues/229 https://github.com/cerner/clara-rules/issues/321 I mention both in http://www.metasimple.org/2017/12/23/clara-updating-facts.html

2018-01-05T15:01:24.000279Z

Other than that though, the rules above seem reasonable. That is something I’d expect should work. To the point @zylox made: It looks like you do have some sort of external retract that is removing the ActiveArticle in your example.

zylox 2018-01-05T15:03:48.000064Z

Ya, i was approaching it from the perspective of using truth maintenance for it because of the "outside of a rule RHS?". glad you found something that works for you.

sparkofreason 2018-01-05T15:05:25.000520Z

Yes, ActiveArticle is removed externally. It does work nicely.

sparkofreason 2018-01-05T15:15:31.000504Z

::handle-cancelled-response is arguably just "nice to have", catches the case of ActiveArticle changing before the response to the comments request is received. If one ran into the edge-cases around retract! I think you could just have some sort of periodic clean-up of dangling CommentsResponse facts.

2018-01-05T15:19:24.000761Z

I like it overall. I really would like to try to get the edge cases of retract! removed. The issue it has is mostly how it interacts with the truth maintenance of other rules that are firing in the same “cycle”

2018-01-05T15:20:19.000461Z

The removal of the CommentsResponse cleans up all the Comment due to truth maintenance, which is nice.

2018-01-05T15:20:43.000418Z

Oh, I guess the ActiveArticle does too - woops. But either way, it is nice to be able to cleanup old facts liek that