core.logic

Guard against arity missmatches between rels, facts and retractions

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Trivial Trivial
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

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.

Activity

Hide
David Nolen added a comment -

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

Show
David Nolen added a comment - Interesting, thanks for the patch. Will think about it.
Hide
Norman Richards added a comment -

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

Show
Norman Richards added a comment - Many of our pldb relations have a large number of arguments. Being able to detect incorrect declarations early would not be bad.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: