built-in predicate
instantiates_class/2-3
ï
Descriptionï
instantiates_class(Instance, Class)
instantiates_class(Instance, Class, Scope)
Enumerates, by backtracking, all pairs of objects such that the first
one instantiates the second. The relation scope is represented by the
atoms public
, protected
, and private
.
Modes and number of proofsï
instantiates_class(?object_identifier, ?object_identifier) - zero_or_more
instantiates_class(?object_identifier, ?object_identifier, ?scope) - zero_or_more
Errorsï
Instance
is neither a variable nor a valid object identifier:type_error(object_identifier, Instance)
Class
is neither a variable nor a valid object identifier:type_error(object_identifier, Class)
Scope
is neither a variable nor an atom:type_error(atom, Scope)
Scope
is an atom but an invalid entity scope:domain_error(scope, Scope)
Examplesï
% check that the water_jug is an instante of state_space:
| ?- instantiates_class(water_jug, state_space).
% enumerate the state_space instances where the
% instantiation relation is public:
| ?- instantiates_class(Space, state_space, public).