Meaning of instantiation mode indicators in arguments of Prolog predicates

Those prefix operators, in this context, represent instantiation modes, i.e. they tell you which arguments should be variables or instantiated when calling the predicate. They also tell you if an argument will be (possibly further) instantiated by the call. They can also be used to tell you that an argument is going to be meta-interpreted in some way by the predicate you’re calling. Some of these instantiation modes are standard, other depend on the system. The most usual are:

- – the argument should be unbound (likely output argument)

+ – the argument should be bound (input argument)

? – the argument can be either bound or unbound

@ – the argument will not be further instantiated by the call

: – the argument will be meta-interpreted in some way (often ambiguous)

0 – the argument will be interpreted as goal and called as such

N – where N is natural number; the argument will be interpreted as a closure that will be composed with N additional arguments to construct a goal that will be called

Different systems provide other or different instantiation modes. For example, for stating that an argument should be ground when calling a predicate, or for stating that an argument should be a predicate indicator or that will be interpreted as a grammar rule body. You will need to refer to the documentation of the Prolog system you’re using for the details.

Leave a Comment