Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does \+ mean in Prolog?

Tags:

prolog

I've seen some answers here that use it and I don't know what it means or how to use it. I's also hard to look for it via a search engine :)

like image 658
Juanjo Conti Avatar asked Nov 10 '09 23:11

Juanjo Conti


People also ask

What does the symbol mean in Prolog?

! symbol represents the cut . You can read more about cut here. Also, an example in prolog can be found here.

What does =:= mean in Prolog?

=:= expression is meaning of exactly equal. such as in JavaScript you can use === to also see if the type of the variables are same. Basically it's same logic but =:= is used in functional languages as Prolog, Erlang.

What is == in Prolog?

The = "operator" in Prolog is actually a predicate (with infix notation) =/2 that succeeds when the two terms are unified. Thus X = 2 or 2 = X amount to the same thing, a goal to unify X with 2. The == "operator" differs in that it succeeds only if the two terms are already identical without further unification.

What does X Y mean in Prolog?

The notation [X|Y] refers to a list whose first element is X and whose tail is Y.


1 Answers

It's the 'not provable' operator. It succeeds if its argument is not provable (and fails if its argument is provable).

like image 92
Carl Norum Avatar answered Sep 28 '22 04:09

Carl Norum