News for hackers. Stuff that matters.
Re:A Short Introduction to Prolog by JadeNB on Friday August 05, 2011 @10:26AM (#2850175)
Prolog also has syntax for if-then, so

    x(A, C), x(A, B), x(B, C); not(x(A, C)).
can essentially be re-written as

    x(A, C) -> x(A, B), x(B, C); true.
(This saves testing `x(A, C)` twice. Also, `->` implicitly cuts, presenting backtracking over `x(A, C)`; but that shouldn't matter here.) However, this set-up mistakenly has `x(A, C)` as the antecedent; I think you actually want it as the consequent.

There are no comments on this comment yet.