Logtalk reference manual
Built-in predicate: instantiates_class/2-3
Contents > Reference Manual > Built-in Predicates > instantiates_class/2-3

## 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`.

#### Template and modes

    instantiates_class(?object_identifier, ?object_identifier)
    instantiates_class(?object_identifier, ?object_identifier, ?scope)

#### 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 not a valid entity scope:
  `domain_error(scope, Scope)`

#### Examples

    | ?- instantiates_class(water_jug, state_space).

    | ?- instantiates_class(Space, state_space, public).

#### See also

`current_object/1`, `extends_object/2-3`, `specializes_class/2-3`