Replies: 2 comments 3 replies
-
When I saw this question I realized it was what I was looking for as well. I'm trying to find an embedded database for user scripted read only analysis of their own data, and cozodb looks absolutely amazing for this use case, and being able to create abstractions/functions within the scripting language itself would be pretty important for extensibility / maintainability of a scripting code base. |
Beta Was this translation helpful? Give feedback.
-
@CharlesTyrrell @turbo can you give simplified example of the workflow that you are needing? Im a big fan of Logica an want to understand your use cases. |
Beta Was this translation helpful? Give feedback.
-
In my queries, I often have shared conjunct conditions between many rules that would be useful to extract, but this always leads to the error
Which is expected for infinite predicates. I'm looking for a mechanism similar to CodeQL's Binding Sets to enable infinite predicate calls from constrained contexts.
Other prior art includes Logica's automatic infinite predicates, which are analyzed at compile time and only error when not used in a finite context. See “Infinite Predicates” here.
Here's a simple example that works, finding unique disjoint lists:
gives
If I now create a predicate, I get the error mentioned above, since
disjoint
has no inherent binding. I'd like to be able to declare the "real" binding from the query predicate, though.This is of course a trivial example, where the disjoint predicate could be grounded directly to the input relation. But in my uses, I sometimes have multiple rule bodies which all in themselves re-use the same conditions. Here's an example of a Countdown Number Problem solver, which could really benefit from a reusable operand-selection predicate:
Beta Was this translation helpful? Give feedback.
All reactions