Welcome! Please see the About page for a little more info on how this works.

0 votes
in core.logic by

This patch adds arity checking to relations, facts and retractions so that if a user specifies that a rel "foo" shall be 3-tuple in the def-rel form it will be illegal to add a 4-tuple as a fact to the db. This protects the state of the DB against a class of user errors which would otherwise silently fail through.

This is more a work proposal than anything, as it may well be legitimate to have a variable arity relation. I would just consider such a construct suspect, and this patch supports the way I've approached pldb.

3 Answers

0 votes
by

Comment made by: dnolen

Interesting, thanks for the patch. Will think about it.

0 votes
by

Comment made by: norman

Many of our pldb relations have a large number of arguments. Being able to detect incorrect declarations early would not be bad.

0 votes
by
Reference: https://clojure.atlassian.net/browse/LOGIC-164 (reported by arrdem)
...