Havepredicate
Havepredicate is a term used in discussions of reflective programming in logic and related languages. It denotes a function or predicate that queries whether another predicate is defined in the current program or environment. The concept is language-dependent, but it generally answers a simple yes or no about the existence of a given predicate indicator, such as a name and arity, optionally qualified by a module.
In practice, havepredicate typically accepts a predicate indicator in the form Name/Arity or Module:Name/Arity and returns
Usage scenarios include conditional imports, generating wrappers for optional features, and meta-programming tasks that adapt behavior
Relation to related concepts includes predicate_property/2, current_predicate/1, and module scoping rules. predicate_property can reveal attributes of
See also: current_predicate, predicate_property, dynamic predicate, module system.