clara

http://www.clara-rules.org/
adamfeldman 2019-02-20T03:48:17.009400Z

@eraserhd sounds like an interesting project. Do the task inputs and outputs change frequently, preventing the use of a simple dependency graph? Can you say more about the business domain? If you haven’t seen this, you may find it useful for working with pull expressions: https://github.com/edn-query-language/eql

dominicm 2019-02-20T06:34:49.009700Z

This sounds quite similar to something I've been working on in my spare time!

dominicm 2019-02-20T12:26:30.010300Z

http://www.clara-rules.org/docs/rules/ mentions "props", but I can't see documentation for them on that page. Does anyone know what they are?

ethanc 2019-02-20T14:11:12.004100Z

@dominicm it is a simple map, currently the only thing supported would be salience, i think. http://www.clara-rules.org/docs/conflictsalience/

2019-02-20T14:19:58.004600Z

@dominicm @ethanc there is also :no-loop

2019-02-20T14:21:21.005200Z

However, it’s typically not recommended to write rules in a way where you have to use that

2019-02-20T14:21:25.005400Z

it can have confusing semantics I believe

2019-02-20T14:21:40.005800Z

(probably why it hasn’t been documented much 😛 )

dominicm 2019-02-20T14:33:32.001200Z

Is it possible to create rules with parameters? And be explicit about passing them in?

2019-02-20T14:42:02.003Z

@dominicm It isn’t clear to me how that would work in general

2019-02-20T14:42:10.003300Z

However, queries take parameters if that’s more what you’re looking for

2019-02-20T14:42:38.004Z

For rules, instead of taking a parameter, model the param as a fact inserted by a rule perhaps

2019-02-20T14:44:57.005400Z

Instead of

(defrule param-rule
  [A (= <my-param-here> x)]
  =>
  <do things>)
Do
(defrule find-param
  [?i <- InputFact]
  =>
  (insert! (map->Param (extract-data ?i))))

(defrule param-rule
  [?p <- Param]
  [A (= (:x ?p) x)]
  =>
  <do things>)

dominicm 2019-02-20T14:45:12.005700Z

@mikerod hmm, maybe I haven't thought it through. But I want to write rules like "for every X insert 5", where I might have multiple of these inserted.

dominicm 2019-02-20T14:45:15.006Z

Ah, right, of course.

dominicm 2019-02-20T14:45:38.006600Z

My rule just needs to find "Candidate X", and then insertions can be made about X candidate. 🙂

2019-02-20T14:46:56.007Z

I think so