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

A way to detect all available predicates would be useful #2600

Open
triska opened this issue Oct 5, 2024 · 2 comments
Open

A way to detect all available predicates would be useful #2600

triska opened this issue Oct 5, 2024 · 2 comments

Comments

@triska
Copy link
Contributor

triska commented Oct 5, 2024

Motivation: Precompile a set of facts that let us quickly recognize built-in predicates: #2599

Which built-in predicates are there?

?- predicate_property(A, built_in).
   error(instantiation_error,predicate_property/2).

Ideally, predicate_property/2 would tell us.

current_predicate/1 cannot be used to obtain all predicates that are currently defined, because current_predicate/1 only succeeds for user-defined predicates.

@triska triska changed the title current_predicate/1 does not describe all current predicates A way to detect all available predicates would be useful Oct 5, 2024
@bakaq
Copy link
Contributor

bakaq commented Oct 5, 2024

Well, I think this would go against the ISO Standard, see #153. I also think this would be saner behavior, but maybe we should add a different predicate in library(iso_ext) that does that so that current_predicate/1 is still ISO compliant.

EDIT: Oh, you already addressed that by putting the functionality in predicate_property/2 instead. Seems nice.

@triska
Copy link
Contributor Author

triska commented Oct 5, 2024

Yes, good catch, I have already edited the original suggestion to suggest predicate_property/2 instead, because current_predicate/1 cannot be used for the reason you mention, thank you for spotting this!

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

2 participants