3 ms·
Unfortunately many don't. Standard Datalog for example doesn't have disjunction which you need to model sum types as relations. My preference is to have sum ty
by sirwhinesalot 5y ago
Unfortunately many don't. Standard Datalog for example doesn't have disjunction which you need to model sum types as relations.
My preference is to have sum types modeled separately from relations as just a complex type that can be related as well. This is the approach taken by Souffle, a C++ Datalog implementation which supports sum types.
- sirwhinesalot 5y agoFor some reason I cannot edit the post above, but I misspoke on Datalog, since it has disjunctions, just not in the head of rules. You can go pretty far with disjunctions in the body which suffices for most cases of modelling "sum types". For example: Stakeholder(X) :- Shareholder(X); Customer(X); CEO(X). It's still a lot better to model them separately from the relations, for the same reason that you want to model relations between points as actual relations between points not between X, Y and X, Y.