What does _ mean in Prolog?
Category:
technology and computing
programming languages
A single underscore ( _ ) denotes an anonymous variable and means "any term". Unlike other variables, the underscore does not represent the same value everywhere it occurs within a predicate definition. A compound term is composed of an atom called a "functor" and a number of "arguments", which are again terms.
Also to know is, what does + mean in Prolog?
[ISO]+ :Goal. True if'Goal' cannot be proven (mnemonic: + refers to provable and the backslash ( ) is normally used to indicate negation in Prolog).
Similarly, what is functor in Prolog?
functor, functor In Prolog, the word functor is used to refer to the atom at the start of a structure, along with its arity, that is, the number of arguments it takes. For example, in likes(mary, pizza) , likes/2 is the functor.
Predicates. Each predicate has a name, and zero or more arguments. The predicate name is a Prolog atom. Each argument is an arbitrary Prolog term. The clauses that constitute a predicate denote logical alternatives: If any clause is true, then the whole predicate is true.