-
Notifications
You must be signed in to change notification settings - Fork 71
Functions vs rules #982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functions vs rules #982
Conversation
3abbbcd
to
07e70c5
Compare
== Partial evaluation of functions | ||
Although the split between arguments and returned concepts is a reasonable consequence of | ||
having the user think about the computation explicitly, it's less declarative than the rules | ||
where the planner would infer which role-players of a relation should be bound before evaluating the rules. | ||
In the future, we hope to introduce "partial functions" where the planner may choose to leave some | ||
it to the function to bind some of the arguments instead of requiring them as outputs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd generalize this to "Future functions" to discuss partially bound functions and/or leaving args unbound, both of which would address the need for as many functions right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But good idea to keep it short like you have
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't decide. I'm calling them contextually bound functions for now.
but it does bring us to the next section. | ||
|
||
=== What functions can't do (yet) | ||
To the best of our knowledge, TypeDB in its current state can't do "arbitrarily large" models. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete 'best of our knowledge', we should make a claim as we're the experts
Understandable, since this is the case with most programming languages - | ||
but it does bring us to the next section. | ||
|
||
=== What functions can't do (yet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think mentioning turing completeness somewhere here might be good is a relatable way to have it thought about IMO.
Aren't we turing complete if we can generate nats() though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a push-down automaton might be able to generate nats.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved w comments
Goal
Document the similarities and differences between 2.x rules and 3.x functions, and explain how they should be equally expressive while being slightly more flexible.