Logtalk reference manual
Predicate directive: public/1
Contents > Reference Manual > Directives > public/1

## public/1

#### Description

    public(Functor/Arity)
    public((Functor1/Arity1, Functor2/Arity2, ...))
    public([Functor1/Arity1, Functor2/Arity2, ...])

    public(Functor//Arity)
    public((Functor1//Arity1, Functor2//Arity2, ...))
    public([Functor1//Arity1, Functor2//Arity2, ...])

    public(op(Precedence, Associativity, Operator))

Declares public predicates, public grammar rule non-terminals, and public operators. A public predicate can be called from any object. A public non-terminal can be used as an argument in `phrase/2` and `phrase/3` messages sent from any object. Public operators are not exported but declaring them provides useful information for defining client objects.

#### Template and modes

    public(+predicate_indicator_term)
    public(+non_terminal_indicator_term)
    public(+operator_declaration)

#### Examples

    :- public(ancestor/1).

    :- public((instance/1, instances/1)).

    :- public([leaf/1, leaves/1]).