does anybody know if the ":-" from prolog has a na...
# of-logic-programming
e
does anybody know if the ":-" from prolog has a name? I thought it was a textual form of "turnstile", but it seems the turnstile operator works on the "opposite direction"
in prolog A :- B means "A if B", if I get it right, "A ⊢ B" means "from A I know that B", so not the same thing, kind of the opposite in fact
c
That's a good question. According to this, it's a "neck symbol" used to separate the head and the body of a rule
👔 3
d
According to https://mitpress.mit.edu/books/art-prolog-second-edition, p. 19 (it's open access yay), it's a backward arrow for the (backward) logical implication. p. 120: "The syntax of logic programs that we have been using fits within Standard Prolog except that we use some characters not available on a standard keyboard. We give the standard equivalent of our special characters. Thus :- should be used instead of ← in Prolog programs to separate the head of a clause from its body." I wonder why they didn't choose <- as a symbol ...
👍 2
1
Russell & Norvig 2010, p. 339: "Prolog programs are sets of definite clauses written in a notation somewhat different from standard first-order logic. [...] the clause is written “backwards” from what we are used to; instead of A ∧ B ⇒ C in Prolog we have C :- A, B."
(And on p. 244 there: )
b
I forgot which book I saw it in or what Prolog implementation they were using, but instead of
:-
, they were using
<-
(although it was an actual left arrow in the text). So since then, I've been thinking of it as an arrow and "right implies left".
Ah, just chimed in here without reading all the responses and see @David Pomerenke already pointed that out. It must have been that book (it's on my desk but so are a few other prolog books, lol).