clara

http://www.clara-rules.org/
talgiat 2018-03-21T16:01:02.000129Z

is there a way to query for all types but one?

2018-03-21T16:05:10.000503Z

@talgiat the main problem I’d see with doing something like that is that the query may become a performance problem

2018-03-21T16:05:40.000937Z

It would be heavily hit since it’s working memory will change any time any fact in working memory is inserted/retracted (including from truth maintenance)

2018-03-21T16:07:16.000603Z

You could probably do what you ask though:

(r/defquery []
  [?o <- Object]
  [:test (not (isa? (type ?o) ExcludedType))])

2018-03-21T16:07:32.000613Z

If you have a custom :fact-type-fn you could still accomplish similar

talgiat 2018-03-21T16:30:18.000479Z

I do have a :fact-type-fn

2018-03-21T17:01:23.000927Z

@talgiat you’d have to define an hierarchy then more than likely

2018-03-21T17:02:43.000747Z

Potentially you could derive all your types to a common ancestor type.

2018-03-21T17:03:28.000342Z

You could leave out the excluded type from that grouping too, and then your query would just be r/defquery my-q [] [?x <- :parent-type]

talgiat 2018-03-21T17:12:53.000314Z

yeah, thought about that

talgiat 2018-03-21T17:13:09.000778Z

prob. better with records implementing a common protocol that will be the parent

2018-03-21T18:02:35.000087Z

@talgiat it can go either way really