I’ve searched for an explanation to this but haven’t found one. What do the question mark, plus sign, and minus sign that sometimes precede variable names in the description of a Prolog predicate mean?
Example:
predicate(?Variable1,+Variable2,-Variable3)
?means: This variable can be either instantiated or not. Both ways are possible.+means: This variable is an input to the predicate. As such it must be instantiated.-means: This variable is an output to the predicate. It is usually non-instantiated, but may be if you want to check for a specific “return value”.Source: Chapter 4 of the SWI Prolog documentation.