Skip to content
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

Better handling of nullary predicates #52

Open
daveraja opened this issue Sep 25, 2021 · 0 comments
Open

Better handling of nullary predicates #52

daveraja opened this issue Sep 25, 2021 · 0 comments
Assignees

Comments

@daveraja
Copy link
Collaborator

Nullary (0-arity) predicates don't really fit the ORM model. Currently, it is possible to declare nullary predicates in clorm by simply not specifying a parameter to the predicate class definition.

  class P(Predicate): pass

But this creates a predicate sub-class only to match a single proposition "p" and every python instance of P will match the same predicate. If you have a lot of nullary predicates in your ASP program then you have to create a class for every one of them. This is very heavy handed and doesn't make it very useful to integrate into clorm queries.

So we need a better way to deal with nullary predicates. Currently, I don't have a clear idea. Maybe create a special case NullaryPredicate class to store arbitrary nullary predicates (eg., "p","q","r","s", ...). But integrating it into the factbase query language might still be very hacky.

@daveraja daveraja self-assigned this Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant